Skip to content

Commit 8e173c9

Browse files
authored
temporarily remove placeholder functions (#29)
* remove to_base_units, plus_minus and to_system * remove placeholder tests and test groups
1 parent 8e20683 commit 8e173c9

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

pint_xarray/accessors.py

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
import pint
55
from pint.quantity import Quantity
66
from pint.unit import Unit
7-
from xarray import (
8-
DataArray,
9-
Dataset,
10-
register_dataarray_accessor,
11-
register_dataset_accessor,
12-
)
7+
from xarray import DataArray, register_dataarray_accessor, register_dataset_accessor
138
from xarray.core.npcompat import IS_NEP18_ACTIVE
149

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

376371
return conversion.convert_units(self.da, units)
377372

378-
def to_base_units(self):
379-
quantity = self.da.data.to_base_units()
380-
return DataArray(
381-
dim=self.da.dims,
382-
data=quantity,
383-
coords=self.da.coords,
384-
attrs=self.da.attrs,
385-
encoding=self.da.encoding,
386-
)
387-
388-
# TODO integrate with the uncertainties package here...?
389-
def plus_minus(self, value, error, relative=False):
390-
quantity = self.da.data.plus_minus(value, error, relative)
391-
return DataArray(
392-
dim=self.da.dims,
393-
data=quantity,
394-
coords=self.da.coords,
395-
attrs=self.da.attrs,
396-
encoding=self.da.encoding,
397-
)
398-
399373
def sel(
400374
self, indexers=None, method=None, tolerance=None, drop=False, **indexers_kwargs
401375
):
@@ -630,14 +604,6 @@ def to(self, units=None, **unit_kwargs):
630604

631605
return conversion.convert_units(self.ds, units)
632606

633-
def to_base_units(self):
634-
base_vars = {name: da.pint.to_base_units() for name, da in self.ds.items()}
635-
return Dataset(base_vars, coords=self.ds.coords, attrs=self.ds.attrs)
636-
637-
# TODO unsure if the upstream capability exists in pint for this yet.
638-
def to_system(self, system):
639-
raise NotImplementedError
640-
641607
def sel(
642608
self, indexers=None, method=None, tolerance=None, drop=False, **indexers_kwargs
643609
):

pint_xarray/tests/test_accessors.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,6 @@ def example_quantity_ds():
147147
return ds
148148

149149

150-
@pytest.mark.skip(reason="Not yet implemented")
151-
class TestPropertiesDataArray:
152-
def test_units(self):
153-
...
154-
155-
156-
@pytest.mark.skip(reason="Not yet implemented")
157-
class TestConversionDataArray:
158-
def test_units(self):
159-
...
160-
161-
162-
@pytest.mark.skip(reason="Not yet implemented")
163-
class TestUncertainties:
164-
def test_units(self):
165-
...
166-
167-
168150
class TestQuantifyDataSet:
169151
def test_attach_units_from_str(self, example_unitless_ds):
170152
orig = example_unitless_ds
@@ -242,8 +224,3 @@ def test_roundtrip_data(self, example_unitless_ds):
242224

243225
result = quantified.pint.dequantify().pint.quantify()
244226
assert_equal(quantified, result)
245-
246-
247-
@pytest.mark.skip(reason="Not yet implemented")
248-
class TestIndexing:
249-
...

0 commit comments

Comments
 (0)