Skip to content

Commit

Permalink
Merge pull request #47 from TUW-GEO/fix-numpy2
Browse files Browse the repository at this point in the history
Fix np.inf for numpy 2.0
  • Loading branch information
wpreimes committed Jun 18, 2024
2 parents 402d205 + 8d42adb commit 6cc7fa2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ["ubuntu-latest"]

steps:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Install package and test
shell: bash -l {0}
run: |
pip install -e .
pip install -e .[testing]
pytest --cache-clear
- name: Upload Coverage
shell: bash -l {0}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: ['windows-latest']

steps:
Expand Down Expand Up @@ -43,5 +43,5 @@ jobs:
- name: Install package and test
shell: bash -l {0}
run: |
pip install -e .
pip install -e .[testing]
pytest --cache-clear
4 changes: 3 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: pygeobase_env
channels:
- conda-forge
dependencies:
- hdf5
- numpy
- netCDF4
- pykdtree
- pip
- pip:
- pygeogrids
- pygeogrids>=0.5.1
- pytest
- pytest-cov
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ python_requires = >=3.6
install_requires =
importlib-metadata; python_version<"3.8"
numpy
pygeogrids
pygeogrids>=0.5.1


[options.packages.find]
Expand All @@ -58,7 +58,6 @@ exclude =

# Add here test requirements (semicolon/line-separated)
testing =
setuptools
pytest
pytest-cov

Expand Down
2 changes: 1 addition & 1 deletion src/pygeobase/io_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def _read_lonlat(self, lon, lat, **kwargs):
data : dict of values
data record.
"""
max_dist = kwargs.pop("max_dist", np.Inf)
max_dist = kwargs.pop("max_dist", np.inf)
gp, _ = self.grid.find_nearest_gpi(lon, lat, max_dist)

return self._read_gp(gp, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions tests/test_io_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def test_gridded_ts_base_read_append():
ds = GriddedTsBase("", grid, Dataset, mode='a')
# during iteration the gpis are traversed based on cells for a cell grid
assert ds.read(1) == 1
assert ds.read(1, 1) == 1


def test_gridded_ts_base_iter_gp_IOError_None_yield():
Expand Down

0 comments on commit 6cc7fa2

Please sign in to comment.