Skip to content

Commit

Permalink
merge to mastergerge branch 'master' of https://github.com/scaleoutsy…
Browse files Browse the repository at this point in the history
…stems/fedn into Feature/SK-952
  • Loading branch information
sowmyasris committed Aug 20, 2024
2 parents c0a6dba + b6cf292 commit 680d879
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 159 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
14 changes: 13 additions & 1 deletion docs/apiclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ To obtain an admin API token, navigate to the "Settings" tab in your Studio proj
>>> from fedn import APIClient
>>> client = APIClient(host="<controller-host>", token="<access-token>", secure=True, verify=True)
Alternatively, the access token can be sourced from an environment variable.

.. code-block:: bash
$ export FEDN_AUTH_TOKEN=<access-token>
Then passing a token as an argument is not required.

.. code-block:: python
>>> from fedn import APIClient
>>> client = APIClient(host="<controller-host>", secure=True, verify=True)
**Set active package and seed model**

Expand Down Expand Up @@ -78,4 +90,4 @@ And the following code snippet shows how to get a specific session:
session = client.get_session(id="session_name")
For more information on how to use the APIClient, see the :py:mod:`fedn.network.api.client`, and the example `Notebooks <https://github.com/scaleoutsystems/fedn/blob/master/examples/mnist-pytorch/API_Example.ipynb>`_.
For more information on how to use the APIClient, see the :py:mod:`fedn.network.api.client`, and the example `Notebooks <https://github.com/scaleoutsystems/fedn/tree/master/examples/notebooks>`_.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = "Scaleout Systems AB"

# The full version, including alpha/beta/rc tags
release = "0.11.1"
release = "0.12.0"

# Add any Sphinx extension module names here, as strings
extensions = [
Expand Down
227 changes: 80 additions & 147 deletions docs/projects.rst

Large diffs are not rendered by default.

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
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fedn"
version = "0.11.1"
version = "0.12.0"
description = "Scaleout Federated Learning"
authors = [{ name = "Scaleout Systems AB", email = "[email protected]" }]
readme = "README.rst"
Expand Down 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 680d879

Please sign in to comment.