Skip to content

Commit

Permalink
chore: bump dependencies for all examples (#441)
Browse files Browse the repository at this point in the history
* chore: bump dependencies for all examples

Signed-off-by: SdgJlbl <[email protected]>

* chore: remove unused lines in `nitpick_ignore`

Signed-off-by: Guilhem Barthés <[email protected]>

* feat: ignore remaining torch docstring

Signed-off-by: Guilhem Barthés <[email protected]>

---------

Signed-off-by: SdgJlbl <[email protected]>
Signed-off-by: Guilhem Barthés <[email protected]>
Co-authored-by: Guilhem Barthés <[email protected]>
  • Loading branch information
SdgJlbl and guilhem-barthes authored Oct 1, 2024
1 parent 644671a commit d2bad31
Show file tree
Hide file tree
Showing 18 changed files with 1,153 additions and 1,269 deletions.
1 change: 1 addition & 0 deletions changes/441.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump all examples dependencies.
7 changes: 4 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,7 @@ def reformat_md_section_links(file_path: Path):
("py:class", "torch.nn.modules.module.Module"),
("py:class", "torch.nn.modules.Module"),
("py:class", "torch.nn.modules.loss._Loss"),
("py:class", "torch.optim.optimizer.Optimizer"),
("py:class", "torch.optim.lr_scheduler._LRScheduler"),
("py:class", "torch.utils.data.dataset.Dataset"),
("py:class", "torch.nn.modules.module.T"),
("py:class", "string"),
("py:class", "Module"),
Expand All @@ -378,7 +376,6 @@ def reformat_md_section_links(file_path: Path):
("py:attr", "strict"),
("py:attr", "grad_output"),
("py:attr", "requires_grad"),
("py:attr", "device"),
("py:attr", "non_blocking"),
("py:attr", "dst_type"),
("py:attr", "dtype"),
Expand All @@ -399,6 +396,10 @@ def reformat_md_section_links(file_path: Path):
("py:class", "substrafl.algorithms.pytorch.torch_scaffold_algo.CUpdateRule"),
]

nitpick_ignore_regex = [
# Used to ignore a torch.nn.Parameter`s\n... as we cannot identify the exact content of it
("py:class", r"torch.nn.Parameter(?s:.)*"),
]
# This must be the name of an image file (path relative to the configuration
# directory) that is the favicon of the docs. Modern browsers use this as
# the icon for tabs, windows and bookmarks. It should be a Windows-style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install 'pandas<2.0' 'numpy<2.0' substratools
RUN pip3 install pandas numpy substratools

# add your algorithm script to docker image
ADD federated_analytics_functions.py .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install 'pandas<2.0' 'numpy<2.0' substratools
RUN pip3 install pandas numpy substratools

# add your algorithm script to docker image
ADD federated_analytics_functions.py .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install 'pandas<2.0' 'numpy<2.0' substratools
RUN pip3 install pandas numpy substratools

# add your algorithm script to docker image
ADD federated_analytics_functions.py .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==3.6.3
scikit-learn==1.5.0
matplotlib==3.9.2
scikit-learn==1.5.2
pandas==2.2.2
substra
substratools
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install pandas 'numpy<2.0' 'scikit-learn==1.5.0' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substratools

# add your function script to docker image
ADD titanic_function_rf.py .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install pandas 'numpy<2.0' 'scikit-learn==1.5.0' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substratools

# add your function script to docker image
ADD titanic_function_rf.py .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM python:3.12-slim

# install dependencies
RUN pip3 install pandas 'numpy<2.0' 'scikit-learn==1.5.0' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substratools

# add your metrics script to docker image
ADD titanic_metrics.py .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==3.6.3
scikit-learn==1.5.0
matplotlib==3.9.2
scikit-learn==1.5.2
pandas==2.2.2
substra
substratools
80 changes: 22 additions & 58 deletions docs/source/examples/substrafl/get_started/run_mnist_torch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substra import Client\n",
Expand Down Expand Up @@ -78,9 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# Create a dictionary to easily access each client from its human-friendly id\n",
Expand Down Expand Up @@ -117,9 +113,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import pathlib\n",
Expand Down Expand Up @@ -159,9 +153,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substra.sdk.schemas import DatasetSpec\n",
Expand Down Expand Up @@ -224,9 +216,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.metrics import accuracy_score\n",
Expand Down Expand Up @@ -283,9 +273,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
Expand Down Expand Up @@ -338,9 +326,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.index_generator import NpIndexGenerator\n",
Expand Down Expand Up @@ -375,9 +361,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"class TorchDataset(torch.utils.data.Dataset):\n",
Expand Down Expand Up @@ -422,9 +406,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.algorithms.pytorch import TorchFedAvgAlgo\n",
Expand Down Expand Up @@ -459,9 +441,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.strategies import FedAvg\n",
Expand All @@ -486,9 +466,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.nodes import TrainDataNode\n",
Expand Down Expand Up @@ -525,9 +503,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.nodes import TestDataNode\n",
Expand Down Expand Up @@ -564,14 +540,12 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.dependency import Dependency\n",
"\n",
"dependencies = Dependency(pypi_dependencies=[\"numpy==1.26.4\", \"scikit-learn==1.5.0\", \"torch==2.2.1\", \"--extra-index-url https://download.pytorch.org/whl/cpu\"])"
"dependencies = Dependency(pypi_dependencies=[\"numpy==2.1.1\", \"scikit-learn==1.5.2\", \"torch==2.4.1\", \"--extra-index-url https://download.pytorch.org/whl/cpu\"])"
]
},
{
Expand Down Expand Up @@ -600,9 +574,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.experiment import execute_experiment\n",
Expand Down Expand Up @@ -651,9 +623,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# The results will be available once the compute plan is completed\n",
Expand All @@ -670,9 +640,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
Expand All @@ -692,9 +660,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -738,9 +704,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"from substrafl.model_loading import download_algo_state\n",
Expand All @@ -762,7 +726,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -776,9 +740,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
matplotlib==3.6.3
numpy==1.26.4
matplotlib==3.9.2
numpy==2.1.1
pandas==2.2.2
scikit-learn==1.5.0
scikit-learn==1.5.2
substrafl
torch==2.2.1
torchvision==0.17.1
torch==2.4.1
torchvision==0.19.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
matplotlib==3.6.3
scikit-learn==1.5.0
numpy==1.26.4
matplotlib==3.9.2
scikit-learn==1.5.2
numpy==2.1.1
pandas==2.2.2
substrafl
Loading

0 comments on commit d2bad31

Please sign in to comment.