Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-milea committed May 22, 2024
1 parent 8b5d215 commit 1a5f816
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions packages/syft/src/syft/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from nacl.signing import SigningKey
from result import Err
from result import Result
from syft.types.syft_metaclass import Empty
from typing_extensions import Self

# relative
Expand Down Expand Up @@ -93,7 +92,8 @@
from ..service.service import AbstractService
from ..service.service import ServiceConfigRegistry
from ..service.service import UserServiceConfigRegistry
from ..service.settings.settings import NodeSettings, NodeSettingsUpdate
from ..service.settings.settings import NodeSettings
from ..service.settings.settings import NodeSettingsUpdate
from ..service.settings.settings_service import SettingsService
from ..service.settings.settings_stash import SettingsStash
from ..service.sync.sync_service import SyncService
Expand Down Expand Up @@ -121,7 +121,9 @@
from ..store.mongo_document_store import MongoStoreConfig
from ..store.sqlite_document_store import SQLiteStoreClientConfig
from ..store.sqlite_document_store import SQLiteStoreConfig
from ..types.syft_object import SYFT_OBJECT_VERSION_2, PartialSyftObject
from ..types.syft_metaclass import Empty
from ..types.syft_object import PartialSyftObject
from ..types.syft_object import SYFT_OBJECT_VERSION_2
from ..types.syft_object import SyftObject
from ..types.uid import UID
from ..util.experimental_flags import flags
Expand Down Expand Up @@ -995,13 +997,16 @@ def remove_temp_dir(self) -> None:
if rootdir.exists():
shutil.rmtree(rootdir, ignore_errors=True)

def update_self(self, settings):
updateable_attrs = NodeSettingsUpdate.model_fields.keys() - PartialSyftObject.model_fields.keys()
def update_self(self, settings: NodeSettings) -> None:
updateable_attrs = (
NodeSettingsUpdate.model_fields.keys()
- PartialSyftObject.model_fields.keys()
)
for attr_name in updateable_attrs:
attr = getattr(settings, attr_name)
if attr is not Empty:
setattr(self, attr_name, attr)

@property
def settings(self) -> NodeSettings:
settings_stash = SettingsStash(store=self.document_store)
Expand All @@ -1025,7 +1030,9 @@ def metadata(self) -> NodeMetadataV3:
description = settings_data.description
show_warnings = settings_data.show_warnings
node_type = settings_data.node_type.value if settings_data.node_type else ""
node_side_type = settings_data.node_side_type.value if settings_data.node_side_type else ""
node_side_type = (
settings_data.node_side_type.value if settings_data.node_side_type else ""
)

return NodeMetadataV3(
name=name,
Expand Down

0 comments on commit 1a5f816

Please sign in to comment.