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

Potential testing bug #129

Open
rossbar opened this issue Dec 16, 2022 · 0 comments
Open

Potential testing bug #129

rossbar opened this issue Dec 16, 2022 · 0 comments

Comments

@rossbar
Copy link
Contributor

rossbar commented Dec 16, 2022

I noticed the following line:

other = np.random.randint(0, 1, size=shape)

which stands out as a potential issue in that the upper bound for randint is exclusive, so this is equivalent (but slower than) np.zeros. I suspect the intent was a random array of 0s and 1s, which would be randint(0, 2, size=shape). In practice I don't think it matters - it looks like others is only used to test the ordering of the inputs, so the contents of the array don't really matter. In which case I think just explicitly changing to np.zeros(shape, dtype=int) makes sense - just wanted to draw attention to it in case there was indeed an intention to have a binary integer array here.

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

No branches or pull requests

1 participant