FIX: Align random.draw size dispatch for numpy integers - #919
Open
kocaemre wants to merge 1 commit into
Open
Conversation
Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
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.
Closes #918.
Summary
np.int64(10)) the same as Pythonintin the pure-Pythonrandom.drawpath.sizevalues on the scalar branch so Python and jitted dispatch agree.@njitcallers for both cases.Test plan
pytest quantecon/random/tests/test_utilities.py::TestDraw::test_numpy_integer_size_returns_array quantecon/random/tests/test_utilities.py::TestDraw::test_bool_size_is_treated_as_scalar -qfailed with the Python path returning a scalar fornp.int64(10)and raisingTypeErrorforTrue.2 passed in 6.43s.pytest quantecon/random/tests/test_utilities.py -q—11 passed in 4.45s.pytest quantecon/random -q—11 passed in 4.54s.pytest quantecon -q—602 passed, 2 warnings in 504.77s.flake8 --select=F401,F405,E231 quantecon.git diff --check.