Skip to content

Commit

Permalink
Remove dask-ml dependency (since sgkit now includes TruncatedSVD)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Nov 18, 2024
1 parent 0437a65 commit 7c0baf8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/scripts/upstream_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def install_deps() -> None:
"--upgrade",
)
upstream_deps = (
"git+https://github.com/dask/dask.git#egg=dask[array]",
"git+https://github.com/dask/dask.git#egg=dask[array,dataframe]",
"git+https://github.com/dask/distributed.git#egg=distributed",
"git+https://github.com/dask/dask-ml.git#egg=dask-ml",
"git+https://github.com/pandas-dev/pandas#egg=pandas",
"git+https://github.com/pangeo-data/rechunker.git#egg=rechunker",
"git+https://github.com/pydata/xarray.git#egg=xarray",
Expand Down
3 changes: 1 addition & 2 deletions requirements-numpy2.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
numpy < 2.1
xarray
dask[array] >= 2023.01.0, <= 2024.8.0
dask[array,dataframe] >= 2023.01.0, <= 2024.8.0
distributed >= 2023.01.0, <= 2024.8.0
dask-ml
scipy
typing-extensions
numba
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
numpy < 2
xarray
dask[array] >= 2023.01.0, <= 2024.8.0
dask[array,dataframe] >= 2023.01.0, <= 2024.8.0
distributed >= 2023.01.0, <= 2024.8.0
dask-ml
scipy
typing-extensions
numba
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ python_requires = >=3.10
install_requires =
numpy < 2
xarray
dask[array] >= 2022.01.0, <= 2024.8.0
dask[array,dataframe] >= 2022.01.0, <= 2024.8.0
distributed >= 2022.01.0, <= 2024.8.0
dask-ml
scipy
zarr >= 2.10.0, != 2.11.0, != 2.11.1, != 2.11.2, < 3
numba
Expand Down
6 changes: 3 additions & 3 deletions sgkit/stats/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ def pca(
Principal axes defined as eigenvectors for sample covariance matrix.
In the context of SVD, these are equivalent to the right singular
vectors in the decomposition of a (N, M) matrix,
i.e. ``dask_ml.decomposition.TruncatedSVD.components_``.
i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.components_``.
sample_pca_loading : [array-like, shape: (M, C)]
Principal axes scaled by square root of eigenvalues.
These values can also be interpreted as the correlation between the
original variables and the unit-scaled principal axes.
sample_pca_explained_variance : [array-like, shape: (C,)]
Variance explained by each principal component. These values are equivalent
to eigenvalues that result from the eigendecomposition of a (N, M) matrix,
i.e. ``dask_ml.decomposition.TruncatedSVD.explained_variance_``.
i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.explained_variance_``.
sample_pca_explained_variance_ratio : [array-like, shape: (C,)]
Ratio of variance explained to total variance for each principal component,
i.e. ``dask_ml.decomposition.TruncatedSVD.explained_variance_ratio_``.
i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.explained_variance_ratio_``.
Examples
--------
Expand Down
6 changes: 3 additions & 3 deletions sgkit/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def _check_field(
kind="f",
__doc__="""Principal axes defined as eigenvectors for sample covariance matrix.
In the context of SVD, these are equivalent to the right singular vectors in
the decomposition of a (N, M) matrix., i.e. ``dask_ml.decomposition.TruncatedSVD.components_``.""",
the decomposition of a (N, M) matrix., i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.components_``.""",
)
)

Expand All @@ -715,7 +715,7 @@ def _check_field(
kind="f",
__doc__="""Variance explained by each principal component. These values are equivalent
to eigenvalues that result from the eigendecomposition of a (N, M) matrix,
i.e. ``dask_ml.decomposition.TruncatedSVD.explained_variance_``.""",
i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.explained_variance_``.""",
)
)

Expand All @@ -728,7 +728,7 @@ def _check_field(
dims=("components",),
kind="f",
__doc__="""Ratio of variance explained to total variance for each principal component,
i.e. ``dask_ml.decomposition.TruncatedSVD.explained_variance_ratio_``.""",
i.e. ``sgkit.stats.truncated_svd.TruncatedSVD.explained_variance_ratio_``.""",
)
)

Expand Down

0 comments on commit 7c0baf8

Please sign in to comment.