Skip to content

Commit bf1a9e0

Browse files
update ref pages
1 parent 623b83b commit bf1a9e0

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

docs/scripts/gen_ref_pages.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
print(f"Generating API pages from {src}")
1313

14+
excluded_dirs = ["tests", "utils", "config"]
15+
1416
for path in sorted(src.rglob("*.py")):
17+
if any(excluded in path.parts for excluded in excluded_dirs):
18+
print(f"Skipping excluded directory: {path}")
19+
continue
1520
print(f"Generating API page for {path}")
1621
module_path = path.relative_to(src).with_suffix("")
1722
print(f"Module path: {module_path}")

nebula/node.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@
4848

4949

5050
async def main(config):
51+
"""
52+
Main function to start the NEBULA node.
53+
54+
This function initiates the NEBULA core component deployed on each federation participant.
55+
It configures the node using the provided configuration object, setting up dataset partitions,
56+
selecting and initializing the appropriate model and data handler, and establishing training
57+
mechanisms. Additionally, it adjusts specific node parameters (such as indices and timing intervals)
58+
based on the participant's configuration, and deploys the node's network communications for
59+
federated learning.
60+
61+
Parameters:
62+
config (Config): Configuration object containing settings for:
63+
- scenario (including federation and deployment parameters),
64+
- model selection and its corresponding hyperparameters,
65+
- dataset and data partitioning,
66+
- training strategy and related arguments,
67+
- device roles and security flags.
68+
69+
Raises:
70+
ValueError: If an unsupported model, dataset, or device role is specified.
71+
NotImplementedError: If an unsupported training strategy (e.g., "scikit") is requested.
72+
73+
Returns:
74+
Coroutine that initializes and starts the NEBULA node.
75+
"""
5176
n_nodes = config.participant["scenario_args"]["n_nodes"]
5277
model_name = config.participant["model_args"]["model"]
5378
idx = config.participant["device_args"]["idx"]

nebula/scenarios.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
# Definition of a scenario
2929
class Scenario:
30+
"""
31+
Class to define a scenario for the NEBULA platform.
32+
It contains all the parameters needed to create a scenario and run it on the platform.
33+
"""
3034
def __init__(
3135
self,
3236
scenario_title,

nebula/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77

88
class FileUtils:
9+
"""
10+
Utility class for file operations.
11+
"""
912
@classmethod
1013
def check_path(cls, base_path, relative_path):
1114
full_path = os.path.normpath(os.path.join(base_path, relative_path))
@@ -17,6 +20,9 @@ def check_path(cls, base_path, relative_path):
1720

1821

1922
class SocketUtils:
23+
"""
24+
Utility class for socket operations.
25+
"""
2026
@classmethod
2127
def is_port_open(cls, port):
2228
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -36,6 +42,9 @@ def find_free_port(cls, start_port=49152, end_port=65535):
3642

3743

3844
class DockerUtils:
45+
"""
46+
Utility class for Docker operations.
47+
"""
3948
@classmethod
4049
def create_docker_network(cls, network_name, subnet=None, prefix=24):
4150
try:

0 commit comments

Comments
 (0)