From 4a6858dc8ab911816c62f48fabd641cf392f838a Mon Sep 17 00:00:00 2001 From: Stefan Hellander Date: Tue, 5 Dec 2023 16:38:27 +0100 Subject: [PATCH] More formatting --- .vscode/settings.json | 9 ++++++++- fedn/fedn/network/clients/client.py | 19 ------------------- fedn/fedn/network/combiner/modelservice.py | 2 +- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 07cfc57ae..897a14df1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,13 @@ "editor.codeActionsOnSave": { "source.organizeImports": true }, + "[python]": { + "editor.defaultFormatter": "ms-python.autopep8", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": true + } + }, "python.linting.enabled": true, - "python.linting.flake8Enabled": true, + "python.linting.flake8Enabled": true } \ No newline at end of file diff --git a/fedn/fedn/network/clients/client.py b/fedn/fedn/network/clients/client.py index e0836d3aa..8430c4b05 100644 --- a/fedn/fedn/network/clients/client.py +++ b/fedn/fedn/network/clients/client.py @@ -15,7 +15,6 @@ from distutils.dir_util import copy_tree from io import BytesIO -import GPUtil import grpc import psutil from cryptography.hazmat.primitives.serialization import Encoding @@ -36,24 +35,6 @@ VALID_NAME_REGEX = '^[a-zA-Z0-9_-]*$' -def get_system_info(): - gpus = GPUtil.getGPUs() - gpu_info = [["GPU ID: {}".format(gpu.id), gpu.name] for gpu in gpus] - - system_info = { - "os.name": os.name, - "platform.system": platform.system(), - "platform.release": platform.release(), - "hostname": socket.gethostname(), - "ip_address": socket.gethostbyname(socket.gethostname()), - "cpu_count": psutil.cpu_count(logical=True), - "total_memory": psutil.virtual_memory().total, - "total_disk": psutil.disk_usage('/').total, - # Add more details as needed - } - return system_info, gpu_info - - class GrpcAuth(grpc.AuthMetadataPlugin): def __init__(self, key): self._key = key diff --git a/fedn/fedn/network/combiner/modelservice.py b/fedn/fedn/network/combiner/modelservice.py index ab0452ec5..d7a583807 100644 --- a/fedn/fedn/network/combiner/modelservice.py +++ b/fedn/fedn/network/combiner/modelservice.py @@ -104,7 +104,7 @@ def set_model(self, model, id): else: # Handle other file-like objects (including Minio get_object response) bt = BytesIO() - + # Read in chunks of data while True: if hasattr(model, 'stream'):