You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the test_1d_compare_with_numpy and test_2d_compare_with_numpy tests are slightly hacky in how they generate test cases. Here's the code for the 1-d case:
What I'm trying to do is generate two arrays x and w which have the same dtype (either 32-bit or 64-bit floats, big or little endian), have the same 1-d size (sampled between 0 and 200), and have values in the range -1000, 1000. So at the moment I generate a 64-bit array, cast it inside the test, then split it into two. It would be cleaner to be able to directly generate the two arrays directly with the correct dtype, but I can't figure out how to do this.
@Zac-HD - do you have any suggestions how I might be able to achieve this in a cleaner way?
The text was updated successfully, but these errors were encountered:
Maybe an st.composite strategy? That's my usual approach for arguments with dependencies, or just go for st.data() and do it inside the test function. Like:
At the moment, the
test_1d_compare_with_numpy
andtest_2d_compare_with_numpy
tests are slightly hacky in how they generate test cases. Here's the code for the 1-d case:fast-histogram/fast_histogram/tests/test_histogram.py
Lines 17 to 39 in 4dbb898
What I'm trying to do is generate two arrays
x
andw
which have the same dtype (either 32-bit or 64-bit floats, big or little endian), have the same 1-d size (sampled between 0 and 200), and have values in the range -1000, 1000. So at the moment I generate a 64-bit array, cast it inside the test, then split it into two. It would be cleaner to be able to directly generate the two arrays directly with the correct dtype, but I can't figure out how to do this.@Zac-HD - do you have any suggestions how I might be able to achieve this in a cleaner way?
The text was updated successfully, but these errors were encountered: