Skip to content

Commit

Permalink
get argsort wokring
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage committed Dec 28, 2024
1 parent 3189633 commit 8aa9190
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pint_pandas/pint_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):

def _convert_np_result(self, result):
if isinstance(result, _Quantity) and is_list_like(result.m):
if hasattr(result, "ndim") and result.ndim >= 2:
raise ValueError("PintArrays may only be 1D, check axis arguement")
return PintArray.from_1darray_quantity(result)
elif isinstance(result, _Quantity):
return result
Expand All @@ -361,6 +363,8 @@ def _convert_np_result(self, result):
isinstance(item, _Quantity) for item in result
):
return PintArray._from_sequence(result)
elif isinstance(result, np.ndarray):
return result
elif result is None:
# no return value
return result
Expand Down
8 changes: 8 additions & 0 deletions pint_pandas/testsuite/test_pandas_extensiontests.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,3 +603,11 @@ def test_EA_types(self, engine, data, request):
@pytest.mark.skip("TODO: fix this test")
def test_array_interface_copy(self, data):
pass

@pytest.mark.skip(reason="not implemented in pint")
def test_repeat(self):
pass

@pytest.mark.skip(reason="not implemented in pint")
def test_repeat_raises(self):
pass

0 comments on commit 8aa9190

Please sign in to comment.