saiph 2.0.11__tar.gz → 2.0.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- saiph-2.0.13/.github/workflows/prepare-release.yml +73 -0
- {saiph-2.0.11 → saiph-2.0.13}/.github/workflows/saiph-ci.yml +4 -2
- {saiph-2.0.11 → saiph-2.0.13}/.gitignore +1 -0
- {saiph-2.0.11 → saiph-2.0.13}/PKG-INFO +2 -2
- {saiph-2.0.11 → saiph-2.0.13}/docs/requirements.txt +1 -1
- {saiph-2.0.11 → saiph-2.0.13}/justfile +4 -0
- {saiph-2.0.11 → saiph-2.0.13}/pyproject.toml +2 -2
- {saiph-2.0.11 → saiph-2.0.13}/release.py +14 -9
- {saiph-2.0.11 → saiph-2.0.13}/saiph/__init__.py +1 -1
- {saiph-2.0.11 → saiph-2.0.13}/saiph/inverse_transform_test.py +32 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/projection.py +14 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/projection_test.py +29 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/famd.py +17 -25
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/famd_test.py +82 -0
- {saiph-2.0.11 → saiph-2.0.13}/uv.lock +72 -72
- {saiph-2.0.11 → saiph-2.0.13}/.github/dependabot.yml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/.github/workflows/pr-title.yml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/.github/workflows/release.yml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/.pre-commit-config.yaml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/.readthedocs.yaml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/.tool-versions +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/CONTRIBUTING.md +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/LICENSE +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/README.md +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/bin/create_csv.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/docs/conf.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/docs/index.rst +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/docs/source/example/README.rst +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/docs/source/example/plot_example.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/docs/source/reference.rst +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/fixtures/iris.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/fixtures/wbcd.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/ruff.toml +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/conftest.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/contribution.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/contribution_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/exception.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/inverse_transform.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/lib/size.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/models.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/py.typed +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/__init__.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/famd_sparse.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/famd_sparse_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/mca.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/mca_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/pca.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/pca_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/utils/__init__.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/utils/common.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/utils/common_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/utils/svd.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/reduction/utils/svd_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/serializer.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/serializer_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/tests/__init_.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/tests/benchmark_test.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/tests/profile_cpu.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/tests/profile_memory.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/saiph/visualization.py +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/setup.cfg +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/breast_cancer_wisconsin.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/breast_cancer_wisconsin_supplemental.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/iris.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/iris_factomineR_contributions.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/iris_factomineR_cos2.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/wbcd_supplemental_coordinates_famd.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/wbcd_supplemental_coordinates_mca.csv +0 -0
- {saiph-2.0.11 → saiph-2.0.13}/tests/fixtures/wbcd_supplemental_coordinates_pca.csv +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: "Prepare Release"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
bump_type:
|
|
7
|
+
description: "Version bump type"
|
|
8
|
+
type: choice
|
|
9
|
+
options: [patch, minor, major]
|
|
10
|
+
default: patch
|
|
11
|
+
run_tests:
|
|
12
|
+
description: "Run CI tests before releasing"
|
|
13
|
+
type: boolean
|
|
14
|
+
default: true
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
run-saiph-ci:
|
|
22
|
+
name: Run Saiph CI
|
|
23
|
+
if: inputs.run_tests
|
|
24
|
+
uses: ./.github/workflows/saiph-ci.yml
|
|
25
|
+
secrets: inherit
|
|
26
|
+
|
|
27
|
+
prepare-release:
|
|
28
|
+
name: Prepare Release
|
|
29
|
+
needs: [run-saiph-ci]
|
|
30
|
+
if: ${{ !failure() && !cancelled() }}
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
permissions:
|
|
33
|
+
contents: write
|
|
34
|
+
|
|
35
|
+
steps:
|
|
36
|
+
- name: Checkout code
|
|
37
|
+
uses: actions/checkout@v6
|
|
38
|
+
with:
|
|
39
|
+
ssh-key: ${{ secrets.OCTOBOT_SSH_PRIVATE_KEY }}
|
|
40
|
+
fetch-depth: 0
|
|
41
|
+
ref: refs/heads/main
|
|
42
|
+
|
|
43
|
+
- name: Set up Python
|
|
44
|
+
uses: actions/setup-python@v6
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.13"
|
|
47
|
+
|
|
48
|
+
- name: Install uv
|
|
49
|
+
uses: astral-sh/setup-uv@v7
|
|
50
|
+
with:
|
|
51
|
+
enable-cache: true
|
|
52
|
+
|
|
53
|
+
- name: Install just
|
|
54
|
+
uses: extractions/setup-just@v4
|
|
55
|
+
|
|
56
|
+
- name: Install dependencies
|
|
57
|
+
run: just install-packages
|
|
58
|
+
|
|
59
|
+
- name: Configure git user
|
|
60
|
+
run: |
|
|
61
|
+
git config --global user.email 'octobot@octopize.io'
|
|
62
|
+
git config --global user.name 'octopize-bot'
|
|
63
|
+
|
|
64
|
+
- name: Import GPG key
|
|
65
|
+
id: import-gpg
|
|
66
|
+
uses: crazy-max/ghaction-import-gpg@v7
|
|
67
|
+
with:
|
|
68
|
+
gpg_private_key: ${{ secrets.OCTOBOT_GPG_PRIVATE_KEY }}
|
|
69
|
+
git_user_signingkey: true
|
|
70
|
+
git_commit_gpgsign: true
|
|
71
|
+
|
|
72
|
+
- name: Prepare release
|
|
73
|
+
run: uv run python release.py --bump-type ${{ inputs.bump_type }} --yes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
name: "Check PR ci"
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
workflow_call:
|
|
4
6
|
|
|
5
7
|
jobs:
|
|
6
8
|
saiph-ci:
|
|
@@ -29,7 +31,7 @@ jobs:
|
|
|
29
31
|
uses: extractions/setup-just@v4
|
|
30
32
|
|
|
31
33
|
- name: Install dependencies
|
|
32
|
-
run:
|
|
34
|
+
run: just install-packages
|
|
33
35
|
|
|
34
36
|
- name: Typecheck
|
|
35
37
|
run: just typecheck
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: saiph
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.13
|
|
4
4
|
Summary: A projection package
|
|
5
5
|
Author-email: Octopize <help@octopize.io>
|
|
6
6
|
License: Apache-2.0
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Python: <3.14,>=3.11
|
|
9
|
-
Requires-Dist: matplotlib>=3.
|
|
9
|
+
Requires-Dist: matplotlib>=3.5.2
|
|
10
10
|
Requires-Dist: msgspec>=0.19
|
|
11
11
|
Requires-Dist: numpy>=1
|
|
12
12
|
Requires-Dist: pandas>=2.2.2
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
matplotlib==3.
|
|
1
|
+
matplotlib==3.11.0
|
|
2
2
|
sphinx-gallery==0.21.0
|
|
@@ -7,6 +7,10 @@ default:
|
|
|
7
7
|
# Install the stack
|
|
8
8
|
install:
|
|
9
9
|
uvx pre-commit install --hook-type commit-msg
|
|
10
|
+
just install-packages
|
|
11
|
+
|
|
12
|
+
# Install packages only (without pre-commit hooks, for CI use)
|
|
13
|
+
install-packages:
|
|
10
14
|
uv sync --extra matplotlib --group dev --group doc
|
|
11
15
|
|
|
12
16
|
# Prepare a new release of saiph
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "saiph"
|
|
3
3
|
# Also modify in saiph/__init__.py
|
|
4
|
-
version = "2.0.
|
|
4
|
+
version = "2.0.13"
|
|
5
5
|
description = "A projection package"
|
|
6
6
|
authors = [
|
|
7
7
|
{name = "Octopize", email = "help@octopize.io"}
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
"toolz>=1",
|
|
17
17
|
"pydantic>=2",
|
|
18
18
|
"msgspec>=0.19",
|
|
19
|
-
"matplotlib>=3.
|
|
19
|
+
"matplotlib>=3.5.2",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
[project.optional-dependencies]
|
|
@@ -90,7 +90,7 @@ def get_version_from_file(filename: Path) -> Optional[Match]: # type: ignore[ty
|
|
|
90
90
|
return get_version_match(file.read(), KEY_MAPPING[filename])
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
def bump_version(bump_type: BumpType) -> None:
|
|
93
|
+
def bump_version(bump_type: BumpType, yes: bool = False) -> None:
|
|
94
94
|
version = get_version_from_file(PYPROJECT_TOML)
|
|
95
95
|
|
|
96
96
|
if not version:
|
|
@@ -100,11 +100,12 @@ def bump_version(bump_type: BumpType) -> None:
|
|
|
100
100
|
|
|
101
101
|
next_version = bump(version, bump_type)
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
if not yes:
|
|
104
|
+
should_bump = typer.confirm(
|
|
105
|
+
f"Upgrade version from {current_version} to {next_version}?"
|
|
106
|
+
)
|
|
107
|
+
if not should_bump:
|
|
108
|
+
raise typer.Abort()
|
|
108
109
|
|
|
109
110
|
bump_version_in_file(PYPROJECT_TOML, key="version", bump_type=bump_type)
|
|
110
111
|
bump_version_in_file(INIT_PY, key="__version__", bump_type=bump_type)
|
|
@@ -186,7 +187,10 @@ def push() -> None:
|
|
|
186
187
|
raise typer.Exit(result)
|
|
187
188
|
|
|
188
189
|
|
|
189
|
-
def check_preconditions() -> None:
|
|
190
|
+
def check_preconditions(yes: bool = False) -> None:
|
|
191
|
+
if yes:
|
|
192
|
+
return
|
|
193
|
+
|
|
190
194
|
preconditions = [
|
|
191
195
|
"Have you run 'make lci'?",
|
|
192
196
|
]
|
|
@@ -200,6 +204,7 @@ def check_preconditions() -> None:
|
|
|
200
204
|
@app.command()
|
|
201
205
|
def release(
|
|
202
206
|
bump_type: BumpType = typer.Option(default=BumpType.PATCH.value),
|
|
207
|
+
yes: bool = typer.Option(False, "--yes", "-y", help="Skip all confirmations (for CI use)"),
|
|
203
208
|
) -> Any:
|
|
204
209
|
proc = subprocess.Popen(
|
|
205
210
|
args=("git", "branch", "--show-current"), stdout=PIPE, text=True
|
|
@@ -212,8 +217,8 @@ def release(
|
|
|
212
217
|
)
|
|
213
218
|
raise typer.Exit(1)
|
|
214
219
|
|
|
215
|
-
check_preconditions()
|
|
216
|
-
bump_version(bump_type)
|
|
220
|
+
check_preconditions(yes)
|
|
221
|
+
bump_version(bump_type, yes)
|
|
217
222
|
run_uv_lock()
|
|
218
223
|
commit_and_tag()
|
|
219
224
|
push()
|
|
@@ -238,3 +238,35 @@ def test_inverse_from_coord_famd(
|
|
|
238
238
|
assert_series_equal(wbcd_statistics.loc["50%"], reversed_statistics.loc["50%"])
|
|
239
239
|
assert_allclose(wbcd_statistics.loc["75%"], reversed_statistics.loc["75%"], atol=1)
|
|
240
240
|
assert_series_equal(wbcd_statistics.loc["max"], reversed_statistics.loc["max"], atol=1)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def test_inverse_transform_preserves_bool_modality_proportions() -> None:
|
|
244
|
+
"""A round-trip must not collapse a bool column onto a single modality.
|
|
245
|
+
|
|
246
|
+
This is the user-visible consequence of scaler() failing to one-hot encode
|
|
247
|
+
non-string modalities: with every dummy zero, undummify() picks essentially
|
|
248
|
+
the same modality for every individual. saiph 2.0.10 to 2.0.12 turned a
|
|
249
|
+
balanced 50/50 bool column into a 98/2 split.
|
|
250
|
+
|
|
251
|
+
The 20 % tolerance is loose on purpose — the point is that both modalities
|
|
252
|
+
survive in roughly their original proportions, not that the round-trip is
|
|
253
|
+
exact.
|
|
254
|
+
"""
|
|
255
|
+
n = 50
|
|
256
|
+
df = pd.DataFrame(
|
|
257
|
+
{
|
|
258
|
+
"flag": pd.array([True] * n + [False] * n, dtype=object),
|
|
259
|
+
# Well-separated per modality, so the projection carries enough
|
|
260
|
+
# signal for the round-trip to recover the right one.
|
|
261
|
+
"value": [float(x) for x in range(n)] + [float(x) for x in range(1000, 1000 + n)],
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
coord, model = fit_transform(df)
|
|
265
|
+
|
|
266
|
+
result = inverse_transform(coord, model)
|
|
267
|
+
|
|
268
|
+
counts = result["flag"].value_counts()
|
|
269
|
+
assert set(counts.index) == {True, False}
|
|
270
|
+
assert counts[True] == pytest.approx(n, rel=0.2)
|
|
271
|
+
assert counts[False] == pytest.approx(n, rel=0.2)
|
|
272
|
+
assert all(isinstance(value, bool) for value in result["flag"])
|
|
@@ -59,6 +59,13 @@ def fit(
|
|
|
59
59
|
_col_weights[df.columns.get_loc(col)] = col_weights[col]
|
|
60
60
|
|
|
61
61
|
# Check column types
|
|
62
|
+
datetime_cols = df.select_dtypes(include=["datetime", "datetimetz"]).columns.tolist()
|
|
63
|
+
if datetime_cols:
|
|
64
|
+
raise ValueError(
|
|
65
|
+
f"DataFrame contains datetime column(s): {datetime_cols}. "
|
|
66
|
+
"Convert them to numeric (e.g. seconds since epoch) before fitting."
|
|
67
|
+
)
|
|
68
|
+
|
|
62
69
|
quanti = df.select_dtypes(include=["int", "float", "number"]).columns.values
|
|
63
70
|
quali = df.select_dtypes(exclude=["int", "float", "number"]).columns.values
|
|
64
71
|
|
|
@@ -199,6 +206,13 @@ def transform(df: pd.DataFrame, model: Model, *, sparse: bool = False) -> pd.Dat
|
|
|
199
206
|
"Call fit() to create a Model instance before calling transform()."
|
|
200
207
|
)
|
|
201
208
|
|
|
209
|
+
datetime_cols = df.select_dtypes(include=["datetime", "datetimetz"]).columns.tolist()
|
|
210
|
+
if datetime_cols:
|
|
211
|
+
raise ValueError(
|
|
212
|
+
f"DataFrame contains datetime column(s): {datetime_cols}. "
|
|
213
|
+
"Convert them to numeric (e.g. seconds since epoch) before transforming."
|
|
214
|
+
)
|
|
215
|
+
|
|
202
216
|
# Check that all the columns of the df is in the model
|
|
203
217
|
model_columns = model.original_continuous + model.original_categorical
|
|
204
218
|
df_columns = df.columns.tolist()
|
|
@@ -438,6 +438,35 @@ def test_fit_checks_col_weights_parameter(
|
|
|
438
438
|
fit(quali_df, col_weights=col_weights)
|
|
439
439
|
|
|
440
440
|
|
|
441
|
+
@pytest.mark.parametrize(
|
|
442
|
+
"df",
|
|
443
|
+
[
|
|
444
|
+
pd.DataFrame({"a": pd.to_datetime(["2021-01-01", "2021-01-02"]), "b": [1, 2]}),
|
|
445
|
+
pd.DataFrame({"a": pd.to_datetime(["2021-01-01", "2021-01-02"])}),
|
|
446
|
+
pd.DataFrame(
|
|
447
|
+
{
|
|
448
|
+
"a": pd.to_datetime(["2021-01-01", "2021-01-02"]),
|
|
449
|
+
"b": ["x", "y"],
|
|
450
|
+
}
|
|
451
|
+
),
|
|
452
|
+
],
|
|
453
|
+
)
|
|
454
|
+
def test_fit_rejects_datetime_columns(df: pd.DataFrame) -> None:
|
|
455
|
+
"""Verify that fit raises ValueError when the DataFrame contains datetime columns."""
|
|
456
|
+
with pytest.raises(ValueError, match="datetime"):
|
|
457
|
+
fit(df)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
def test_transform_rejects_datetime_columns() -> None:
|
|
461
|
+
"""Verify that transform raises ValueError when the DataFrame contains datetime columns."""
|
|
462
|
+
model = fit(pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}))
|
|
463
|
+
df_with_datetime = pd.DataFrame(
|
|
464
|
+
{"a": pd.to_datetime(["2021-01-01", "2021-01-02", "2021-01-03"]), "b": [4, 5, 6]}
|
|
465
|
+
)
|
|
466
|
+
with pytest.raises(ValueError, match="datetime"):
|
|
467
|
+
transform(df_with_datetime, model)
|
|
468
|
+
|
|
469
|
+
|
|
441
470
|
@pytest.mark.parametrize(
|
|
442
471
|
"starting_seed, stored_seed",
|
|
443
472
|
[
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""FAMD projection module."""
|
|
2
2
|
|
|
3
3
|
import sys
|
|
4
|
-
from collections import defaultdict
|
|
5
4
|
from collections.abc import Callable
|
|
6
5
|
from itertools import chain, repeat
|
|
7
6
|
from typing import Any, cast
|
|
@@ -240,6 +239,11 @@ def scaler(model: Model, df: pd.DataFrame) -> pd.DataFrame:
|
|
|
240
239
|
"Expected model to have mean and std attributes,",
|
|
241
240
|
f"got {model.mean} and {model.std} instead.",
|
|
242
241
|
)
|
|
242
|
+
if model._modalities is None:
|
|
243
|
+
raise ValueError(
|
|
244
|
+
"Expected model to have a _modalities attribute to align the dummies on, "
|
|
245
|
+
"got None instead. Call fit() to create a Model instance."
|
|
246
|
+
)
|
|
243
247
|
model.prop = cast(pd.Series, model.prop)
|
|
244
248
|
|
|
245
249
|
df_quanti = df[model.original_continuous]
|
|
@@ -251,31 +255,19 @@ def scaler(model: Model, df: pd.DataFrame) -> pd.DataFrame:
|
|
|
251
255
|
df_quanti = (df_quanti - model.mean) / std_without_zeros
|
|
252
256
|
|
|
253
257
|
# scale
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
df_quali = pd.get_dummies(
|
|
259
|
+
df[model.original_categorical].astype("category"),
|
|
260
|
+
prefix_sep=DUMMIES_SEPARATOR,
|
|
261
|
+
dtype=np.uint8,
|
|
262
|
+
)
|
|
263
|
+
# Align on the fit-time modalities: a modality absent from this batch becomes
|
|
264
|
+
# an all-zero column, and a category unseen at fit is dropped.
|
|
265
|
+
# `reindex` builds the result in a single allocation, unlike the one-by-one
|
|
266
|
+
# `df_quali[mod] = 0` loop it replaces, which fragmented the DataFrame block
|
|
258
267
|
# manager and emitted a PerformanceWarning after 100+ insertions.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
col, _, val = mod.partition(DUMMIES_SEPARATOR)
|
|
263
|
-
col_cats[col].append(val)
|
|
264
|
-
|
|
265
|
-
df_quali = pd.get_dummies(
|
|
266
|
-
df[model.original_categorical].assign(
|
|
267
|
-
**{col: pd.Categorical(df[col], categories=cats) for col, cats in col_cats.items()}
|
|
268
|
-
),
|
|
269
|
-
prefix_sep=DUMMIES_SEPARATOR,
|
|
270
|
-
dtype=np.uint8,
|
|
271
|
-
)
|
|
272
|
-
else:
|
|
273
|
-
df_quali = pd.get_dummies(
|
|
274
|
-
df[model.original_categorical].astype("category"),
|
|
275
|
-
prefix_sep=DUMMIES_SEPARATOR,
|
|
276
|
-
dtype=np.uint8,
|
|
277
|
-
)
|
|
278
|
-
df_quali = df_quali[model._modalities]
|
|
268
|
+
# `fill_value` must be a np.uint8 so that the filled columns keep the dtype
|
|
269
|
+
# asked of get_dummies instead of being upcast to int64.
|
|
270
|
+
df_quali = df_quali.reindex(columns=model._modalities, fill_value=np.uint8(0))
|
|
279
271
|
df_quali = (df_quali - model.prop) / np.sqrt(model.prop)
|
|
280
272
|
|
|
281
273
|
df_scaled = pd.concat([df_quanti, df_quali], axis=1)
|
|
@@ -9,6 +9,7 @@ from numpy.typing import NDArray
|
|
|
9
9
|
from pandas._testing.asserters import assert_series_equal
|
|
10
10
|
from pandas.testing import assert_frame_equal
|
|
11
11
|
|
|
12
|
+
from saiph.models import Model
|
|
12
13
|
from saiph.reduction import DUMMIES_SEPARATOR
|
|
13
14
|
from saiph.reduction.famd import (
|
|
14
15
|
center,
|
|
@@ -398,3 +399,84 @@ def test_transform_novel_category_not_seen_at_fit() -> None:
|
|
|
398
399
|
|
|
399
400
|
assert coord.shape == (1, model.nf)
|
|
400
401
|
assert not coord.isnull().any().any()
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
# ---------------------------------------------------------------------------
|
|
405
|
+
# Non-string modality tests
|
|
406
|
+
# ---------------------------------------------------------------------------
|
|
407
|
+
# scaler() must one-hot encode a categorical column whatever the Python type of
|
|
408
|
+
# its values. Reconstructing the fit-time categories by parsing them out of the
|
|
409
|
+
# dummy column names ("cat___True" -> "True") yields strings, which silently
|
|
410
|
+
# fail to match non-string values such as Python bools or ints: every dummy
|
|
411
|
+
# comes out zero and the individual is projected as if it had no modality at
|
|
412
|
+
# all. See test_inverse_transform_preserves_bool_modality_proportions for the
|
|
413
|
+
# user-visible consequence.
|
|
414
|
+
# ---------------------------------------------------------------------------
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def unscale_dummies(model: Model, df_scaled: pd.DataFrame) -> pd.DataFrame:
|
|
418
|
+
"""Undo the centering and scaling scaler() applies to the dummy block.
|
|
419
|
+
|
|
420
|
+
Returns the raw 0/1 one-hot values, so a test can assert on the encoding
|
|
421
|
+
itself rather than on a downstream projection.
|
|
422
|
+
"""
|
|
423
|
+
prop = cast(pd.Series, model.prop)
|
|
424
|
+
return (df_scaled[model.dummy_categorical] * np.sqrt(prop) + prop).round(6)
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
@pytest.mark.parametrize(
|
|
428
|
+
"values",
|
|
429
|
+
[
|
|
430
|
+
pytest.param(pd.array([True, False] * 10, dtype=object), id="object_bool"),
|
|
431
|
+
pytest.param(pd.Series([True, False] * 10), id="native_bool"),
|
|
432
|
+
pytest.param(pd.Series([True, False] * 10).astype("category"), id="category_bool"),
|
|
433
|
+
pytest.param(pd.array([1, 2] * 10, dtype=object), id="object_int"),
|
|
434
|
+
pytest.param(pd.array([1.5, 2.5] * 10, dtype=object), id="object_float"),
|
|
435
|
+
pytest.param(pd.Series([1, 2] * 10).astype("category"), id="category_int"),
|
|
436
|
+
pytest.param(pd.array(["a", "b"] * 10, dtype=object), id="object_str"),
|
|
437
|
+
# Only the first value decides the type recorded in model.modalities_types,
|
|
438
|
+
# so a column mixing types is where any type-casting scheme breaks down.
|
|
439
|
+
pytest.param(pd.array([True, "unknown"] * 10, dtype=object), id="mixed_bool_str"),
|
|
440
|
+
pytest.param(pd.array([1, "a"] * 10, dtype=object), id="mixed_int_str"),
|
|
441
|
+
pytest.param(pd.array([1, 2.5] * 10, dtype=object), id="mixed_int_float"),
|
|
442
|
+
],
|
|
443
|
+
)
|
|
444
|
+
def test_scaler_one_hot_encodes_categories_of_any_value_type(values: Any) -> None:
|
|
445
|
+
"""Every individual must get exactly one hot dummy, for any modality type."""
|
|
446
|
+
df = pd.DataFrame({"cat": values, "num": [float(i) for i in range(20)]})
|
|
447
|
+
_, model = fit_transform(df)
|
|
448
|
+
|
|
449
|
+
dummies = unscale_dummies(model, scaler(model, df))
|
|
450
|
+
|
|
451
|
+
assert_series_equal(
|
|
452
|
+
dummies.sum(axis=1),
|
|
453
|
+
pd.Series(1.0, index=df.index),
|
|
454
|
+
check_names=False,
|
|
455
|
+
)
|
|
456
|
+
# The hot dummy must be the one naming this row's own modality. Modality
|
|
457
|
+
# names come from the category labels pandas derives from the column, which
|
|
458
|
+
# is not always str(value) — a column mixing ints and floats is homogenised
|
|
459
|
+
# to float, so the int 1 is labelled "1.0".
|
|
460
|
+
labels = df["cat"].astype("category").astype(str)
|
|
461
|
+
expected = [f"cat{DUMMIES_SEPARATOR}{label}" for label in labels]
|
|
462
|
+
assert list(dummies.idxmax(axis=1)) == expected
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def test_scaler_encodes_bool_column_identically_to_str_column() -> None:
|
|
466
|
+
"""A bool column and its stringified twin must produce the same encoding.
|
|
467
|
+
|
|
468
|
+
Pins the invariant behind the whole family: the dummy block depends on which
|
|
469
|
+
modality each row holds, not on the Python type used to spell it.
|
|
470
|
+
"""
|
|
471
|
+
flags = [True, False] * 10
|
|
472
|
+
num = [float(i) for i in range(20)]
|
|
473
|
+
df_bool = pd.DataFrame({"cat": pd.array(flags, dtype=object), "num": num})
|
|
474
|
+
df_str = pd.DataFrame({"cat": [str(flag) for flag in flags], "num": num})
|
|
475
|
+
|
|
476
|
+
_, model_bool = fit_transform(df_bool)
|
|
477
|
+
_, model_str = fit_transform(df_str)
|
|
478
|
+
|
|
479
|
+
assert_frame_equal(
|
|
480
|
+
unscale_dummies(model_bool, scaler(model_bool, df_bool)),
|
|
481
|
+
unscale_dummies(model_str, scaler(model_str, df_str)),
|
|
482
|
+
)
|
|
@@ -1162,7 +1162,7 @@ wheels = [
|
|
|
1162
1162
|
|
|
1163
1163
|
[[package]]
|
|
1164
1164
|
name = "matplotlib"
|
|
1165
|
-
version = "3.
|
|
1165
|
+
version = "3.11.0"
|
|
1166
1166
|
source = { registry = "https://pypi.org/simple" }
|
|
1167
1167
|
dependencies = [
|
|
1168
1168
|
{ name = "contourpy" },
|
|
@@ -1175,39 +1175,39 @@ dependencies = [
|
|
|
1175
1175
|
{ name = "pyparsing" },
|
|
1176
1176
|
{ name = "python-dateutil" },
|
|
1177
1177
|
]
|
|
1178
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1179
|
-
wheels = [
|
|
1180
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1181
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1182
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1183
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1184
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1185
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1186
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1187
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1188
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1189
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1190
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1191
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1192
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1193
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1194
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1195
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1196
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1197
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1198
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1199
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1200
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1201
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1202
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1203
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1204
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1205
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1206
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1207
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1208
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1209
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1210
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1178
|
+
sdist = { url = "https://files.pythonhosted.org/packages/1f/24/080c99d223d158d3a8902769269ab6da5b50f7a0e6e072513907e02b7a6c/matplotlib-3.11.0.tar.gz", hash = "sha256:68c0c7be01b30dcca3638934f7f591df73401235cbdbf0d1ab1c71e7db7f8b57", size = 33251176, upload-time = "2026-06-12T02:29:15.508Z" }
|
|
1179
|
+
wheels = [
|
|
1180
|
+
{ url = "https://files.pythonhosted.org/packages/ce/a2/78f662f1b18968531f67d3fcde1b7ea8496920bacd4f16ddb5b79d112e46/matplotlib-3.11.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:f857524b442f0f36e641868ce2171aafa88cb0bc0644f4e1d8a5df9b32649fef", size = 9436261, upload-time = "2026-06-12T02:27:34.161Z" },
|
|
1181
|
+
{ url = "https://files.pythonhosted.org/packages/5e/92/044f1de43901310202f4c79acf4f141be53b2ca8d8380e2fcefb3d523a75/matplotlib-3.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:57baa92fdc82948ed716eae6d2579d4d6f40965cd8d2f416755b4a72580a3233", size = 9264669, upload-time = "2026-06-12T02:27:37.413Z" },
|
|
1182
|
+
{ url = "https://files.pythonhosted.org/packages/53/f4/f0b4f9ba7ec14a7af8151f3ad71ecfe3561e6ba38cfab1db3681ba4ca112/matplotlib-3.11.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:630eee0e67d35cce2019a0e670719f4816e3b86aff0fa72729f6c69786fceb45", size = 10021076, upload-time = "2026-06-12T02:27:39.926Z" },
|
|
1183
|
+
{ url = "https://files.pythonhosted.org/packages/d7/33/4d679c6dcd594a156542080ac907ddccf7b09ca11655c4b28eca8e9ee5da/matplotlib-3.11.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5106c444d0bf966eee2853548c03772af4ab7199118e086c62fbac8ccb07c055", size = 10828999, upload-time = "2026-06-12T02:27:42.433Z" },
|
|
1184
|
+
{ url = "https://files.pythonhosted.org/packages/07/74/0a3683802037d8cd013144d77c247219b47f2aabace6fdde74faa12bacf7/matplotlib-3.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4d7aea652b58e686444079be3376ef546bffa1eee9b9bb9c472b9fcf6cf410d3", size = 10913103, upload-time = "2026-06-12T02:27:44.827Z" },
|
|
1185
|
+
{ url = "https://files.pythonhosted.org/packages/d0/9f/970fcbf381e82ec66fdf5da8ea76e2e9240f61a24011ce9fd1d42c37ac2d/matplotlib-3.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:70a5b3e9a5dab708c0f039709ae7c68d5b4d254e291ef76492cdba230c8bb5e4", size = 9310945, upload-time = "2026-06-12T02:27:46.867Z" },
|
|
1186
|
+
{ url = "https://files.pythonhosted.org/packages/14/4e/6e7cfed23611265ded53806852343b5c59339e506e84c474a9b5afc3b249/matplotlib-3.11.0-cp311-cp311-win_arm64.whl", hash = "sha256:3d68266213e73823ac3be90615bab0cf31f88851e114cdb1dd25dacf3b01e1a7", size = 8999304, upload-time = "2026-06-12T02:27:48.798Z" },
|
|
1187
|
+
{ url = "https://files.pythonhosted.org/packages/da/17/f5276b496c61477a6c4fc5e7401f4bfe1c2e5ef7c6cd67896f2ade3809cb/matplotlib-3.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:06b5872e9cf11adc8f589ded3ce11bc3e1061ad498259664fabc1f6615beb918", size = 9449976, upload-time = "2026-06-12T02:27:50.989Z" },
|
|
1188
|
+
{ url = "https://files.pythonhosted.org/packages/82/34/bdd77418adb2178a1d59f044bd67bfebb115896e91b840b8a197eb3f4f4e/matplotlib-3.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0515d495124be3124340e59f164d901ed4484e2246a5b74cfa483cac3b80bd97", size = 9279307, upload-time = "2026-06-12T02:27:53.247Z" },
|
|
1189
|
+
{ url = "https://files.pythonhosted.org/packages/94/95/7f522393c88313336b20d70fc849555757b2e5febc22b83b3a3f0fd4bce9/matplotlib-3.11.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:be5f93a1d21981bfb802ded0d77a0caa92d4342a47d45754fac77e314a506344", size = 10031353, upload-time = "2026-06-12T02:27:55.215Z" },
|
|
1190
|
+
{ url = "https://files.pythonhosted.org/packages/87/ce/8f25a0e3186aefd61913e7467d1b999465bcd0d0c03ac695c1b26ca559b7/matplotlib-3.11.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41635d7909d19e52e924a521dde6d8f670b0f53ab1d0e8c331fa831554f681d1", size = 10839232, upload-time = "2026-06-12T02:27:57.746Z" },
|
|
1191
|
+
{ url = "https://files.pythonhosted.org/packages/85/c2/db15da2bbdf9e3ca66df7db8e2c33a1dfed67be24a24d2c878efaaff01d6/matplotlib-3.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:94f5000f67ca9faa300863ea17f8bce9175cb67b88bec4bc7780502d53dd7c9e", size = 10923899, upload-time = "2026-06-12T02:28:00.223Z" },
|
|
1192
|
+
{ url = "https://files.pythonhosted.org/packages/e5/2f/a58a4443a4d052a4ea77557478336aefc26c7981f6408d37adba763aa758/matplotlib-3.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:ac6f1ef39f3d0f9e2463303013094992cdbe0f85f43bc54155bc472b2042768e", size = 9329528, upload-time = "2026-06-12T02:28:02.27Z" },
|
|
1193
|
+
{ url = "https://files.pythonhosted.org/packages/61/0f/4b669589d47733b97ab9df4b58d6fc1e68acb5ea42a928dc7cbdd6bf5871/matplotlib-3.11.0-cp312-cp312-win_arm64.whl", hash = "sha256:9dd11fb612ce7bc60b1de5b4fc87ff959d22317b5de42aabf392f66f97af22eb", size = 9003413, upload-time = "2026-06-12T02:28:04.49Z" },
|
|
1194
|
+
{ url = "https://files.pythonhosted.org/packages/55/41/aa47f156b061d14c98b906f76c428507397708ec63ff94f410ae1752b426/matplotlib-3.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6ce3b839b34ae1f430b4616893a2945a2999debaa7e94e7e29a2a8bbf286f7b5", size = 9450532, upload-time = "2026-06-12T02:28:06.769Z" },
|
|
1195
|
+
{ url = "https://files.pythonhosted.org/packages/8c/4f/5a9eb0375e81413953febf8af7b012a6b6357f53438a15c4f5ad86c6bbb5/matplotlib-3.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:373db8f91214e8ccaf35ac833cc1dd59dd961e148bbd55dd027141591dde1313", size = 9279760, upload-time = "2026-06-12T02:28:09.152Z" },
|
|
1196
|
+
{ url = "https://files.pythonhosted.org/packages/a4/c0/1117d53077e3ac3152503a84e9cf7a5c239576805ee71276e80c2aaa7471/matplotlib-3.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:be152b7570324dc8d01574cc9474dd2d803237acf528bcbb5b211fa347461a09", size = 10031623, upload-time = "2026-06-12T02:28:11.26Z" },
|
|
1197
|
+
{ url = "https://files.pythonhosted.org/packages/92/7e/e937138daffad65b71bf831a377809dcbc830fb4f31a31e067dc1faa2575/matplotlib-3.11.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:126f256df600652d7e4b394cf3164ff75210a00038f287c95a012a6f58d0e83f", size = 10839372, upload-time = "2026-06-12T02:28:14.102Z" },
|
|
1198
|
+
{ url = "https://files.pythonhosted.org/packages/1d/c2/438ecc197ffb8023b6b9922915542f2172f5fd45b76703b0b4fc47322243/matplotlib-3.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:03acfeddf87b0dddb11b081ef7740ad445a3ca8bcb6b8e3011b08f2cf802b75c", size = 10924099, upload-time = "2026-06-12T02:28:16.383Z" },
|
|
1199
|
+
{ url = "https://files.pythonhosted.org/packages/40/2e/395883da416f378b3ed2c9f3e843ac477eae1ce731b671b79adaa6f0bacd/matplotlib-3.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:ab3722f04f3ff34c23b5012c5873d2894174e06c3822fcdac3610965a5ac7d06", size = 9329727, upload-time = "2026-06-12T02:28:18.581Z" },
|
|
1200
|
+
{ url = "https://files.pythonhosted.org/packages/61/82/2c388956abf8bf392dfb5b8917c502f1082df6a941b781ab8c8e5ba2474b/matplotlib-3.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:c945824670fb8915b4ac879e5e61f3c58e0913022f70a0de4c082b17372f8771", size = 9003506, upload-time = "2026-06-12T02:28:20.474Z" },
|
|
1201
|
+
{ url = "https://files.pythonhosted.org/packages/c8/c1/34454baa44da7975ada82e9aea37105ec47059514dc967d3be14426ba8dc/matplotlib-3.11.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:3489c3dc487669b4a980bc3068f87856de7a1564248d3f6c629efb2a58b03f24", size = 9499838, upload-time = "2026-06-12T02:28:22.713Z" },
|
|
1202
|
+
{ url = "https://files.pythonhosted.org/packages/b1/c3/98fe79a398cf232219f090163a7fa7e6766e9f2e0ad26df54d6f8934d8ee/matplotlib-3.11.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:6a98f5476ce784a50ce09998f4ae1e6a9f25043cef8a480c98949902eda74620", size = 9332298, upload-time = "2026-06-12T02:28:24.796Z" },
|
|
1203
|
+
{ url = "https://files.pythonhosted.org/packages/95/e4/b4b7c33151e74e5c802f3cde1ba807ebfc38401e329b44e215a5888dd76d/matplotlib-3.11.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:565af866fd63e4bd3f987d580afe27c44c2552a3b3305f4ecbb85133601ea6f3", size = 10045491, upload-time = "2026-06-12T02:28:27.141Z" },
|
|
1204
|
+
{ url = "https://files.pythonhosted.org/packages/71/28/394548efd68354110c1a1be11fe6b6e559e06d1a23da35908a0e316c55a9/matplotlib-3.11.0-cp313-cp313t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e6b3e64dea5062c570f04358e2711859f3531b459f29516274fbad889079e4f3", size = 10857059, upload-time = "2026-06-12T02:28:29.222Z" },
|
|
1205
|
+
{ url = "https://files.pythonhosted.org/packages/c8/44/e7922e6e2a4d63bdfbc9dc4a53e3850ab438d46cf42e6779bb15ec92c948/matplotlib-3.11.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:942b37c5db1899610bd1543ce8e13e4ecff9a4633e7f63bb6aa9205d2644ebd1", size = 10939576, upload-time = "2026-06-12T02:28:31.66Z" },
|
|
1206
|
+
{ url = "https://files.pythonhosted.org/packages/3d/be/b1ca96003a441d619b727fee21d671fdff7a5ce2f1bb797b2521aa2f679a/matplotlib-3.11.0-cp313-cp313t-win_amd64.whl", hash = "sha256:c08e649a6313e1291e713623b97a38e5bb4aa580b2a100a94a3309bc6b9c8eb3", size = 9379519, upload-time = "2026-06-12T02:28:33.888Z" },
|
|
1207
|
+
{ url = "https://files.pythonhosted.org/packages/e3/72/4bf3b91821c34596dd6a7bdac5836d94f744144c8208939ef49d8ec43f7e/matplotlib-3.11.0-cp313-cp313t-win_arm64.whl", hash = "sha256:2746cd2c113742ff6ce37a864c5ac5fd7aa644568f445e66166e457ac78e40e0", size = 9055456, upload-time = "2026-06-12T02:28:35.878Z" },
|
|
1208
|
+
{ url = "https://files.pythonhosted.org/packages/0f/c2/f5da6cd37ed6871f5c9b3c0507ddb69f14d6c36fac4541e4e0c60cb8cdfc/matplotlib-3.11.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:81ae77077a1e16d37a5b61096ccb07c8d90a99b518fa8256b8f21578932f2f62", size = 9434094, upload-time = "2026-06-12T02:29:09.135Z" },
|
|
1209
|
+
{ url = "https://files.pythonhosted.org/packages/f8/07/56f66906e0f87a0c6d0d0acbd34dbc9432b1931d8f26ef618bd6f92932a9/matplotlib-3.11.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:ddef37840695f5eef65f9f070fe2d2f510f584c2156203f9f622a5b0584efffd", size = 9262183, upload-time = "2026-06-12T02:29:11.283Z" },
|
|
1210
|
+
{ url = "https://files.pythonhosted.org/packages/0c/d8/c4ecab06b7ea36a570c4f3bd2d48d1799fd5d9174470e45c2194199431e7/matplotlib-3.11.0-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cf662e5ac5707658cb931e19972c4bd99f7b4f8b7bf79d3c821d239fa6b71e64", size = 10015653, upload-time = "2026-06-12T02:29:13.251Z" },
|
|
1211
1211
|
]
|
|
1212
1212
|
|
|
1213
1213
|
[[package]]
|
|
@@ -1604,11 +1604,11 @@ wheels = [
|
|
|
1604
1604
|
|
|
1605
1605
|
[[package]]
|
|
1606
1606
|
name = "pip"
|
|
1607
|
-
version = "
|
|
1607
|
+
version = "26.1"
|
|
1608
1608
|
source = { registry = "https://pypi.org/simple" }
|
|
1609
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1609
|
+
sdist = { url = "https://files.pythonhosted.org/packages/73/7e/d2b04004e1068ad4fdfa2f227b839b5d03e602e47cdbbf49de71137c9546/pip-26.1.tar.gz", hash = "sha256:81e13ebcca3ffa8cc85e4deff5c27e1ee26dea0aa7fc2f294a073ac208806ff3", size = 1840316, upload-time = "2026-04-26T21:00:05.406Z" }
|
|
1610
1610
|
wheels = [
|
|
1611
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1611
|
+
{ url = "https://files.pythonhosted.org/packages/70/7a/be4bd8bcbb24ea475856dd68159d78b03b2bb53dae369f69c9606b8888f5/pip-26.1-py3-none-any.whl", hash = "sha256:4e8486d821d814b77319acb7b9e8bf5a4ee7590a643e7cb21029f209be8573c1", size = 1812804, upload-time = "2026-04-26T21:00:03.194Z" },
|
|
1612
1612
|
]
|
|
1613
1613
|
|
|
1614
1614
|
[[package]]
|
|
@@ -1824,7 +1824,7 @@ wheels = [
|
|
|
1824
1824
|
|
|
1825
1825
|
[[package]]
|
|
1826
1826
|
name = "pytest"
|
|
1827
|
-
version = "9.
|
|
1827
|
+
version = "9.1.1"
|
|
1828
1828
|
source = { registry = "https://pypi.org/simple" }
|
|
1829
1829
|
dependencies = [
|
|
1830
1830
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
|
@@ -1833,9 +1833,9 @@ dependencies = [
|
|
|
1833
1833
|
{ name = "pluggy" },
|
|
1834
1834
|
{ name = "pygments" },
|
|
1835
1835
|
]
|
|
1836
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1836
|
+
sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" }
|
|
1837
1837
|
wheels = [
|
|
1838
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1838
|
+
{ url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" },
|
|
1839
1839
|
]
|
|
1840
1840
|
|
|
1841
1841
|
[[package]]
|
|
@@ -2143,32 +2143,32 @@ wheels = [
|
|
|
2143
2143
|
|
|
2144
2144
|
[[package]]
|
|
2145
2145
|
name = "ruff"
|
|
2146
|
-
version = "0.15.
|
|
2147
|
-
source = { registry = "https://pypi.org/simple" }
|
|
2148
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2149
|
-
wheels = [
|
|
2150
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2151
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2152
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2153
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2154
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2155
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2156
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2157
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2158
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2159
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2160
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2161
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2162
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2163
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2164
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2165
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2166
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2146
|
+
version = "0.15.20"
|
|
2147
|
+
source = { registry = "https://pypi.org/simple" }
|
|
2148
|
+
sdist = { url = "https://files.pythonhosted.org/packages/43/dc/35b341fc554ba02f217fc10da57d1a75168cfbcf75b0ef2202176d4c4f2d/ruff-0.15.20.tar.gz", hash = "sha256:1416eb04349192646b54de98f146c4f59afe37d0decfc02c3cbbf396f3a28566", size = 4755489, upload-time = "2026-06-25T17:20:37.578Z" }
|
|
2149
|
+
wheels = [
|
|
2150
|
+
{ url = "https://files.pythonhosted.org/packages/94/d9/2d5014f0253ba541d2061d9fa7193f48e941c8b21bb88a7ff9bbe0bd0596/ruff-0.15.20-py3-none-linux_armv6l.whl", hash = "sha256:00e188c53e499c3c1637f73c91dcf2fb56d576cab76ce1be50a27c4e80e37078", size = 10839665, upload-time = "2026-06-25T17:19:44.702Z" },
|
|
2151
|
+
{ url = "https://files.pythonhosted.org/packages/c6/d3/ac1798ba64f670698867fcfc591d50e7e421bef137db564858f619a30fcf/ruff-0.15.20-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9ebd1fd9b9c95fc0bd7b2761aebec1f030013d2e193a2901b224af68fe47251b", size = 11208649, upload-time = "2026-06-25T17:19:48.787Z" },
|
|
2152
|
+
{ url = "https://files.pythonhosted.org/packages/47/47/d3ac899991202095dfcf3d5176be4272642be3cf981a2f1a30f72a2afb95/ruff-0.15.20-py3-none-macosx_11_0_arm64.whl", hash = "sha256:c5b16cdd67ca108185cd36dce98c576350c03b1660a751de725fb049193a0632", size = 10622638, upload-time = "2026-06-25T17:19:51.354Z" },
|
|
2153
|
+
{ url = "https://files.pythonhosted.org/packages/33/13/4e043fe30aa94d4ff5213a9881fc296d12960f5971b234a5263fdc225312/ruff-0.15.20-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3413bb3c3d2ca6a8208f1f4809cd2dca3c6de6d0b491c0e70847672bde6e6efd", size = 10984227, upload-time = "2026-06-25T17:19:54.044Z" },
|
|
2154
|
+
{ url = "https://files.pythonhosted.org/packages/76/e6/92e7bf40388bc5800073b96564f56264f7e48bfd1a498f5ced6ae6d5a769/ruff-0.15.20-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bd7ec42b3bb3da066488db093308a69c4ac5ee6d2af333a86ba6e2eb2e7dd44b", size = 10622882, upload-time = "2026-06-25T17:19:57.037Z" },
|
|
2155
|
+
{ url = "https://files.pythonhosted.org/packages/13/7a/43460be3f24495a3aa46d4b16873e2c4941b3b5f0b00cf88c03b7b94b339/ruff-0.15.20-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1a36ad0eb77fba9aabfb69ede54de6f376d04ac18ebea022847046d340a8267", size = 11474808, upload-time = "2026-06-25T17:20:00.357Z" },
|
|
2156
|
+
{ url = "https://files.pythonhosted.org/packages/27/a0/f37077884873221c6b33b4ab49eb18f9f88e54a16a25a5bca59bef46dd66/ruff-0.15.20-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b6df3b1e4610432f0386dba04d853b5f08cbbc903410c6fcc02f620f05aff53c", size = 12293094, upload-time = "2026-06-25T17:20:03.446Z" },
|
|
2157
|
+
{ url = "https://files.pythonhosted.org/packages/a6/74/165545b60256a9704c21ac0ec4a0d07933b320812f9584836c9f4aca4292/ruff-0.15.20-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e89f198a1ea6ef0d727c1cf16088bc91a6cb0ab947dedc966715691647186eae", size = 11526176, upload-time = "2026-06-25T17:20:06.301Z" },
|
|
2158
|
+
{ url = "https://files.pythonhosted.org/packages/86/b1/a976a136d40ade83ce743578399865f57001003a409acadc0ecbb3051082/ruff-0.15.20-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309809086c2acb67624950a3c8133e80f32d0d3e27106c0cd60ff26657c9f24b", size = 11520767, upload-time = "2026-06-25T17:20:09.191Z" },
|
|
2159
|
+
{ url = "https://files.pythonhosted.org/packages/19/0f/f032696cb01c9b54c0263fa393474d7758f1cdc021a01b04e3cbc2500999/ruff-0.15.20-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:2d2374caa2f2c2f9e2b7da0a50802cfb8b79f55a9b5e49379f564544fbf56487", size = 11500132, upload-time = "2026-06-25T17:20:13.602Z" },
|
|
2160
|
+
{ url = "https://files.pythonhosted.org/packages/4b/f4/51b1a14bc69e8c224b15dab9cce8e99b425e0455d462caa2b3c9be2b6a8e/ruff-0.15.20-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a1ed17b65293e0c2f22fc387bc13198a5de94bf4429589b0ff6946b0feaf21a3", size = 10943828, upload-time = "2026-06-25T17:20:16.635Z" },
|
|
2161
|
+
{ url = "https://files.pythonhosted.org/packages/71/4b/fe267640783cd02bf6c5cc290b1df1051be2ec294c678b5c15fe19e52343/ruff-0.15.20-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f701305e66b38ea6c91882490eb73459796808e4c6362a1b765255e0cdcd4053", size = 10645418, upload-time = "2026-06-25T17:20:19.4Z" },
|
|
2162
|
+
{ url = "https://files.pythonhosted.org/packages/b0/c0/a65aa4ec2f5e87a1df32dc3ec1fede434fe3dfd5cbcf3b503cafc676ab54/ruff-0.15.20-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5b9c0c367ad8e5d0d5b5b8537864c469a0a0e55417aadfbeca41fa61333be9f4", size = 11211770, upload-time = "2026-06-25T17:20:22.033Z" },
|
|
2163
|
+
{ url = "https://files.pythonhosted.org/packages/5a/a4/0caa331d954ae2723d729d351c989cb4ca8b6077d5c6c2cb6de75e98c041/ruff-0.15.20-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:01cc00dd58f0df339d0e902219dd53990ea99996a0344e5d9cc8d45d5307e460", size = 11618698, upload-time = "2026-06-25T17:20:25.259Z" },
|
|
2164
|
+
{ url = "https://files.pythonhosted.org/packages/10/9b/5f14927848d2fd4aa891fd88d883788c5a7baba561c7874732364045708c/ruff-0.15.20-py3-none-win32.whl", hash = "sha256:ed65ef510e43a137207e0f01cfcf998aeddb1aeeda5c9d35023e910284d7cf21", size = 10857322, upload-time = "2026-06-25T17:20:28.612Z" },
|
|
2165
|
+
{ url = "https://files.pythonhosted.org/packages/fa/f0/fe47c501f9dea92a26d788ff98bb5d92ed4cb4c88792c5c88af6b697dc8e/ruff-0.15.20-py3-none-win_amd64.whl", hash = "sha256:a525c81c70fb0380344dd1d8745d8cc1c890b7fc94a58d5a07bd8eb9557b8415", size = 11993274, upload-time = "2026-06-25T17:20:31.871Z" },
|
|
2166
|
+
{ url = "https://files.pythonhosted.org/packages/d7/2b/9555445e1201d92b3195f45cdb153a0b68f24e0a4273f6e3d5ab46e212bb/ruff-0.15.20-py3-none-win_arm64.whl", hash = "sha256:2f5b2a6d614e8700388806a14996c40fab2c47b819ef57d790a34878858ed9ca", size = 11343498, upload-time = "2026-06-25T17:20:35.03Z" },
|
|
2167
2167
|
]
|
|
2168
2168
|
|
|
2169
2169
|
[[package]]
|
|
2170
2170
|
name = "saiph"
|
|
2171
|
-
version = "2.0.
|
|
2171
|
+
version = "2.0.13"
|
|
2172
2172
|
source = { editable = "." }
|
|
2173
2173
|
dependencies = [
|
|
2174
2174
|
{ name = "matplotlib" },
|
|
@@ -2211,7 +2211,7 @@ doc = [
|
|
|
2211
2211
|
|
|
2212
2212
|
[package.metadata]
|
|
2213
2213
|
requires-dist = [
|
|
2214
|
-
{ name = "matplotlib", specifier = ">=3.
|
|
2214
|
+
{ name = "matplotlib", specifier = ">=3.5.2" },
|
|
2215
2215
|
{ name = "matplotlib", marker = "extra == 'matplotlib'", specifier = ">=3.5.2" },
|
|
2216
2216
|
{ name = "msgspec", specifier = ">=0.19" },
|
|
2217
2217
|
{ name = "numpy", specifier = ">=1" },
|
|
@@ -2600,14 +2600,14 @@ wheels = [
|
|
|
2600
2600
|
|
|
2601
2601
|
[[package]]
|
|
2602
2602
|
name = "tqdm"
|
|
2603
|
-
version = "4.68.
|
|
2603
|
+
version = "4.68.3"
|
|
2604
2604
|
source = { registry = "https://pypi.org/simple" }
|
|
2605
2605
|
dependencies = [
|
|
2606
2606
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
|
2607
2607
|
]
|
|
2608
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2608
|
+
sdist = { url = "https://files.pythonhosted.org/packages/87/d7/0535a28b1f5f24f6612fb3ff1e89fb1a8d160fee0f976e0aa6803862134b/tqdm-4.68.3.tar.gz", hash = "sha256:00dfa48452b6b6cfae3dd9885636c23d3422d1ec97c66d96818cbd5e0821d482", size = 170596, upload-time = "2026-06-17T07:36:52.105Z" }
|
|
2609
2609
|
wheels = [
|
|
2610
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2610
|
+
{ url = "https://files.pythonhosted.org/packages/d8/8e/bb97bb0c71802080bfc8952937d174e49cfc50de5c951dd47b2496f0dcdb/tqdm-4.68.3-py3-none-any.whl", hash = "sha256:39832cc2def2789a6f29df83f172db7416cea70052c0907a57801c5f2fdccb03", size = 78337, upload-time = "2026-06-17T07:36:50.132Z" },
|
|
2611
2611
|
]
|
|
2612
2612
|
|
|
2613
2613
|
[[package]]
|
|
@@ -2621,7 +2621,7 @@ wheels = [
|
|
|
2621
2621
|
|
|
2622
2622
|
[[package]]
|
|
2623
2623
|
name = "typer"
|
|
2624
|
-
version = "0.26.
|
|
2624
|
+
version = "0.26.8"
|
|
2625
2625
|
source = { registry = "https://pypi.org/simple" }
|
|
2626
2626
|
dependencies = [
|
|
2627
2627
|
{ name = "annotated-doc" },
|
|
@@ -2629,9 +2629,9 @@ dependencies = [
|
|
|
2629
2629
|
{ name = "rich" },
|
|
2630
2630
|
{ name = "shellingham" },
|
|
2631
2631
|
]
|
|
2632
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2632
|
+
sdist = { url = "https://files.pythonhosted.org/packages/7c/f7/68adc395201b20b872d68e975386832e8005ffeacedd43a1d837a32815be/typer-0.26.8.tar.gz", hash = "sha256:c244a6bd558886fe3f8780efb6bdd28bb9aff005a94eedebaa5cb32926fe2f7e", size = 202097, upload-time = "2026-06-26T09:22:45.705Z" }
|
|
2633
2633
|
wheels = [
|
|
2634
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2634
|
+
{ url = "https://files.pythonhosted.org/packages/80/87/b9fd69c92c6102a066e1b86a35243f53e70bd4c709f2a26d9f4fee4f4dc0/typer-0.26.8-py3-none-any.whl", hash = "sha256:3512ca79ac5c11113414b36e80281b872884477722440691c89d1112e321a49c", size = 122564, upload-time = "2026-06-26T09:22:44.72Z" },
|
|
2635
2635
|
]
|
|
2636
2636
|
|
|
2637
2637
|
[[package]]
|
|
@@ -2675,11 +2675,11 @@ wheels = [
|
|
|
2675
2675
|
|
|
2676
2676
|
[[package]]
|
|
2677
2677
|
name = "urllib3"
|
|
2678
|
-
version = "2.
|
|
2678
|
+
version = "2.7.0"
|
|
2679
2679
|
source = { registry = "https://pypi.org/simple" }
|
|
2680
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
2680
|
+
sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" }
|
|
2681
2681
|
wheels = [
|
|
2682
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
2682
|
+
{ url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" },
|
|
2683
2683
|
]
|
|
2684
2684
|
|
|
2685
2685
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|