Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 0 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
numpy
pandas
xarray
netCDF4
packaging
geopandas
pyarrow-core
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
numpy
pandas
xarray
netCDF4
packaging
python-build

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ jobs:
numpy
pandas
xarray
netCDF4
packaging
contextily
geopandas
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_doctests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
numpy
pandas
xarray
netCDF4
packaging
contextily
geopandas
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ jobs:
numpy-version: '1.26'
pandas-version: '=2.1'
xarray-version: '=2023.07'
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray sphinx-gallery'
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray netCDF4 sphinx-gallery'
# Python 3.13 + core packages (latest versions) + optional packages
- python-version: '3.13'
numpy-version: '2.2'
pandas-version: ''
xarray-version: ''
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray sphinx-gallery'
optional-packages: ' contextily geopandas ipython pyarrow-core rioxarray netCDF4 sphinx-gallery'
# Python 3.12 + core packages (Linux only)
- os: 'ubuntu-latest'
python-version: '3.12'
Expand Down Expand Up @@ -129,7 +129,6 @@ jobs:
numpy=${{ matrix.numpy-version }}
pandas${{ matrix.pandas-version }}
xarray${{ matrix.xarray-version }}
netCDF4
packaging
make
pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ jobs:
run: |
python -m pip install --pre --prefer-binary \
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
numpy pandas xarray netCDF4 packaging \
build contextily dvc geopandas ipython pyarrow rioxarray \
numpy pandas xarray packaging \
build contextily dvc geopandas ipython pyarrow rioxarray netCDF4 \
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures \
sphinx-gallery

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_tests_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
numpy=1.26
pandas
xarray
netCDF4
packaging
contextily=1.5
geopandas=1.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/type_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# 3. type checker and stub packages
# 4. other packages that are used somewhere in PyGMT
python -m pip install \
numpy pandas xarray netcdf4 packaging \
numpy pandas xarray packaging \
contextily geopandas ipython pyarrow rioxarray \
mypy pandas-stubs pyarrow-stubs \
matplotlib pytest
Expand Down
1 change: 0 additions & 1 deletion ci/requirements/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- numpy
- pandas
- xarray
- netCDF4
- packaging
# Optional dependencies
- contextily
Expand Down
5 changes: 2 additions & 3 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ PyGMT requires the following packages to be installed:
- [NumPy](https://numpy.org)
- [pandas](https://pandas.pydata.org)
- [Xarray](https://xarray.dev/)
- [netCDF4](https://unidata.github.io/netcdf4-python)
- [packaging](https://packaging.pypa.io)

:::{note}
Expand Down Expand Up @@ -128,14 +127,14 @@ installed (we'll call it `pygmt` but feel free to change it to whatever you want
::: {tab-item} mamba
:sync: mamba
```
mamba create --name pygmt python=3.13 numpy pandas xarray netcdf4 packaging gmt
mamba create --name pygmt python=3.13 numpy pandas xarray packaging gmt
```
:::

::: {tab-item} conda
:sync: conda
```
conda create --name pygmt python=3.13 numpy pandas xarray netcdf4 packaging gmt
conda create --name pygmt python=3.13 numpy pandas xarray packaging gmt
```
:::
::::
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- numpy>=1.26
- pandas>=2.1
- xarray>=2023.07
- netCDF4
- packaging
# Optional dependencies
- contextily>=1.5
Expand All @@ -34,6 +33,8 @@ dependencies:
- pytest-cov
- pytest-doctestplus
- pytest-mpl
# Dev dependencies (testing)
- netCDF4
# Dev dependencies (building documentation)
- geodatasets
- myst-nb
Expand Down
2 changes: 2 additions & 0 deletions pygmt/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from pygmt.helpers import GMTTempFile
from pygmt.io import load_dataarray

pytest.importorskip("netCDF4")


# TODO(PyGMT>=0.20.0): Remove test_io_load_dataarray
def test_io_load_dataarray():
Expand Down
6 changes: 5 additions & 1 deletion pygmt/tests/test_xarray_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test the behaviour of the GMTDataArrayAccessor class.
"""

import importlib
import sys
from pathlib import Path

Expand All @@ -14,6 +15,8 @@
from pygmt.enums import GridRegistration, GridType
from pygmt.exceptions import GMTInvalidInput

_HAS_NETCDF4 = bool(importlib.util.find_spec("netCDF4"))


def test_xarray_accessor_gridline_cartesian():
"""
Expand Down Expand Up @@ -102,6 +105,7 @@ def test_xarray_accessor_set_invalid_registration_and_gtype():


# TODO(GMT>=6.5.0): Remove the xfail marker for GMT>=6.5.0.
@pytest.mark.skipif(condition=not _HAS_NETCDF4, reason="netCDF4 is not installed")
@pytest.mark.xfail(
condition=sys.platform == "win32" and Version(__gmt_version__) < Version("6.5.0"),
reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/7573",
Expand All @@ -119,7 +123,7 @@ def test_xarray_accessor_sliced_datacube():
"https://github.com/pydata/xarray-data/raw/master/eraint_uvz.nc",
download="u",
)
with xr.open_dataset(fname) as dataset:
with xr.open_dataset(fname, engine="netcdf4") as dataset:
grid = dataset.sel(level=500, month=1, drop=True).z

assert grid.gmt.registration == GridRegistration.GRIDLINE
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ dependencies = [
"numpy>=1.26",
"pandas>=2.1",
"xarray>=2023.07",
"netCDF4",
"packaging",
]
dynamic = ["version"]
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
numpy>=1.26
pandas>=2.1
xarray>=2023.07
netCDF4
packaging
Loading