From 8dcd08fa391d9e1f985c2082058cef4d18dca9a1 Mon Sep 17 00:00:00 2001 From: Guilhem Barthes Date: Tue, 27 Jun 2023 15:23:29 +0200 Subject: [PATCH 1/4] chore: use `Client.wait_compute_plan` Signed-off-by: Guilhem Barthes --- substrafl_examples/get_started/run_mnist_torch.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/substrafl_examples/get_started/run_mnist_torch.py b/substrafl_examples/get_started/run_mnist_torch.py index 90ad1d39..2195e59d 100644 --- a/substrafl_examples/get_started/run_mnist_torch.py +++ b/substrafl_examples/get_started/run_mnist_torch.py @@ -476,12 +476,7 @@ def __init__(self): import time -# if we are using remote clients, we have to wait until the compute plan is done before getting the results -while ( - client_0.get_compute_plan(compute_plan.key).status == "PLAN_STATUS_DOING" - or client_0.get_compute_plan(compute_plan.key).status == "PLAN_STATUS_TODO" -): - time.sleep(2) +client_0.wait_compute_plan(compute_plan.key) # %% # List results # ============ From 4394b49513c2bcc17f47fb4078240e56fa79b87f Mon Sep 17 00:00:00 2001 From: Guilhem Barthes Date: Wed, 28 Jun 2023 10:19:11 +0200 Subject: [PATCH 2/4] docs: changelog Signed-off-by: Guilhem Barthes --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06412602..a26cbf7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - add `shared state` and `local state` definition in SubstraFL overview ([#321](https://github.com/Substra/substra-documentation/pull/321)) - add `rank` definition in the Substra concepts ([#321](https://github.com/Substra/substra-documentation/pull/321)) - Add experiment name for SubstraFL example ([#323](https://github.com/Substra/substra-documentation/pull/323)) +- Use `Client.wait_compute_plan` in `substrafl_examples/get_started/run_mnist_torch.py` ([#327](https://github.com/Substra/substra-documentation/pull/327)) ## [0.28.0] From 983c46a71a2f04ecc5e30fe2a1554480d77dc908 Mon Sep 17 00:00:00 2001 From: Guilhem Barthes Date: Wed, 28 Jun 2023 10:59:01 +0200 Subject: [PATCH 3/4] fix: apply feedback Signed-off-by: Guilhem Barthes --- substrafl_examples/get_started/run_mnist_torch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/substrafl_examples/get_started/run_mnist_torch.py b/substrafl_examples/get_started/run_mnist_torch.py index 2195e59d..bf9d11e0 100644 --- a/substrafl_examples/get_started/run_mnist_torch.py +++ b/substrafl_examples/get_started/run_mnist_torch.py @@ -476,6 +476,7 @@ def __init__(self): import time +# The results will be available once the compute plan is completed client_0.wait_compute_plan(compute_plan.key) # %% # List results From 812651a7bd2e45da21e41617a91efd68656438a2 Mon Sep 17 00:00:00 2001 From: Guilhem Barthes Date: Fri, 30 Jun 2023 15:35:24 +0200 Subject: [PATCH 4/4] chore: remove leftover `import time` Signed-off-by: Guilhem Barthes --- substrafl_examples/get_started/run_mnist_torch.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/substrafl_examples/get_started/run_mnist_torch.py b/substrafl_examples/get_started/run_mnist_torch.py index bf9d11e0..be0d5b99 100644 --- a/substrafl_examples/get_started/run_mnist_torch.py +++ b/substrafl_examples/get_started/run_mnist_torch.py @@ -474,8 +474,6 @@ def __init__(self): # Explore the results # ******************* -import time - # The results will be available once the compute plan is completed client_0.wait_compute_plan(compute_plan.key) # %%