Skip to content

Commit 6dd371b

Browse files
committed
chore: add note about _to_regular_primitive
1 parent 7df3645 commit 6dd371b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/awkward/_meta/numpymeta.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,19 @@ def _mergeable_next(self, other: Meta, mergebool: bool) -> bool:
7878
return False
7979
# Simplify *this* branch to be 1D self
8080
elif len(self.inner_shape) > 0:
81-
return self._to_regular_primitive()._mergeable_next(
82-
other, mergebool
83-
) # TODO
81+
# TODO: `_to_regular_primitive` is a mechanism for re-using our merge
82+
# logic that already handles `RegularArray`. Rather than
83+
# converting the NumpyArray into a contiguous `RegularArray`,
84+
# we return something with arbitrary data (e.g. a broadcasted empty array!)
85+
# N.B. NumpyForm doesn't need to do this, only NumpyArray.
86+
return self._to_regular_primitive()._mergeable_next(other, mergebool)
8487

8588
elif is_numpy(other):
8689
if len(self.inner_shape) != len(other.inner_shape):
8790
return False
8891

8992
# Obvious fast-path
90-
if self.dtype == other.dtype: # TODO
93+
if self.dtype == other.dtype:
9194
return True
9295

9396
# Special-case booleans i.e. {bool, number}

0 commit comments

Comments
 (0)