diff --git a/.github/workflows/interrogate.yml b/.github/workflows/interrogate.yml deleted file mode 100644 index 319a3dd1..00000000 --- a/.github/workflows/interrogate.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow will install and run the interrogate package to check for missing docstrings - -name: Run interrogate - -on: pull_request - -permissions: - contents: read - -jobs: - interrogate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.13" - - name: Install dev dependencies - run: | - python -m pip install --upgrade pip - pip install pyogrio - pip install .[dev] - - name: interrogate checks - run: | - interrogate -v --fail-under 40 --exclude "*/__init__.py" --exclude "*/__main__.py" --output docstring-coverage.txt --generate-badge interrogate-badge.svg - ls -l - - name: Upload docstring-coverage - uses: actions/upload-artifact@v4 - with: - name: docstring-coverage - path: docstring-coverage.txt - if-no-files-found: warn - - name: Upload interrogate badge - uses: actions/upload-artifact@v4 - with: - name: interrogate-badge - path: interrogate-badge.svg - if-no-files-found: warn diff --git a/.github/workflows/run-pre-commit.yml b/.github/workflows/run-pre-commit.yml index 48a16282..4bfd98fe 100644 --- a/.github/workflows/run-pre-commit.yml +++ b/.github/workflows/run-pre-commit.yml @@ -23,7 +23,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pyogrio - pip install .[dev] + pip install pre-commit ruff black - name: pre-commit checks run: | pre-commit run black --all-files diff --git a/CITATION.cff b/CITATION.cff index 0b69a54d..232df0de 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -82,4 +82,4 @@ license: message: If you use this software, please cite it using the metadata from this file. title: "PyEarthTools: Machine learning for Earth system science" type: software -version: 0.5.1 +version: 0.6.0 diff --git a/packages/data/src/pyearthtools/data/transforms/mask.py b/packages/data/src/pyearthtools/data/transforms/mask.py index b6f14854..f796df46 100644 --- a/packages/data/src/pyearthtools/data/transforms/mask.py +++ b/packages/data/src/pyearthtools/data/transforms/mask.py @@ -108,9 +108,10 @@ def __filter( operator_package = np if isinstance(data, (xr.Dataset, xr.DataArray)): operator_package = xr - data = type(data)(data) # type: ignore + data = data.copy() if search_data is not None: - search_data = type(search_data)(search_data) # type: ignore + # search_data = type(search_data)(search_data) # type: ignore + search_data = search_data.copy() operations_dict = { ">": operator.gt, diff --git a/packages/pipeline/src/pyearthtools/pipeline/exceptions.py b/packages/pipeline/src/pyearthtools/pipeline/exceptions.py index 09a8f40c..d7c3fc0f 100644 --- a/packages/pipeline/src/pyearthtools/pipeline/exceptions.py +++ b/packages/pipeline/src/pyearthtools/pipeline/exceptions.py @@ -102,9 +102,6 @@ def __enter__(self): def __exit__(self, exc_type, exc_val, traceback): - # if exc_type: - # import pudb; pudb.set_trace() - if exc_type in self._exceptions: self._count += 1 self._messages.append(str(exc_val)) diff --git a/packages/pipeline/src/pyearthtools/pipeline/operations/xarray/reshape.py b/packages/pipeline/src/pyearthtools/pipeline/operations/xarray/reshape.py index d748672a..89959b92 100644 --- a/packages/pipeline/src/pyearthtools/pipeline/operations/xarray/reshape.py +++ b/packages/pipeline/src/pyearthtools/pipeline/operations/xarray/reshape.py @@ -214,7 +214,7 @@ def __init__(self, coordinate: Hashable): self._coordinate = coordinate def apply_func(self, dataset: xr.Dataset) -> xr.Dataset | xr.DataArray: - dataset = type(dataset)(dataset) + dataset = dataset.copy() for coord in self._coordinate: dtype = dataset.attrs.get(f"{coord}-dtype", "int32") diff --git a/packages/pipeline/tests/operations/xarray/test_xarray_reshape.py b/packages/pipeline/tests/operations/xarray/test_xarray_reshape.py index 3c275da9..250bc494 100644 --- a/packages/pipeline/tests/operations/xarray/test_xarray_reshape.py +++ b/packages/pipeline/tests/operations/xarray/test_xarray_reshape.py @@ -118,11 +118,6 @@ def test_CoordinateFlatten_skip_missing(): def test_undo_CoordinateFlatten(): - - import sys - - print(f"Recursion limit set to {str(sys.getrecursionlimit())}") - f = reshape.CoordinateFlatten(["height"]) f_output = f.apply(SIMPLE_DS2) f_undone = f.undo(f_output) diff --git a/pyproject.toml b/pyproject.toml index cf05f1d9..631ec0d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,38 +26,38 @@ PyEarthTools: Machine learning for Earth system science. version = "0.6.0" dependencies = [ -"pyearthtools-utils>=0.5.1", -"pyearthtools-data>=0.5.1", -"pyearthtools-pipeline>=0.5.1", -"pyearthtools-training>=0.5.1", -"pyearthtools-zoo>=0.5.1", +"pyearthtools-utils>=0.6.0", +"pyearthtools-data>=0.6.0", +"pyearthtools-pipeline>=0.6.0", +"pyearthtools-training>=0.6.0", +"pyearthtools-zoo>=0.6.0", ] [project.optional-dependencies] utils = [ - "pyearthtools-utils>=0.5.1", + "pyearthtools-utils>=0.6.0", ] data = [ - "pyearthtools-data>=0.5.1", + "pyearthtools-data>=0.6.0", ] pipeline = [ - "pyearthtools-pipeline>=0.5.1", + "pyearthtools-pipeline>=0.6.0", ] training = [ - "pyearthtools-training>=0.5.1", + "pyearthtools-training>=0.6.0", ] zoo = [ - "pyearthtools-zoo>=0.5.1", + "pyearthtools-zoo>=0.6.0", ] all = [ - "pyearthtools-utils>=0.5.1", - "pyearthtools-data[all]>=0.5.1", - "pyearthtools-pipeline[all]>=0.5.1", - "pyearthtools-training[all]>=0.5.1", - "pyearthtools-zoo>=0.5.1", + "pyearthtools-utils>=0.6.0", + "pyearthtools-data[all]>=0.6.0", + "pyearthtools-pipeline[all]>=0.6.0", + "pyearthtools-training[all]>=0.6.0", + "pyearthtools-zoo>=0.6.0", ] test = ["pytest", "pytest-cov", "pytest-xdist"] -dev = ["pre-commit", "black==25.1.0", "interrogate", "ruff", "pudb"] +dev = ["pre-commit", "black==25.1.0", "ruff", "pudb"] docs = [ "sphinx", "myst-parser",