Skip to content

Commit

Permalink
More formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhellander committed Dec 5, 2023
1 parent ee4d74a commit 4a6858d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
19 changes: 0 additions & 19 deletions fedn/fedn/network/clients/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fedn/fedn/network/combiner/modelservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit 4a6858d

Please sign in to comment.