Skip to content

temporarily remove placeholder functions #29

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 2 commits into from
Aug 31, 2020
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
36 changes: 1 addition & 35 deletions pint_xarray/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
import pint
from pint.quantity import Quantity
from pint.unit import Unit
from xarray import (
DataArray,
Dataset,
register_dataarray_accessor,
register_dataset_accessor,
)
from xarray import DataArray, register_dataarray_accessor, register_dataset_accessor
from xarray.core.npcompat import IS_NEP18_ACTIVE

from . import conversion
Expand Down Expand Up @@ -375,27 +370,6 @@ def to(self, units=None, **unit_kwargs):

return conversion.convert_units(self.da, units)

def to_base_units(self):
quantity = self.da.data.to_base_units()
return DataArray(
dim=self.da.dims,
data=quantity,
coords=self.da.coords,
attrs=self.da.attrs,
encoding=self.da.encoding,
)

# TODO integrate with the uncertainties package here...?
def plus_minus(self, value, error, relative=False):
quantity = self.da.data.plus_minus(value, error, relative)
return DataArray(
dim=self.da.dims,
data=quantity,
coords=self.da.coords,
attrs=self.da.attrs,
encoding=self.da.encoding,
)

def sel(
self, indexers=None, method=None, tolerance=None, drop=False, **indexers_kwargs
):
Expand Down Expand Up @@ -630,14 +604,6 @@ def to(self, units=None, **unit_kwargs):

return conversion.convert_units(self.ds, units)

def to_base_units(self):
base_vars = {name: da.pint.to_base_units() for name, da in self.ds.items()}
return Dataset(base_vars, coords=self.ds.coords, attrs=self.ds.attrs)

# TODO unsure if the upstream capability exists in pint for this yet.
def to_system(self, system):
raise NotImplementedError

def sel(
self, indexers=None, method=None, tolerance=None, drop=False, **indexers_kwargs
):
Expand Down
23 changes: 0 additions & 23 deletions pint_xarray/tests/test_accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,6 @@ def example_quantity_ds():
return ds


@pytest.mark.skip(reason="Not yet implemented")
class TestPropertiesDataArray:
def test_units(self):
...


@pytest.mark.skip(reason="Not yet implemented")
class TestConversionDataArray:
def test_units(self):
...


@pytest.mark.skip(reason="Not yet implemented")
class TestUncertainties:
def test_units(self):
...


class TestQuantifyDataSet:
def test_attach_units_from_str(self, example_unitless_ds):
orig = example_unitless_ds
Expand Down Expand Up @@ -242,8 +224,3 @@ def test_roundtrip_data(self, example_unitless_ds):

result = quantified.pint.dequantify().pint.quantify()
assert_equal(quantified, result)


@pytest.mark.skip(reason="Not yet implemented")
class TestIndexing:
...