Skip to content

Commit d7dfeda

Browse files
authored
chore: release 0.27.0 (#310)
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
1 parent fd93741 commit d7dfeda

6 files changed

Lines changed: 121 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.27.0]
11+
1012
- Update the metric registration applying the new [SubstraFL #117](https://github.com/Substra/substrafl/pull/117) feature ([#306](https://github.com/Substra/substra-documentation/pull/306/))
1113
- Use the new way of configuring Substra clients in tutorials ([#305](https://github.com/Substra/substra-documentation/pull/305))
1214

docs/source/additional/release.rst

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,85 @@ This is an overview of the main changes, please have a look at the changelog of
2828
- `backend changelog <https://github.com/Substra/substra-backend/blob/main/CHANGELOG.md>`__
2929
- `orchestrator changelog <https://github.com/Substra/orchestrator/blob/main/CHANGELOG.md>`__
3030

31+
Substra 0.27.0 --- 2023-05-11
32+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33+
34+
SubstraFL:
35+
36+
- **BREAKING CHANGE**: SubstraFL used to create one task per metric. Now all metrics are executed into a single task. This will lead to less tasks for a given CP and will improve compute time.
37+
- **BREAKING CHANGE**: Metrics are now given as ``metric_functions`` and not as ``metric_key``. The functions given as metric functions to test data nodes are automatically registered in a new Substra function by SubstraFL.
38+
The new argument of the TestDataNode class ``metric_functions`` replaces the ``metric_keys`` one and accepts a dictionary (using the key as the identifier of the function given as value), a list of functions or directly a function if there is only one metric to compute (``function.__name__`` is then used as identifier).
39+
Installed dependencies are the `algo_dependencies` passed to ``execute_experiment``, and permissions are the same as the predict function.
40+
41+
The metric registration changes from:
42+
43+
.. code-block:: python
44+
45+
def accuracy(datasamples, predictions_path):
46+
y_true = datasamples["labels"]
47+
y_pred = np.load(predictions_path)
48+
49+
return accuracy_score(y_true, np.argmax(y_pred, axis=1))
50+
51+
metric_deps = Dependency(pypi_dependencies=["numpy==1.23.1", "scikit-learn==1.1.1"])
52+
53+
permissions_metric = Permissions(public=False, authorized_ids=DATA_PROVIDER_ORGS_ID)
54+
55+
metric_key = add_metric(
56+
client=client,
57+
metric_function=accuracy,
58+
permissions=permissions_metric,
59+
dependencies=metric_deps,
60+
)
61+
62+
test_data_nodes = [
63+
TestDataNode(
64+
organization_id=org_id,
65+
data_manager_key=dataset_keys[org_id],
66+
test_data_sample_keys=[test_datasample_keys[org_id]],
67+
metric_keys=[metric_key],
68+
)
69+
for org_id in DATA_PROVIDER_ORGS_ID
70+
]
71+
72+
73+
to:
74+
75+
.. code-block:: python
76+
77+
def accuracy(datasamples, predictions_path):
78+
y_true = datasamples["labels"]
79+
y_pred = np.load(predictions_path)
80+
81+
return accuracy_score(y_true, np.argmax(y_pred, axis=1))
82+
83+
test_data_nodes = [
84+
TestDataNode(
85+
organization_id=org_id,
86+
data_manager_key=dataset_keys[org_id],
87+
test_data_sample_keys=[test_datasample_keys[org_id]],
88+
metric_functions={"Accuracy": accuracy},
89+
)
90+
for org_id in DATA_PROVIDER_ORGS_ID
91+
]
92+
93+
- Enforce **kwargs** for functions with more than 3 parameters.
94+
- Add the **Federated Principal Component Analysis strategy**.
95+
96+
Substra
97+
98+
- Substra Clients can now be configured using environment variables or a configuration Yaml file.
99+
- **BREAKING CHANGE**: default backend type for Client is now ``subprocess``.
100+
101+
Front-end:
102+
103+
- Display function name for each task in workflow & tasks table.
104+
- Better performances for workflow.
105+
- Serialize the performance graph regarding the identifier only.
106+
107+
.. figure:: ../static/images/workflow_0.27.0.png
108+
:align: center
109+
:alt: New workflow in frontend
31110

32111
Substra 0.26.3 --- 2023-04-21
33112
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/source/additional/releases.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,44 @@ components: # for table headers
99
- substra-tests
1010

1111
releases:
12+
- version: 0.27.0
13+
components:
14+
substrafl:
15+
version: 0.36.0
16+
link: https://github.com/Substra/substrafl/releases/tag/0.36.0
17+
substra:
18+
version: 0.44.0
19+
link: https://github.com/Substra/substra/releases/tag/0.44.0
20+
substra-tools:
21+
version: 0.20.0
22+
link: https://github.com/Substra/substra-tools/releases/tag/0.20.0
23+
substra-backend:
24+
version: 0.37.0
25+
link: https://github.com/Substra/substra-backend/releases/tag/0.37.0
26+
helm:
27+
version: 22.4.4
28+
link: https://artifacthub.io/packages/helm/substra/substra-backend/22.4.4
29+
orchestrator:
30+
version: 0.34.0
31+
link: https://github.com/Substra/orchestrator/releases/tag/0.34.0
32+
helm:
33+
version: 7.4.13
34+
link: https://artifacthub.io/packages/helm/substra/orchestrator/7.4.13
35+
substra-frontend:
36+
version: 0.41.0
37+
link: https://github.com/Substra/substra-frontend/releases/tag/0.41.0
38+
helm:
39+
version: 1.0.17
40+
link: https://artifacthub.io/packages/helm/substra/substra-frontend/1.0.17
41+
hlf-k8s:
42+
version: 0.2.4
43+
link: https://github.com/Substra/hlf-k8s/releases/tag/0.2.4
44+
helm:
45+
version: 10.2.4
46+
link: https://artifacthub.io/packages/helm/substra/hlf-k8s/10.2.4
47+
substra-tests:
48+
version: 0.40.0
49+
link: https://github.com/Substra/substra-tests/releases/tag/0.40.0
1250
- version: 0.26.3
1351
components:
1452
substrafl:
152 KB
Loading

substrafl_examples/get_started/run_mnist_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def __init__(self):
422422

423423
from substrafl.dependency import Dependency
424424

425-
dependencies = Dependency(pypi_dependencies=["numpy==1.23.1", "torch==1.11.0"])
425+
dependencies = Dependency(pypi_dependencies=["numpy==1.23.1", "torch==1.11.0", "scikit-learn==1.1.1"])
426426

427427
# %%
428428
# We now have all the necessary objects to launch our experiment. Please see a summary below of all the objects we created so far:

substrafl_examples/go_further/run_iris_sklearn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def load(self, path):
411411
# Number of times to apply the compute plan.
412412
NUM_ROUNDS = 6
413413

414-
dependencies = Dependency(pypi_dependencies=["numpy==1.23.1", "torch==1.11.0"])
414+
dependencies = Dependency(pypi_dependencies=["numpy==1.23.1", "torch==1.11.0", "scikit-learn==1.1.1"])
415415

416416
compute_plan = execute_experiment(
417417
client=clients[ALGO_ORG_ID],

0 commit comments

Comments
 (0)