Skip to content
Merged
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
52 changes: 28 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,63 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
allowed-endpoints: |
files.pythonhosted.org:443
github.com:443
pypi.org:443

- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install linting libraries
run: |
python -m pip install ruff
run: python -m pip install ruff

- name: Run Lint 📦
run: |
make lint
run: make lint

build:
name: Conda Build with Python${{ matrix.python-version }}
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
python-version: ["3.11", "3.12"]

steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install packages
run: |
sudo apt-get -y install pandoc graphviz

- name: Install system packages
run: sudo apt-get -y install pandoc graphviz

- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
with:
cache-downloads: true
cache-environment: true
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Install requirements 📦

- name: Install dependencies
run: |
python -m pip install -e ".[dev]"
python -m pip install --editable ".[dev]"

- name: Test with pytest ⚙️
run: |
pytest -v -m "not smoke" tests
run: pytest -v -m "not slow and not online" tests/

docs:
name: Docs (Python${{ matrix.python-version }})
Expand All @@ -84,27 +86,29 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
allowed-endpoints: |
files.pythonhosted.org:443
github.com:443
pypi.org:443

- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install rook with dev requirements 📦
run: |
python -m pip install -e ".[dev]"
run: python -m pip install -e ".[dev]"

- name: Build Docs 📚
run: |
make docs
run: make docs
17 changes: 11 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@ name: rook
channels:
- conda-forge
dependencies:
- python >=3.10,<3.12
- pywps >=4.5.2,<4.7
- python >=3.11,<3.13
- pip
- pywps >=4.5.2,<4.8
- jinja2 >=3.1.4
- click >=8.1.7
- psutil >=6.0.0
- requests
- cftime >=1.2.1
- xarray >=2025.1.1
- xesmf >=0.8.2
- xarray >=2025.6.0,<2025.11.0
- zarr >=2.13.0,<3.0
- xesmf >=0.9.2
- esmpy
- cf_xarray >=0.7
- dask >=2021.12
- netcdf4 >=1.4
- daops >=0.15.0
- clisops >=0.16.1
- daops >=0.16.0
- clisops >=0.17.0
- h5netcdf
- roocs-grids >=0.1.2
- beautifulsoup4 >4.12.3
# workflow
- networkx
# provenance
- prov >=2.0.0
- rdflib
- pydot
- graphviz
# catalog
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ maintainers = [
{name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"},
]
readme = {file = "README.rst", content-type = "text/x-rst"}
requires-python = ">=3.10.0"
requires-python = ">=3.11.0"
keywords = ["wps", "pywps", "birdhouse", "rook"]
license = {file = "LICENSE"}
classifiers = [
Expand All @@ -25,7 +25,6 @@ classifiers = [
"Programming Language :: Python",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Atmospheric Science"
Expand All @@ -35,12 +34,16 @@ dependencies = [
"click >=8.1.7",
"jinja2 >=3.1.4",
"psutil >=6.0.0",
"pywps >=4.5.2,<4.7",
"daops >=0.15.0",
"clisops >=0.16.1",
"pywps >=4.5.2,<4.8",
"daops >=0.16.0",
"clisops >=0.17.0",
"h5netcdf >=1.5.0",
"xesmf >=0.9.2",
"xarray >=2025.6.0",
"roocs_grids >=0.1.2",
"networkx",
"prov >=2.0.0",
"rdflib",
"pydot",
"intake <2.0",
"pandas >=2.0",
Expand Down Expand Up @@ -87,7 +90,6 @@ rook = "rook.cli:cli"

[tool.black]
target-version = [
"py310",
"py311",
"py312"
]
Expand Down
4 changes: 2 additions & 2 deletions src/rook/utils/subset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def calculate(self):

rs = normalise.ResultSet(vars())

for dset, _norm_collection in norm_collection.items():
fixed_collection = apply_fixes(dset, _norm_collection)
for dset, norm_collection_ in norm_collection.items():
fixed_collection = apply_fixes(dset, norm_collection_)
rs.add(
dset,
clisops_subset(fixed_collection, **self.params),
Expand Down
2 changes: 2 additions & 0 deletions tests/test_wps_average_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pywps.tests import assert_process_exception, assert_response_success, client_for
from shapely import Polygon
from rook.utils.metalink_utils import extract_paths_from_metalink
import pytest

from rook.processes.wps_average_shape import AverageByShape

Expand All @@ -21,6 +22,7 @@
)


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_average_shape_cmip6(tmp_path, get_output, pywps_cfg):
# Save POLY to tmpdir
tmp_poly_path = tmp_path / "tmppoly.json"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_wps_orchestrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from rook.utils.metalink_utils import parse_metalink


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_orchestrate(resource_file, get_output, pywps_cfg):
client = client_for(Service(processes=[Orchestrate()], cfgfiles=[pywps_cfg]))
datainputs = "workflow=@xlink:href=file://{}".format(
Expand All @@ -22,6 +23,7 @@ def test_wps_orchestrate(resource_file, get_output, pywps_cfg):
assert "meta4" in get_output(resp.xml)["output"]


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_orchestrate_subset_collection_only(resource_file, get_output, pywps_cfg):
# TODO: this test is slow (25secs) ... but should be fast (1sec)
client = client_for(Service(processes=[Orchestrate()], cfgfiles=[pywps_cfg]))
Expand All @@ -36,6 +38,7 @@ def test_wps_orchestrate_subset_collection_only(resource_file, get_output, pywps
assert "meta4" in get_output(resp.xml)["output"]


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_orchestrate_prov(resource_file, get_output, pywps_cfg):
client = client_for(Service(processes=[Orchestrate()], cfgfiles=[pywps_cfg]))
datainputs = "workflow=@xlink:href=file://{}".format(
Expand All @@ -59,6 +62,7 @@ def test_wps_orchestrate_prov(resource_file, get_output, pywps_cfg):
)


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_orchestrate_prov_with_fixes(resource_file, get_output, pywps_cfg):
client = client_for(Service(processes=[Orchestrate()], cfgfiles=[pywps_cfg]))
datainputs = "workflow=@xlink:href=file://{}".format(
Expand All @@ -74,6 +78,7 @@ def test_wps_orchestrate_prov_with_fixes(resource_file, get_output, pywps_cfg):
assert 'freq="year"' in doc.get_provn()


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_orchestrate_average_latlon_cmip6(resource_file, get_output, pywps_cfg):
client = client_for(Service(processes=[Orchestrate()], cfgfiles=[pywps_cfg]))
datainputs = "workflow=@xlink:href=file://{}".format(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_wps_regrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def _assert_regrid(path):
return _assert_regrid


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_regrid_cmip6(assert_regrid, get_output, pywps_cfg):
client = client_for(Service(processes=[Regrid()], cfgfiles=[pywps_cfg]))
datainputs = "collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803"
Expand All @@ -33,6 +34,7 @@ def test_wps_regrid_cmip6(assert_regrid, get_output, pywps_cfg):
assert_regrid(path=get_output(resp.xml)["output"])


@pytest.mark.xfail(reason="Fails on github actions due to missing esmpy")
def test_wps_regrid_cmip6_custom(assert_regrid, get_output, pywps_cfg):
client = client_for(Service(processes=[Regrid()], cfgfiles=[pywps_cfg]))
datainputs = "collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803"
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
min_version = 4.18.0
envlist =
py{310,311,312},
py{311,312},
lint
requires = pip >= 24.2.0
opts = -v
Expand Down
Loading