Repository navigation
Fixes #2508 and #2519: Fixes uint scalar handling and overhauls mod/fmod for floats - #2520
Merged
Ethan-DeBandi99 merged 2 commits intoJun 29, 2023
Conversation
stress-tess
requested review from
Ethan-DeBandi99,
TheOddCzar789,
bmcdonald3 and
jaketrookman
June 21, 2023 23:54
bmcdonald3
approved these changes
Jun 22, 2023
added 2 commits
June 23, 2023 13:19
This PR (fixes Bears-R-Us#2508) resolves two bugs with our handling of uint scalars. - dtype mismatch: - `int arr +/- uint scalar` and vice versa resulted in an int array. It should be a real array to match numpy - value mismatch: - `large reals scalars (i.e. > 2 ** 63) % real arrays` were giving incorrect values. Since we cast `uint` scalars before doing operations with real arrays, this issue popped - Attempted to resolve by switching to `fmod`, see chapel-lang/chapel#22584 Picking more representative examples for uint scalars and uint arrays in `testAllOperators` revealed this incorrect handling.
Adds `mod` and `fmod` functions to arkouda which match the numpy equivalents. Fixes value mismatch for float mods
stress-tess
force-pushed
the
2508_incorrect_uint_scalars
branch
from
June 23, 2023 21:14
39405b8 to
ae92d29
Compare
uint scalar handlinguint scalar handling and overhauls mod/fmod for floats
Ethan-DeBandi99
left a comment
Contributor
There was a problem hiding this comment.
Just one question to clarify. Otherwise, everything looks good.
jaketrookman
approved these changes
Jun 26, 2023
jaketrookman
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Great work
Ethan-DeBandi99
approved these changes
Jun 29, 2023
Ethan-DeBandi99
left a comment
Contributor
There was a problem hiding this comment.
Looks good. The one component that we will be researching further has been captured in an to look into.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR (fixes #2508 and closes #2519)
modand addsfmoddivmodtestThe two bugs involving uint scalars are:
int arr +/- uint scalarand vice versa resulted in an int array. It should be a real array to match numpylarge real scalars (i.e. > 2 ** 63) % real arrayswere giving incorrect values. Since we castuintscalars before doing operations with real arrays, this issue popped upfmod. For more info see:modandfmodon real arrays with large real scalars chapel-lang/chapel#22584modfunctionality #2519Picking more representative examples for uint scalars and uint arrays in
testAllOperatorsrevealed this incorrect handling.i.e.
run_testson master before updating the test:run_testson master after updating the test:run_testson this PR after updating the tests:The biggest difference between the results from master before updating the tests and this PR after updating the tests is
ops implemented by numpy but not arkouda. We see that this number has increased by 10. I hunted down the ones that it appeared like we supported before. They're all combinations of ops betweenuint scalarandint array. For all these operations theuint arrayandint arrayversion is also not supported. So I think if we decide to add this support to arkouda we should do it a future issue and add thevector-vector,vector-scalar, andscalar-vector