Skip to content

Commit

Permalink
chore: add note about _to_regular_primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Nov 29, 2023
1 parent 7df3645 commit 6dd371b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/awkward/_meta/numpymeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@ def _mergeable_next(self, other: Meta, mergebool: bool) -> bool:
return False
# Simplify *this* branch to be 1D self
elif len(self.inner_shape) > 0:
return self._to_regular_primitive()._mergeable_next(
other, mergebool
) # TODO
# TODO: `_to_regular_primitive` is a mechanism for re-using our merge
# logic that already handles `RegularArray`. Rather than
# converting the NumpyArray into a contiguous `RegularArray`,
# we return something with arbitrary data (e.g. a broadcasted empty array!)
# N.B. NumpyForm doesn't need to do this, only NumpyArray.
return self._to_regular_primitive()._mergeable_next(other, mergebool)

elif is_numpy(other):
if len(self.inner_shape) != len(other.inner_shape):
return False

# Obvious fast-path
if self.dtype == other.dtype: # TODO
if self.dtype == other.dtype:
return True

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

0 comments on commit 6dd371b

Please sign in to comment.