Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ refactoring: ak.run_lengths #1347

Merged
merged 2 commits into from
Mar 8, 2022
Merged

C++ refactoring: ak.run_lengths #1347

merged 2 commits into from
Mar 8, 2022

Conversation

ioanaif
Copy link
Collaborator

@ioanaif ioanaif commented Mar 8, 2022

No description provided.

@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #1347 (23a3ef4) into main (b2fd2be) will increase coverage by 0.42%.
The diff coverage is 52.72%.

Impacted Files Coverage Δ
src/awkward/_v2/_connect/cling.py 0.00% <0.00%> (ø)
src/awkward/_v2/_connect/pyarrow.py 85.74% <0.00%> (ø)
src/awkward/_v2/_lookup.py 97.50% <0.00%> (ø)
src/awkward/_v2/_prettyprint.py 66.09% <0.00%> (+2.29%) ⬆️
src/awkward/_v2/_typetracer.py 69.14% <0.00%> (ø)
src/awkward/_v2/forms/bitmaskedform.py 78.04% <0.00%> (ø)
src/awkward/_v2/forms/bytemaskedform.py 77.33% <0.00%> (ø)
src/awkward/_v2/forms/emptyform.py 79.62% <0.00%> (-0.38%) ⬇️
src/awkward/_v2/forms/form.py 90.06% <0.00%> (ø)
src/awkward/_v2/forms/indexedform.py 80.00% <0.00%> (ø)
... and 135 more

@ioanaif ioanaif requested a review from jpivarski March 8, 2022 15:26
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks good. I see that you've enabled a string behavior (vectorized equality). That should allow tests like

assert ak.all(ak.Array(["one", "two", "three"]) == ak.Array(["one", "two", "three"]))
assert ak.any(ak.Array(["one", "two", "three"]) != ak.Array(["one", "two", "3"]))
assert not ak.all(ak.Array(["one", "two", "three"]) != ak.Array(["one", "two", "3"]))

(Without the equality behavior, it would try to compare "t" with "3" and complain about the different number of characters; with the behavior, it would compare "three" with "3" as whole units.)

The run_lengths implementation also looks good.

Comment on lines 254 to +257
# behavior[ak.nplike.numpy.equal, "bytestring", "bytestring"] = _string_equal
# behavior[ak.nplike.numpy.equal, "string", "string"] = _string_equal
# behavior[ak.nplike.numpy.not_equal, "bytestring", "bytestring"] = _string_notequal
# behavior[ak.nplike.numpy.not_equal, "string", "string"] = _string_notequal
behavior[ak.nplike.numpy.not_equal, "string", "string"] = _string_notequal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With _string_equal implemented, it should be possible to enable all four of these. I guess only one was needed for the test. (Enabling these string and categorical behaviors is one of the cards.)

@jpivarski jpivarski merged commit 2e8ce81 into main Mar 8, 2022
@jpivarski jpivarski deleted the ioanaif/run_lengths branch March 8, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants