diff --git a/examples/async-simulation/Experiment.ipynb b/examples/async-simulation/Experiment.ipynb index c50a8cb11..12a9aee42 100644 --- a/examples/async-simulation/Experiment.ipynb +++ b/examples/async-simulation/Experiment.ipynb @@ -80,17 +80,17 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 70, "id": "f0380d35", "metadata": {}, "outputs": [], "source": [ "session_config_fedavg = {\n", " \"helper\": \"numpyhelper\",\n", - " \"session_id\": \"experiment_fedavg17\",\n", + " \"session_id\": \"experiment_fedavg4\",\n", " \"aggregator\": \"fedavg\",\n", " \"model_id\": seed_model['model_id'],\n", - " \"rounds\": 10,\n", + " \"rounds\": 1,\n", " }\n", "\n", "result_fedavg = client.start_session(**session_config_fedavg)" diff --git a/examples/async-simulation/README.md b/examples/async-simulation/README.md index 859a3035e..11d24eb9a 100644 --- a/examples/async-simulation/README.md +++ b/examples/async-simulation/README.md @@ -18,8 +18,14 @@ cd fedn/examples/async-simulation Install FEDn and dependencies (we recommend using a virtual environment): +Standing in the folder 'fedn/fedn' + +``` +pip install -e . +``` + +From examples/async-simulation ``` -pip install -e ../../fedn pip install -r requirements.txt ``` diff --git a/fedn/fedn/network/controller/control.py b/fedn/fedn/network/controller/control.py index 053e686cd..5f9cfe976 100644 --- a/fedn/fedn/network/controller/control.py +++ b/fedn/fedn/network/controller/control.py @@ -356,7 +356,8 @@ def reduce(self, combiners): model = load_model_from_BytesIO(data, helper) meta["time_aggregate_model"] += time.time() - tic i = i + 1 - self.model_repository.delete_model(model_id) + + self.model_repository.delete_model(model_id) return model, meta diff --git a/fedn/fedn/network/storage/s3/miniorepository.py b/fedn/fedn/network/storage/s3/miniorepository.py index fdc29b558..dcdf5c1f6 100644 --- a/fedn/fedn/network/storage/s3/miniorepository.py +++ b/fedn/fedn/network/storage/s3/miniorepository.py @@ -87,12 +87,12 @@ def list_artifacts(self, bucket): "Could not list models in bucket {}".format(bucket)) return objects - def delete_artifact(self, instance_name, bucket=[]): + def delete_artifact(self, instance_name, bucket): """ Delete object with name instance_name from buckets. :param instance_name: The object name - :param bucket: List of buckets to delete from - :type bucket: list + :param bucket: Buckets to delete from + :type bucket: str """ try: diff --git a/fedn/fedn/network/storage/s3/repository.py b/fedn/fedn/network/storage/s3/repository.py index cc0122e5e..d7d455341 100644 --- a/fedn/fedn/network/storage/s3/repository.py +++ b/fedn/fedn/network/storage/s3/repository.py @@ -63,7 +63,7 @@ def delete_model(self, model_id): :type model_id: str """ try: - self.client.delete_artifact(model_id, bucket=[self.model_bucket]) + self.client.delete_artifact(model_id, bucket=self.model_bucket) except Exception: logger.error("Failed to delete model {} repository.".format(model_id)) raise