Skip to content

Commit 17c0278

Browse files
committed
Convert to using np.strings
1 parent 5baaefc commit 17c0278

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

named_arrays/_scalars/scalar_array_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,8 @@ def diff(
946946
)
947947

948948

949-
@implements(np.char.mod)
950-
def char_mod(
949+
@implements(np.strings.mod)
950+
def strings_mod(
951951
a: str | na.AbstractScalarArray,
952952
values: str | na.AbstractScalarArray,
953953
) -> na.ScalarArray:
@@ -960,7 +960,7 @@ def char_mod(
960960

961961
shape = na.shape_broadcasted(a, values)
962962

963-
result_ndarray = np.char.mod(
963+
result_ndarray = np.strings.mod(
964964
a=a.ndarray_aligned(shape),
965965
values=values.ndarray_aligned(shape),
966966
)

named_arrays/_scalars/scalars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def to_string_array(
325325
if unit is not None:
326326
a = f"{a}{pad_unit}{unit:{format_unit}}"
327327

328-
return np.char.mod(
328+
return np.strings.mod(
329329
a=a,
330330
values=self.value,
331331
)

named_arrays/tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,8 @@ def test_diff_1st_order(
11281128
"%.2f",
11291129
]
11301130
)
1131-
def test_char_mod(self, array: na.AbstractArray, a: na.AbstractArray):
1132-
result = np.char.mod(a, array)
1131+
def test_strings_mod(self, array: na.AbstractArray, a: na.AbstractArray):
1132+
result = np.strings.mod(a, array)
11331133
assert isinstance(result, na.AbstractArray)
11341134

11351135
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)