Skip to content
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

Fix missing dependecy definition of 'packaging' #6207

Merged
merged 12 commits into from
Jan 31, 2022
1 change: 1 addition & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
- netcdf4
- numba
- numpy
- packaging
- pandas
- pint
- pip
Expand Down
1 change: 1 addition & 0 deletions ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ python -m pip install \
git+https://github.com/zarr-developers/zarr \
git+https://github.com/Unidata/cftime \
git+https://github.com/mapbox/rasterio \
git+https://github.com/pypa/packaging \
jhamman marked this conversation as resolved.
Show resolved Hide resolved
git+https://github.com/hgrecco/pint \
git+https://github.com/pydata/sparse \
git+https://github.com/intake/filesystem_spec \
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies:
- netcdf4>=1.5
- numba
- numpy>=1.17
- packaging>=20.0
- pandas>=1.0
- pooch
- pip
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies:
- netcdf4
- numba
- numpy
- packaging
- pandas
- pint
- pip
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- numba
- numexpr
- numpy
- packaging
- pandas
- pint
- pip
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/py38-bare-minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ dependencies:
- pytest-env
- pytest-xdist
- numpy=1.18
- packaging=20.0
- pandas=1.1
1 change: 1 addition & 0 deletions ci/requirements/py38-min-all-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
- netcdf4=1.5.3
- numba=0.51
- numpy=1.18
- packaging=20.0
- pandas=1.1
- pint=0.16
- pip
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/py39-all-but-dask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
- netcdf4
- numba
- numpy
- packaging
- pandas
- pint
- pip
Expand Down
4 changes: 2 additions & 2 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ Some other important things to know about the docs:
.. ipython:: python

x = 2
x ** 3
x**3
jhamman marked this conversation as resolved.
Show resolved Hide resolved

will be rendered as::

In [1]: x = 2

In [2]: x ** 3
In [2]: x**3
jhamman marked this conversation as resolved.
Show resolved Hide resolved
Out[2]: 8

Almost all code examples in the docs are run (and the output saved) during the
Expand Down
1 change: 1 addition & 0 deletions doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Required dependencies

- Python (3.8 or later)
- `numpy <https://www.numpy.org/>`__ (1.18 or later)
- `packaging <https://packaging.pypa.io/en/latest/#>`__ (20.0 or later)
- `pandas <https://pandas.pydata.org/>`__ (1.1 or later)

.. _optional-dependencies:
Expand Down
7 changes: 4 additions & 3 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Deprecations

Bug fixes
~~~~~~~~~

- Add `packaging` as a dependency to Xarray (:issue:`6216`, :pull:`6207`).
By `Joseph Nowak <https://github.com/josephnowak>`_ and `Joe Hamman <https://github.com/jhamman>`_.
jhamman marked this conversation as resolved.
Show resolved Hide resolved

Documentation
~~~~~~~~~~~~~
Expand Down Expand Up @@ -5101,7 +5102,7 @@ Enhancements
.. ipython:: python

ds = xray.Dataset(coords={"x": range(100), "y": range(100)})
ds["distance"] = np.sqrt(ds.x ** 2 + ds.y ** 2)
ds["distance"] = np.sqrt(ds.x**2 + ds.y**2)

@savefig where_example.png width=4in height=4in
ds.distance.where(ds.distance < 100).plot()
Expand Down Expand Up @@ -5309,7 +5310,7 @@ Enhancements
.. ipython:: python

ds = xray.Dataset({"y": ("x", [1, 2, 3])})
ds.assign(z=lambda ds: ds.y ** 2)
ds.assign(z=lambda ds: ds.y**2)
ds.assign_coords(z=("x", ["a", "b", "c"]))

These methods return a new Dataset (or DataArray) with updated data or
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ python_requires = >=3.8
install_requires =
numpy >= 1.18
pandas >= 1.1
packaging
packaging >= 20.0

[options.extras_require]
io =
Expand Down
2 changes: 1 addition & 1 deletion xarray/core/computation.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ def apply_ufunc(
Calculate the vector magnitude of two arguments:

>>> def magnitude(a, b):
... func = lambda x, y: np.sqrt(x ** 2 + y ** 2)
... func = lambda x, y: np.sqrt(x**2 + y**2)
... return xr.apply_ufunc(func, a, b)
...

Expand Down