Skip to content

Commit

Permalink
Bug/SK-931 | --preferred-combiner should not be boolean (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmyasris authored Aug 16, 2024
1 parent ceee280 commit b8b368b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/branch-name-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master

env:
BRANCH_REGEX: '^((feature|github|dependabot|hotfix|bugfix|fix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$'
BRANCH_REGEX: '(?i)^((feature|github|dependabot|hotfix|bugfix|fix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$'

jobs:
branch-name-check:
Expand Down
1 change: 0 additions & 1 deletion examples/async-clients/run_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"secure": False,
"preshared_cert": False,
"verify": False,
"preferred_combiner": False,
"validator": True,
"trainer": True,
"init": None,
Expand Down
2 changes: 1 addition & 1 deletion fedn/cli/client_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def list_clients(ctx, protocol: str, host: str, port: str, token: str = None, n_
@click.option("-s", "--secure", required=False, default=False)
@click.option("-pc", "--preshared-cert", required=False, default=False)
@click.option("-v", "--verify", is_flag=True, help="Verify SSL/TLS for REST service")
@click.option("-c", "--preferred-combiner", required=False, default=False)
@click.option("-c", "--preferred-combiner", type=str,required=False, default="combiner",help="name of the preferred combiner")
@click.option("-va", "--validator", required=False, default=True)
@click.option("-tr", "--trainer", required=False, default=True)
@click.option("-in", "--init", required=False, default=None, help="Set to a filename to (re)init client from file state.")
Expand Down
3 changes: 1 addition & 2 deletions fedn/cli/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def build_cmd(ctx, path):
@click.option("-s", "--secure", required=False, default=False)
@click.option("-pc", "--preshared-cert", required=False, default=False)
@click.option("-v", "--verify", is_flag=True, help="Verify SSL/TLS for REST service")
@click.option("-c", "--preferred-combiner", required=False, default=False)
@click.option("-c", "--preferred-combiner", required=False,type=str, default="combiner",help="url to the combiner or name of the preferred combiner")
@click.option("-va", "--validator", required=False, default=True)
@click.option("-tr", "--trainer", required=False, default=True)
@click.option("-in", "--init", required=False, default=None, help="Set to a filename to (re)init client from file state.")
Expand Down Expand Up @@ -262,7 +262,6 @@ def client_cmd(
apply_config(init, config)
click.echo(f"\nClient configuration loaded from file: {init}")
click.echo("Values set in file override defaults and command line arguments...\n")

try:
validate_client_config(config)
except InvalidClientConfig as e:
Expand Down
3 changes: 1 addition & 2 deletions fedn/network/combiner/roundhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ def _assign_round_clients(self, n, type="trainers"):
logger.error("(ERROR): {} is not a supported type of client".format(type))

# If the number of requested trainers exceeds the number of available, use all available.
if n > len(clients):
n = len(clients)
n = min(n, len(clients))

# If not, we pick a random subsample of all available clients.
clients = random.sample(clients, n)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["fedn*"]
exclude = ["tests", "tests.*"]
exclude = ["tests", "tests.*", "examples/notebooks/*.ipynb"]

[tool.ruff]
line-length = 160
Expand Down Expand Up @@ -105,7 +105,8 @@ exclude = [
"fedn_pb2.py",
"fedn_pb2_grpc.py",
".ci",
"test*"
"test*",
"**/*.ipynb"
]

lint.ignore = [
Expand Down

0 comments on commit b8b368b

Please sign in to comment.