pint-xarray icon indicating copy to clipboard operation
pint-xarray copied to clipboard

Interface for using pint with xarray, providing convenience accessors

Results 29 pint-xarray issues
Sort by recently updated
recently updated
newest added

Our release policy very much follows that of `xarray`: deprecations will stay in a few releases, after which they will be applied (for example, removing old features or changing defaults)....

WIP attempt to add an `@expects` decorator to the API, which emulates `pint.UnitRegistry().wraps`. - [x] Closes #141 - [x] Tests added - [x] Passes `pre-commit run --all-files` - [x] User...

enhancement

At the moment, this is an alias of `.pint.dequantify()`, but it could just as well be something similar to: ``` python dequantified = da.pint.dequantify() dequantified.attrs.pop("units", None) magnitude = dequantified.pint.quantify() ```...

As mentioned in #162, it is possible to get the indexing functions to work, although there still is no public API. I also still don't quite understand how other methods...

run-upstream

Intended to eventually close #1

indexing

Currently `DataArray.pint.magnitude` returns a numpy array. Can it return a DataArray instead? We can always extract the numpy array using `DataArray.data.magnitude`. Just realized I can also use `DataArray.as_numpy()` but perhaps...

If you try to convert a `pint.Quantity` to an incompatible unit you get a `pint.DimensionalityError`, whereas if you try to convert a quantified `DataArray` to an incompatible unit you get...

```python import xarray as xr import cf_xarray.units import pint_xarray from pint_xarray import unit_registry as ureg xr.set_options(display_expand_data=False) ds = xr.tutorial.open_dataset("air_temperature") data = ds.air quantified = data.pint.quantify() expected = ds.air.where(ds.air.max()) quantified.where(quantified.max()) ```...

Towards #1 With the index refactor coming along nicely, we should start looking into what might be needed to implement a `PintMetaIndex` to get the missing indexing functionality (`sel`/`drop_sel`/`reindex`/...) to...

#143 should ideally add functionality for relations between units of input arguments, [in the same way that `pint.ureg.wraps` does](https://pint.readthedocs.io/en/stable/wrapping.html#specifying-relations-between-arguments). This seems quite complicated though, so I think we should leave...

enhancement