Skip to content

Commit

Permalink
Merge branch 'main' into semantic-partitioner
Browse files Browse the repository at this point in the history
  • Loading branch information
KarhouTam committed Jun 21, 2024
2 parents e8cb7ab + 9899354 commit 2edf546
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/py/flwr/cli/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ def run(

if engine == Engine.SIMULATION:
num_supernodes = config["flower"]["engine"]["simulation"]["supernode"]["num"]
backend_config = config["flower"]["engine"]["simulation"].get(
"backend_config", None
)

typer.secho("Starting run... ", fg=typer.colors.BLUE)
_run_simulation(
server_app_attr=server_app_ref,
client_app_attr=client_app_ref,
num_supernodes=num_supernodes,
backend_config=backend_config,
)
else:
typer.secho(
Expand Down
14 changes: 8 additions & 6 deletions src/py/flwr/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
from flwr.common.constant import APP_DIR, FAB_CONFIG_FILE, FLWR_HOME


def get_flwr_dir() -> Path:
def get_flwr_dir(provided_path: Optional[str] = None) -> Path:
"""Return the Flower home directory based on env variables."""
return Path(
os.getenv(
FLWR_HOME,
f"{os.getenv('XDG_DATA_HOME', os.getenv('HOME'))}/.flwr",
if provided_path is None or not Path(provided_path).is_dir():
return Path(
os.getenv(
FLWR_HOME,
f"{os.getenv('XDG_DATA_HOME', os.getenv('HOME'))}/.flwr",
)
)
)
return Path(provided_path).absolute()


def get_project_dir(
Expand Down

0 comments on commit 2edf546

Please sign in to comment.