Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: erase traces of substratools #442

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ jobs:
with:
python-version: "3.10"

- name: Clone substra-tools
uses: actions/checkout@v2
with:
repository: substra/substra-tools
path: substra-tools
ref: main

- name: Clone substra
uses: actions/checkout@v2
with:
Expand All @@ -38,11 +31,10 @@ jobs:
path: substrafl
ref: main

- name: Install substra, substra-tools and substrafl
- name: Install substra and substrafl
run: |
pip install -e ./substrafl
pip install -e ./substra
pip install -e ./substra-tools

- name: Copy substra and substrafl api doc in the doc
run: |
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/test-examples-subprocess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Checkout substra-tools on main
uses: actions/checkout@v4
with:
repository: substra/substra-tools
path: substratools

- name: Checkout substra on main
uses: actions/checkout@v4
Expand All @@ -58,7 +53,6 @@ jobs:
pip install --upgrade pip
pip install --upgrade -e substrafl
pip install --upgrade -e substra
pip install --upgrade -e substratools

- name: Install examples dependencies
run: |
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ To deploy the documentation locally you need to install all the necessary requir
You also need to manually install [pandoc](https://github.com/jgm/pandoc/releases/tag/3.1.11.1).


### Install substra, substratools and substrafl in editable mode
### Install substra and substrafl in editable mode

:warning: if you have these repositories installed in non-editable mode, it will not work.

Expand All @@ -48,11 +48,6 @@ git clone [email protected]:Substra/substra.git
cd substra && pip install -e . && cd ..
```

```sh
git clone [email protected]:Substra/substra-tools.git
cd substra-tools && pip install -e . && cd ..
```

```sh
git clone [email protected]:Substra/substrafl.git
cd substrafl && pip install -e '.[dev]' && cd ..
Expand Down
4 changes: 0 additions & 4 deletions docker/substra-documentation-examples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ WORKDIR /usr/src/app

### Dirty build to install docker client ###
# We need to install a docker client because substra debug mode relies on Docker (DinD in a side container)
# and we need a docker client to authenticate this docker against our container registry to download substra-tools.
RUN apt update && apt install --yes apt-transport-https ca-certificates curl gnupg lsb-release
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt update && apt install --yes docker-ce-cli

COPY substra-tools/ substra-tools/
COPY substra/ substra/
COPY substrafl/ substrafl/

RUN cd substrafl && python -m pip install --no-cache-dir -e .

RUN cd substra && python -m pip install --no-cache-dir -e .

RUN cd substra-tools && python -m pip install --no-cache-dir -e .

COPY substra-documentation/Makefile substra-documentation/
COPY substra-documentation/examples_requirements.txt substra-documentation/
COPY substra-documentation/docs/source/examples substra-documentation/docs/source/examples/
Expand Down
5 changes: 2 additions & 3 deletions docs/source/additional/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ This is an overview of the main changes, please have a look at the changelog of
- `substra changelog <https://github.com/Substra/substra/blob/main/CHANGELOG.md>`__
- `substrafl changelog <https://github.com/Substra/substrafl/blob/main/CHANGELOG.md>`__
- `frontend changelog <https://github.com/Substra/substra-frontend/blob/main/CHANGELOG.md>`__
- `substra-tools changelog <https://github.com/Substra/substra-tools/blob/main/CHANGELOG.md>`__
- `backend changelog <https://github.com/Substra/substra-backend/blob/main/CHANGELOG.md>`__
- `orchestrator changelog <https://github.com/Substra/orchestrator/blob/main/CHANGELOG.md>`__

Expand Down Expand Up @@ -707,7 +706,7 @@ This means that all opener.py file should be changed from:

.. code-block:: python

import substratools as tools
from substra import tools

class TestOpener(tools.Opener):
def get_X(self, folders):
Expand All @@ -726,7 +725,7 @@ to:

.. code-block:: python

import substratools as tools
from substra import tools

class TestOpener(tools.Opener):
def get_data(self, folders):
Expand Down
15 changes: 1 addition & 14 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,13 @@
if os.environ.get("READTHEDOCS_VERSION_TYPE") == "tag" or current_commit in tagged_commits:
# Index 0 means latest release
SUBSTRA_VERSION = compat_table["releases"][0]["components"]["substra"]["version"]
TOOLS_VERSION = compat_table["releases"][0]["components"]["substra-tools"]["version"]
SUBSTRAFL_VERSION = compat_table["releases"][0]["components"]["substrafl"]["version"]

else:
SUBSTRA_VERSION = "main"
TOOLS_VERSION = "main"
SUBSTRAFL_VERSION = "main"

print(
f"Versions of the components used:"
f"\n - substra: {SUBSTRA_VERSION}"
f"\n - substra-tools: {TOOLS_VERSION}"
f"\n - substrafl: {SUBSTRAFL_VERSION}"
)
print(f"Versions of the components used:" f"\n - substra: {SUBSTRA_VERSION}" f"\n - substrafl: {SUBSTRAFL_VERSION}")


class SubSectionTitleOrder:
Expand Down Expand Up @@ -195,12 +188,6 @@ class Repo:
doc_dir="docs/api",
dest_doc_dir="substrafl_doc/api",
),
Repo(
pkg_name="substratools",
repo_name="substra-tools",
installation_cmd="#egg=substratools",
version=TOOLS_VERSION,
),
]


