From d09d39688ba08ad4b9ebd0c897cafd9834b7a424 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:28:17 -0500 Subject: [PATCH 1/3] Drop Python 3.8 --- .github/workflows/main.yaml | 4 ++-- .github/workflows/pypi-release.yaml | 4 ++-- ci/requirements/doc.yml | 2 +- pyproject.toml | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 05eba78..9c56243 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10"] steps: - uses: actions/checkout@v3 - name: Setup Python @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.10"] + python-version: ["3.9", "3.10"] steps: - uses: actions/checkout@v3 - name: Setup Python diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index 5fc752c..151f4bf 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-python@v4.5.0 name: Install Python with: - python-version: 3.8 + python-version: 3.10 - name: Install dependencies run: | @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-python@v4.5.0 name: Install Python with: - python-version: 3.8 + python-version: 3.10 - uses: actions/download-artifact@v3 with: name: releases diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index 305fd3c..d483372 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -3,7 +3,7 @@ channels: - conda-forge - nodefaults dependencies: - - python=3.8 + - python=3.9 - dask - pydata-sphinx-theme - ipython diff --git a/pyproject.toml b/pyproject.toml index 8811a94..bd07707 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ description = "Batch generation from Xarray objects" readme = "README.rst" license = {text = "Apache"} authors = [{name = "xbatcher Developers", email = "rpa@ldeo.columbia.edu"}] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", @@ -19,7 +19,6 @@ classifiers = [ "Intended Audience :: Science/Research", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering", From dd870e9031dc3d36964cc11b4a26f0e8aba8a928 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:32:36 -0500 Subject: [PATCH 2/3] Update pre-commit --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b801fbd..a3f9abf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: check-yaml - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black-jupyter @@ -27,7 +27,7 @@ repos: hooks: - id: seed-isort-config - repo: https://github.com/PyCQA/isort - rev: 5.11.4 + rev: 5.12.0 hooks: - id: isort From aa2f939f1822b332e0a19facd2172e0a668cbafb Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Thu, 2 Feb 2023 17:37:24 -0500 Subject: [PATCH 3/3] Lint --- xbatcher/generators.py | 3 --- xbatcher/tests/test_keras_loaders.py | 2 -- xbatcher/tests/test_torch_loaders.py | 3 --- 3 files changed, 8 deletions(-) diff --git a/xbatcher/generators.py b/xbatcher/generators.py index 9f43d16..58799ba 100644 --- a/xbatcher/generators.py +++ b/xbatcher/generators.py @@ -380,7 +380,6 @@ def __init__( concat_input_dims: bool = False, preload_batch: bool = True, ): - self.ds = ds self._batch_selectors: BatchSchema = BatchSchema( ds, @@ -419,7 +418,6 @@ def __len__(self) -> int: return len(self._batch_selectors.selectors) def __getitem__(self, idx: int) -> Union[xr.Dataset, xr.DataArray]: - if not isinstance(idx, int): raise NotImplementedError( f"{type(self).__name__}.__getitem__ currently requires a single integer key" @@ -429,7 +427,6 @@ def __getitem__(self, idx: int) -> Union[xr.Dataset, xr.DataArray]: idx = list(self._batch_selectors.selectors)[idx] if idx in self._batch_selectors.selectors: - if self.concat_input_dims: new_dim_suffix = "_input" all_dsets: List = [] diff --git a/xbatcher/tests/test_keras_loaders.py b/xbatcher/tests/test_keras_loaders.py index bde5e73..64843d0 100644 --- a/xbatcher/tests/test_keras_loaders.py +++ b/xbatcher/tests/test_keras_loaders.py @@ -25,7 +25,6 @@ def ds_xy(): def test_custom_dataarray(ds_xy): - x = ds_xy["x"] y = ds_xy["y"] @@ -46,7 +45,6 @@ def test_custom_dataarray(ds_xy): def test_custom_dataarray_with_transform(ds_xy): - x = ds_xy["x"] y = ds_xy["y"] diff --git a/xbatcher/tests/test_torch_loaders.py b/xbatcher/tests/test_torch_loaders.py index cbcc36f..27c31a9 100644 --- a/xbatcher/tests/test_torch_loaders.py +++ b/xbatcher/tests/test_torch_loaders.py @@ -32,7 +32,6 @@ def ds_xy(): ], ) def test_map_dataset(ds_xy, x_var, y_var): - x = ds_xy[x_var] y = ds_xy[y_var] @@ -85,7 +84,6 @@ def test_map_dataset(ds_xy, x_var, y_var): ], ) def test_map_dataset_with_transform(ds_xy, x_var, y_var): - x = ds_xy[x_var] y = ds_xy[y_var] @@ -117,7 +115,6 @@ def y_transform(batch): ], ) def test_iterable_dataset(ds_xy, x_var, y_var): - x = ds_xy[x_var] y = ds_xy[y_var]