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

fix: isolate required and optional dependencies #237

Merged
merged 9 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
run: |
pip install uv
uv pip install . -r pyproject.toml --system --extra dev --resolution ${{ matrix.versions.resolution }}
uv pip install .[dev,io] -r pyproject.toml --system --resolution ${{ matrix.versions.resolution }}

- name: Execute Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
- pandoc
- pip
- pip:
- -e ../.[docs]
- -e ../.[docs,io]
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ dependencies = [
"tqdm>=4.64.0",
"dask>=2023.0.1",
"statsmodels>=0.14.0",
"netCDF4>=1.5.8",
"numba>=0.57",
"typing-extensions>=4.8.0",
"zarr>=2.14.0",
"xarray-datatree>=0.0.12",
]

Expand Down Expand Up @@ -53,6 +51,11 @@ docs = [
"ipython>=8.14",
"ipykernel>=6.23",
]
io = [
"h5netcdf>=1.0.0",
"netcdf4>=1.5.8",
"zarr>=2.14.0",
]

[project.urls]
homepage = "https://github.com/xarray-contrib/xeofs"
Expand Down
2 changes: 1 addition & 1 deletion tests/models/cross/test_cca.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_predict():
_ = cca.inverse_transform(Y=Ry_pred)


@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(tmp_path, engine):
"""Test save/load methods in MCA class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
4 changes: 2 additions & 2 deletions tests/models/cross/test_cpcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def test_predict():
_ = cpcca.inverse_transform(Y=Ry_pred)


@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
@pytest.mark.parametrize("alpha", [0.0, 0.5, 1.0])
def test_save_load(tmp_path, engine, alpha):
"""Test save/load methods in MCA class, ensuring that we can
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_save_load(tmp_path, engine, alpha):
assert np.allclose(XYr_o[1], XYr_l[1])


@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
@pytest.mark.parametrize("alpha", [0.0, 0.5, 1.0])
def test_save_load_with_data(tmp_path, engine, alpha):
"""Test save/load methods in CPCCA class, ensuring that we can
Expand Down
2 changes: 1 addition & 1 deletion tests/models/cross/test_mca.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def test_compute(mock_dask_data_array, dim, compute):
(("lon", "lat")),
],
)
@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(dim, mock_data_array, tmp_path, engine):
"""Test save/load methods in MCA class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
2 changes: 1 addition & 1 deletion tests/models/cross/test_mca_rotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def test_compute(mca_model_delayed, compute):
(("lon", "lat")),
],
)
@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(dim, mock_data_array, tmp_path, engine):
"""Test save/load methods in MCA class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
2 changes: 1 addition & 1 deletion tests/models/cross/test_rda.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_predict():
_ = rda.inverse_transform(Y=Ry_pred)


@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(tmp_path, engine):
"""Test save/load methods in MCA class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
2 changes: 1 addition & 1 deletion tests/models/single/test_eof.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def test_inverse_transform(dim, mock_data_array, normalized):
(("lon", "lat")),
],
)
@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(dim, mock_data_array, tmp_path, engine):
"""Test save/load methods in EOF class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
2 changes: 1 addition & 1 deletion tests/models/single/test_eof_rotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def test_compute(eof_model_delayed, compute):
(("lon", "lat")),
],
)
@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(dim, mock_data_array, tmp_path, engine):
"""Test save/load methods in EOF class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
2 changes: 1 addition & 1 deletion tests/models/single/test_sparse_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def test_inverse_transform(dim, mock_data_array, normalized):
(("lon", "lat")),
],
)
@pytest.mark.parametrize("engine", ["netcdf4", "zarr"])
@pytest.mark.parametrize("engine", ["h5netcdf", "netcdf4", "zarr"])
def test_save_load(dim, mock_data_array, tmp_path, engine):
"""Test save/load methods in SparsePCA class, ensuring that we can
roundtrip the model and get the same results when transforming
Expand Down
Loading