Skip to content

Use conda-forge netcdftime wherever netcdf4 was tested #1933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ matrix:
env: CONDA_ENV=py36-rasterio1.0alpha
- python: 3.6
env: CONDA_ENV=py36-zarr-dev
- python: 3.6
env: CONDA_ENV=py36-netcdftime-dev
- python: 3.5
env: CONDA_ENV=docs
allow_failures:
Expand Down Expand Up @@ -75,8 +73,6 @@ matrix:
env: CONDA_ENV=py36-rasterio1.0alpha
- python: 3.6
env: CONDA_ENV=py36-zarr-dev
- python: 3.6
env: CONDA_ENV=py36-netcdftime-dev

before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py27-cdat+iris+pynio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- numpy
- pandas
- pathlib2
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py27-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pathlib2
- pytest
- flake8
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-bottleneck-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-condaforge-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-dask-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-netcdf4-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dependencies:
- coveralls
- pytest-cov
- git+https://github.com/Unidata/netcdf4-python.git
- git+https://github.com/Unidata/netcdftime.git
13 changes: 0 additions & 13 deletions ci/requirements-py36-netcdftime-dev.yml

This file was deleted.

1 change: 1 addition & 0 deletions ci/requirements-py36-pandas-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-pynio-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pynio=dev
- pytest
- numpy
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-rasterio1.0alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- numpy
- pandas
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- numpy
- pandas
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36-zarr-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- seaborn
- toolz
- bottleneck
- netcdftime
- pip:
- coveralls
- pytest-cov
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- h5netcdf
- matplotlib
- netcdf4
- netcdftime
- pytest
- flake8
- numpy
Expand Down
5 changes: 3 additions & 2 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ For netCDF and IO
- `pynio <https://www.pyngl.ucar.edu/Nio.shtml>`__: for reading GRIB and other
geoscience specific file formats
- `zarr <http://zarr.readthedocs.io/>`__: for chunked, compressed, N-dimensional arrays.
- `netcdftime <https://github.com/Unidata/netcdftime>`__: recommended if you
want to encode/decode datetimes for non-standard calendars.
- `netcdftime <https://unidata.github.io/netcdftime>`__: recommended if you
want to encode/decode datetimes for non-standard calendars or dates before
year 1678 or after year 2262.

For accelerating xarray
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
11 changes: 11 additions & 0 deletions doc/time-series.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ attribute like ``'days since 2000-01-01'``).

.. _CF conventions: http://cfconventions.org

.. note::

When decoding/encoding datetimes for non-standard calendars or for dates
before year 1678 or after year 2262, xarray uses the `netcdftime`_ library.
``netcdftime`` was previously packaged with the ``netcdf4-python`` package but
is now distributed separately. ``netcdftime`` is an
:ref:`optional dependency<installing>` of xarray.

.. _netcdftime: https://unidata.github.io/netcdftime


You can manual decode arrays in this form by passing a dataset to
:py:func:`~xarray.decode_cf`:

Expand Down
14 changes: 12 additions & 2 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,25 @@ Enhancements
By `Stephan Hoyer <https://github.com/shoyer>`_.
- Fix ``axis`` keyword ignored when applying ``np.squeeze`` to ``DataArray`` (:issue:`1487`).
By `Florian Pinault <https://github.com/floriankrb>`_.
- Add ``netcdftime`` as an optional dependency of xarray. This allows for
- ``netcdf4-python`` has moved the its time handling in the ``netcdftime`` module to
a standalone package (`netcdftime`_). As such, xarray now considers `netcdftime`_
an optional dependency. One benefit of this change is that it allows for
encoding/decoding of datetimes with non-standard calendars without the
netCDF4 dependency (:issue:`1084`).
``netcdf4-python`` dependency (:issue:`1084`).
By `Joe Hamman <https://github.com/jhamman>`_.

.. _Zarr: http://zarr.readthedocs.io/

.. _Iris: http://scitools.org.uk/iris

.. _netcdftime: https://unidata.github.io/netcdftime

**New functions/methods**

- New :py:meth:`~xarray.DataArray.rank` on arrays and datasets. Requires
bottleneck (:issue:`1731`).
By `0x0L <https://github.com/0x0L>`_.

Bug fixes
~~~~~~~~~
- Rolling aggregation with ``center=True`` option now gives the same result
Expand Down