Skip to content

Commit

Permalink
Fix/SK-1259 | Use api/v1 for set_active_package in APIClient (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede authored Jan 23, 2025
1 parent a464c7a commit e475618
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ci/tests/examples/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ python ../../.ci/tests/examples/wait_for.py reducer
python ../../.ci/tests/examples/wait_for.py combiners

>&2 echo "Upload compute package"
python ../../.ci/tests/examples/api_test.py set_package --path package.tgz --helper "$helper"
python ../../.ci/tests/examples/api_test.py set_package --path package.tgz --helper "$helper" --name test

>&2 echo "Wait for clients to connect"
python ../../.ci/tests/examples/wait_for.py clients
Expand Down
2 changes: 1 addition & 1 deletion docs/apiclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To set the active compute package in the FEDn Studio Project:

.. code:: python
>>> client.set_active_package("package.tgz", helper="numpyhelper")
>>> client.set_active_package("package.tgz", helper="numpyhelper", name="my-package")
>>> client.set_active_model("seed.npz")
**Start a training session**
Expand Down
2 changes: 1 addition & 1 deletion docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ so we will not require authentication of clients (insecure mode) when using the
from fedn import APIClient
client = APIClient(host="localhost", port=8092)
client.set_active_package("package.tgz", helper="numpyhelper")
client.set_active_package("package.tgz", helper="numpyhelper", name="my-package")
client.set_active_model("seed.npz")
To connect a native FEDn client to the sandbox deployment, you need to make sure that the combiner service can be resolved by the client using the name "combiner".
Expand Down
4 changes: 2 additions & 2 deletions examples/api-tutorials/API_Example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/api-tutorials/Aggregators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper')\n",
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper', 'mnist-pytorch')\n",
"client.set_active_model('../mnist-pytorch/seed.npz')\n",
"seed_model = client.get_active_model()\n",
"print(seed_model)"
Expand Down
2 changes: 1 addition & 1 deletion examples/api-tutorials/Hyperparameter_Tuning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"metadata": {},
"outputs": [],
"source": [
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper')\n",
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper', 'mnist-pytorch')\n",
"client.set_active_model('../mnist-pytorch/seed.npz')\n",
"seed_model = client.get_active_model()"
]
Expand Down
2 changes: 1 addition & 1 deletion fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def download_package(self, path: str):
else:
return {"success": False, "message": "Failed to download package."}

def set_active_package(self, path: str, helper: str, name: str = None, description: str = None):
def set_active_package(self, path: str, helper: str, name: str, description: str = ""):
"""Set the compute package in the statestore.
:param path: The file path of the compute package to set.
Expand Down

0 comments on commit e475618

Please sign in to comment.