Expand Down
1 change: 0 additions & 1 deletion docs/source/documentation/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Substra overview
.. toctree::
:maxdepth: 1

substra_tools

Assets
------
Expand Down
17 changes: 0 additions & 17 deletions docs/source/documentation/substra_tools.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import pathlib
import numpy as np
import pandas as pd
import substratools as tools
from substra import tools


class DiabetesOpener(tools.Opener):
def fake_data(self, n_samples=None):
N_SAMPLES = n_samples if n_samples and n_samples <= 100 else 100

features = ["age", "sex", "bmi", "bp", "s1", "s2", "s3", "s4", "s5", "s6"]
return pd.DataFrame(
data=np.random.random((N_SAMPLES, len(features))), columns=features
)
return pd.DataFrame(data=np.random.random((N_SAMPLES, len(features))), columns=features)

def get_data(self, folders):
return pd.read_csv(
next(pathlib.Path(folders[0]).glob("*.csv")), dtype={"sex": "category"}
)
return pd.read_csv(next(pathlib.Path(folders[0]).glob("*.csv")), dtype={"sex": "category"})
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 substratools
RUN pip3 install pandas numpy substra

# 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 @@ -5,10 +5,10 @@

import numpy as np
import pandas as pd
import substratools as tools
from substra import tools


# We are using helper decorators from the substratools library to avoid rewriting boilerplate code.
# We are using helper decorators from the substra.tools library to avoid rewriting boilerplate code.
# The function to be registered takes an `inputs` parameter, which will be matched to the list of
# `FunctionInputSpec` provided in the `FunctionSpec` definition.
# In a similar way, the parameter `outputs` will be matched to the `FunctionOutputSpec`.
Expand All @@ -20,8 +20,7 @@ def local_first_order_computation(inputs, outputs, task_properties):
"n_samples": len(df),
"means": df.select_dtypes(include=np.number).sum().to_dict(),
"counts": {
name: series.value_counts().to_dict()
for name, series in df.select_dtypes(include="category").items()
name: series.value_counts().to_dict() for name, series in df.select_dtypes(include="category").items()
},
}
save_states(states, outputs["local_analytics_first_moments"])
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 substratools
RUN pip3 install pandas numpy substra

# 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 numpy substratools
RUN pip3 install pandas numpy substra

# 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,4 @@
matplotlib==3.9.2
scikit-learn==1.5.2
pandas==2.2.2
substra
substratools
substra
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@

import numpy as np
import pandas as pd
import substratools as tools
from substra import tools


class TitanicOpener(tools.Opener):
def get_data(self, folders):
# find csv files
paths = [
os.path.join(folder, f)
for folder in folders
for f in os.listdir(folder)
if f.endswith(".csv")
]
paths = [os.path.join(folder, f) for folder in folders for f in os.listdir(folder) if f.endswith(".csv")]

# load data
data = pd.concat([pd.read_csv(path) for path in paths])
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 'scikit-learn==1.5.2' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substra

# 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 @@ -3,7 +3,7 @@

import numpy as np
import pandas as pd
import substratools as tools
from substra import tools
from sklearn.ensemble import RandomForestClassifier


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 'scikit-learn==1.5.2' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substra

# 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 'scikit-learn==1.5.2' substratools
RUN pip3 install pandas numpy 'scikit-learn==1.5.2' substra

# add your metrics script to docker image
ADD titanic_metrics.py .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import substratools as tools
from substra import tools
from sklearn.metrics import accuracy_score
import pandas as pd

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ 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
@@ -1,6 +1,6 @@
import pathlib
import numpy as np
import substratools as tools
from substra import tools


class MnistOpener(tools.Opener):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pathlib
import numpy as np
import pandas as pd
import substratools as tools
from substra import tools


class DiabetesOpener(tools.Opener):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pathlib
import numpy as np
import substratools as tools
from substra import tools


class IrisOpener(tools.Opener):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pathlib
import numpy as np
import substratools as tools
from substra import tools


class MnistOpener(tools.Opener):
Expand Down
Loading
Loading