diff --git a/openfl/experimental/component/__init__.py b/openfl/experimental/component/__init__.py index 2a1f3c803d..8bb0c3871a 100644 --- a/openfl/experimental/component/__init__.py +++ b/openfl/experimental/component/__init__.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.component package.""" -from .aggregator import Aggregator -from .collaborator import Collaborator - -__all__ = ["Aggregator", "Collaborator"] +# FIXME: Too much recursion +from openfl.experimental.component.aggregator import Aggregator +from openfl.experimental.component.collaborator import Collaborator diff --git a/openfl/experimental/component/aggregator/__init__.py b/openfl/experimental/component/aggregator/__init__.py index 623e22d09b..6686ce37b8 100644 --- a/openfl/experimental/component/aggregator/__init__.py +++ b/openfl/experimental/component/aggregator/__init__.py @@ -2,8 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.component.aggregator package.""" -from .aggregator import Aggregator - -__all__ = [ - "Aggregator", -] +# FIXME: Too much recursion. +from openfl.experimental.component.aggregator import Aggregator diff --git a/openfl/experimental/component/collaborator/__init__.py b/openfl/experimental/component/collaborator/__init__.py index f39c13dd9d..b9089e0eca 100644 --- a/openfl/experimental/component/collaborator/__init__.py +++ b/openfl/experimental/component/collaborator/__init__.py @@ -2,8 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.component.collaborator package.""" -from .collaborator import Collaborator - -__all__ = [ - "Collaborator", -] +# FIXME: Too much recursion. +from openfl.experimental.component.collaborator.collaborator import Collaborator diff --git a/openfl/experimental/federated/__init__.py b/openfl/experimental/federated/__init__.py index 8ce9665a4e..fb82b790ea 100644 --- a/openfl/experimental/federated/__init__.py +++ b/openfl/experimental/federated/__init__.py @@ -2,6 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.federated package.""" -from .plan import Plan # NOQA - -__all__ = ["Plan"] +# FIXME: Recursion! +from openfl.experimental.federated.plan import Plan diff --git a/openfl/experimental/federated/plan/__init__.py b/openfl/experimental/federated/plan/__init__.py index 81fe24d307..9fdecde62c 100644 --- a/openfl/experimental/federated/plan/__init__.py +++ b/openfl/experimental/federated/plan/__init__.py @@ -2,8 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """Experimental Plan package.""" -from .plan import Plan - -__all__ = [ - "Plan", -] +# FIXME: Too much recursion in namespace +from openfl.experimental.federated.plan.plan import Plan diff --git a/openfl/experimental/interface/__init__.py b/openfl/experimental/interface/__init__.py index e656dc0c53..14d076f473 100644 --- a/openfl/experimental/interface/__init__.py +++ b/openfl/experimental/interface/__init__.py @@ -2,7 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.interface package.""" -from .fl_spec import FLSpec -from .participants import Aggregator, Collaborator - -__all__ = ["FLSpec", "Aggregator", "Collaborator"] +from openfl.experimental.interface.fl_spec import FLSpec +from openfl.experimental.interface.participants import Aggregator, Collaborator diff --git a/openfl/experimental/placement/__init__.py b/openfl/experimental/placement/__init__.py index 8356e7956c..b0c05b1b1b 100644 --- a/openfl/experimental/placement/__init__.py +++ b/openfl/experimental/placement/__init__.py @@ -2,6 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.placement package.""" -from .placement import aggregator, collaborator - -__all__ = ["aggregator", "collaborator"] +# FIXME: Unnecessary recursion. +from openfl.experimental.placement.placement import aggregator, collaborator diff --git a/openfl/experimental/transport/__init__.py b/openfl/experimental/transport/__init__.py index 768756ab35..37a10d93f9 100644 --- a/openfl/experimental/transport/__init__.py +++ b/openfl/experimental/transport/__init__.py @@ -1,9 +1,7 @@ # Copyright (C) 2020-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.transport package.""" -from .grpc import AggregatorGRPCClient, AggregatorGRPCServer - -__all__ = [ - "AggregatorGRPCServer", - "AggregatorGRPCClient", -] +from openfl.experimental.transport.grpc import ( + AggregatorGRPCClient, + AggregatorGRPCServer, +) diff --git a/openfl/experimental/transport/grpc/__init__.py b/openfl/experimental/transport/grpc/__init__.py index bb1c6cb189..2b66ade490 100644 --- a/openfl/experimental/transport/grpc/__init__.py +++ b/openfl/experimental/transport/grpc/__init__.py @@ -2,16 +2,14 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.transport.grpc package.""" -from .aggregator_client import AggregatorGRPCClient -from .aggregator_server import AggregatorGRPCServer +from openfl.experimental.transport.grpc.aggregator_client import ( + AggregatorGRPCClient, +) +from openfl.experimental.transport.grpc.aggregator_server import ( + AggregatorGRPCServer, +) +# FIXME: Not the right place for exceptions class ShardNotFoundError(Exception): """Indicates that director has no information about that shard.""" - - -__all__ = [ - "AggregatorGRPCServer", - "AggregatorGRPCClient", - "ShardNotFoundError", -] diff --git a/openfl/experimental/transport/grpc/aggregator_client.py b/openfl/experimental/transport/grpc/aggregator_client.py index 09646226d8..ba04b7d629 100644 --- a/openfl/experimental/transport/grpc/aggregator_client.py +++ b/openfl/experimental/transport/grpc/aggregator_client.py @@ -9,10 +9,11 @@ import grpc from openfl.experimental.protocols import aggregator_pb2, aggregator_pb2_grpc +from openfl.experimental.transport.grpc.grpc_channel_options import ( + channel_options, +) from openfl.utilities import check_equal -from .grpc_channel_options import channel_options - class ConstantBackoff: """Constant Backoff policy.""" diff --git a/openfl/experimental/transport/grpc/aggregator_server.py b/openfl/experimental/transport/grpc/aggregator_server.py index bfc5bb2bd0..e85ed17e87 100644 --- a/openfl/experimental/transport/grpc/aggregator_server.py +++ b/openfl/experimental/transport/grpc/aggregator_server.py @@ -11,10 +11,11 @@ from grpc import StatusCode, server, ssl_server_credentials from openfl.experimental.protocols import aggregator_pb2, aggregator_pb2_grpc +from openfl.experimental.transport.grpc.grpc_channel_options import ( + channel_options, +) from openfl.utilities import check_equal, check_is_in -from .grpc_channel_options import channel_options - logger = logging.getLogger(__name__) diff --git a/openfl/experimental/utilities/__init__.py b/openfl/experimental/utilities/__init__.py index ed9b1aa258..1375a65f81 100644 --- a/openfl/experimental/utilities/__init__.py +++ b/openfl/experimental/utilities/__init__.py @@ -2,46 +2,27 @@ # SPDX-License-Identifier: Apache-2.0 """openfl.experimental.utilities package.""" -from .exceptions import ( +from openfl.experimental.utilities.exceptions import ( ResourcesAllocationError, ResourcesNotAvailableError, SerializationError, ) -from .metaflow_utils import MetaflowInterface -from .resources import get_number_of_gpus -from .runtime_utils import ( +from openfl.experimental.utilities.metaflow_utils import MetaflowInterface +from openfl.experimental.utilities.resources import get_number_of_gpus +from openfl.experimental.utilities.runtime_utils import ( check_resource_allocation, checkpoint, filter_attributes, generate_artifacts, parse_attrs, ) -from .stream_redirect import ( +from openfl.experimental.utilities.stream_redirect import ( RedirectStdStream, RedirectStdStreamBuffer, RedirectStdStreamContext, ) -from .transitions import ( +from openfl.experimental.utilities.transitions import ( aggregator_to_collaborator, collaborator_to_aggregator, should_transfer, ) - -__all__ = [ - "MetaflowInterface", - "should_transfer", - "aggregator_to_collaborator", - "collaborator_to_aggregator", - "SerializationError", - "ResourcesNotAvailableError", - "ResourcesAllocationError", - "RedirectStdStreamBuffer", - "RedirectStdStream", - "RedirectStdStreamContext", - "get_number_of_gpus", - "parse_attrs", - "generate_artifacts", - "filter_attributes", - "checkpoint", - "check_resource_allocation", -] diff --git a/openfl/experimental/workspace_export/__init__.py b/openfl/experimental/workspace_export/__init__.py index ba88041c78..11ac57f2b6 100644 --- a/openfl/experimental/workspace_export/__init__.py +++ b/openfl/experimental/workspace_export/__init__.py @@ -1,6 +1,4 @@ # Copyright (C) 2020-2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -from .export import WorkspaceExport - -__all__ = ["WorkspaceExport"] +from openfl.experimental.workspace_export.export import WorkspaceExport