From 8e173c938f2ab4852aa4e6e0bad016885d954975 Mon Sep 17 00:00:00 2001 From: keewis Date: Tue, 1 Sep 2020 00:02:24 +0200 Subject: [PATCH] temporarily remove placeholder functions (#29) * remove to_base_units, plus_minus and to_system * remove placeholder tests and test groups --- pint_xarray/accessors.py | 36 +---------------------------- pint_xarray/tests/test_accessors.py | 23 ------------------ 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/pint_xarray/accessors.py b/pint_xarray/accessors.py index 83ae16b7..303aae14 100644 --- a/pint_xarray/accessors.py +++ b/pint_xarray/accessors.py @@ -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 @@ -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 ): @@ -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 ): diff --git a/pint_xarray/tests/test_accessors.py b/pint_xarray/tests/test_accessors.py index 648059fe..8867af8a 100644 --- a/pint_xarray/tests/test_accessors.py +++ b/pint_xarray/tests/test_accessors.py @@ -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 @@ -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: - ...