Skip to content

Commit

Permalink
Update pip dependencies to include scipy
Browse files Browse the repository at this point in the history
  • Loading branch information
wpreimes committed Sep 12, 2024
1 parent 8176925 commit 322f0da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
include:
- os: "ubuntu-latest"
python-version: '3.8' # first supported
- os: "windows-latest"
python-version: '3.8' # first supported
- os: "macos-latest"
python-version: '3.8' # first supported
- os: "ubuntu-latest"
python-version: '3.12' # latest supported
- os: "windows-latest"
Expand All @@ -38,7 +42,7 @@ jobs:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: environment.yml
#environment-file: environment.yml
activate-environment: pygeogrids
auto-activate-base: false
- name: Print environment infos
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ install_requires =
netCDF4
pyproj
pykdtree
scipy
# The usage of test_requires is discouraged, see `Dependency Management` docs
tests_require = pytest; pytest-cov
# Require a specific Python version, e.g. Python 2.7 or >= 3.4
Expand Down
6 changes: 4 additions & 2 deletions tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ def test_nearest_neighbor_max_dist(self):
assert lat == 18.5

# test with maxdist lower than nearest point
gpi, dist = self.grid.find_nearest_gpi(14.3, 18.5, max_dist=10000)
with pytest.warns(UserWarning):
gpi, dist = self.grid.find_nearest_gpi(14.3, 18.5, max_dist=10000)
assert gpi == np.iinfo(np.int32).max
assert dist == np.inf

# test with custom gpi, see issue #68
grid = grids.BasicGrid(lon=[16,17], lat=[45,46], gpis=[100,200])
gpi, dist = grid.find_nearest_gpi(0,0, max_dist=1000)
with pytest.warns(UserWarning):
gpi, dist = grid.find_nearest_gpi(0,0, max_dist=1000)
assert gpi == np.iinfo(np.int32).max
assert dist == np.inf

Expand Down

0 comments on commit 322f0da

Please sign in to comment.