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

Pint support for top-level functions #3611

Merged
merged 27 commits into from Mar 9, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
023ce94
get the align tests to pass
keewis Dec 11, 2019
9dba9e3
add pint to the upstream-dev ci job
keewis Dec 11, 2019
ffa9de3
special case for booleans
keewis Dec 12, 2019
9aa0797
silence the pint behaviour change warning
keewis Dec 12, 2019
bb93ea6
preprocess the unit mapping parameter to convert_units
keewis Dec 12, 2019
5ce66cd
use assert_allclose and assert_identical instead
keewis Dec 12, 2019
cad1308
clean up a few tests
keewis Dec 12, 2019
95c3fc1
remove some xfails
keewis Dec 12, 2019
81c16db
use the unit registry's quantity class
keewis Dec 12, 2019
e989406
explain the catch_warnings block
keewis Dec 12, 2019
d2459e6
don't use the function wrapper class if we don't need arguments
keewis Dec 12, 2019
e6bd219
Merge branch 'master' into pint-support
keewis Dec 18, 2019
3d3b481
whats-new.rst
keewis Dec 19, 2019
c6d90dc
Merge branch 'master' into pint-support
keewis Dec 30, 2019
a2f7bca
require the new pint version
keewis Jan 7, 2020
5a21acb
Merge branch 'master' into pint-support
keewis Jan 7, 2020
5e4f962
Merge branch 'master' into pint-support
keewis Jan 9, 2020
bd566a1
Merge branch 'master' into pint-support
keewis Jan 15, 2020
91a7cdb
use functools.partial instead of function
keewis Jan 15, 2020
bfb0bb8
remove the convert_from parameter of array_attach_units
keewis Jan 16, 2020
853d9e3
make sure every top-level function test uses assert_units_equal
keewis Jan 17, 2020
94f4a32
hide the traceback of the unit comparison function
keewis Jan 17, 2020
87ea619
Merge branch 'master' into pint-support
keewis Feb 23, 2020
c568f97
Merge branch 'master' into pint-support
keewis Feb 26, 2020
b692ae7
Merge branch 'master' into pint-support
keewis Feb 28, 2020
3676981
considerably simplify the merge_dataarray test
keewis Mar 7, 2020
2eff81d
simplify the merge_dataset test
keewis Mar 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/azure/install.yml
Expand Up @@ -27,6 +27,7 @@ steps:
git+https://github.com/zarr-developers/zarr \
git+https://github.com/Unidata/cftime \
git+https://github.com/mapbox/rasterio \
git+https://github.com/hgrecco/pint \
keewis marked this conversation as resolved.
Show resolved Hide resolved
git+https://github.com/pydata/bottleneck
condition: eq(variables['UPSTREAM_DEV'], 'true')
displayName: Install upstream dev dependencies
Expand Down
6 changes: 5 additions & 1 deletion xarray/core/variable.py
Expand Up @@ -739,7 +739,11 @@ def _getitem_with_mask(self, key, fill_value=dtypes.NA):

data = as_indexable(self._data)[actual_indexer]
mask = indexing.create_mask(indexer, self.shape, data)
data = duck_array_ops.where(mask, fill_value, data)
if isinstance(mask, bool):
dcherian marked this conversation as resolved.
Show resolved Hide resolved
mask = not mask
else:
mask = ~mask
data = duck_array_ops.where(mask, data, fill_value)
else:
# array cannot be indexed along dimensions of size 0, so just
# build the mask directly instead.
Expand Down