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
Tests and doc examples are meant to be reproducible. It does not make sense to use random number generator. I suspect the reason behind such rampant usage was a rush to make fake data in a pinch, not because of true randomness was required. There are two things that need to be addressed:
Reduce the calls to np.random. For example, maybe you can generate it once and store as a test data file, and then just re-use the same data throughout your tests and doctests. Or you can generate it only once in conftest.py or use it as fixture, and then use that same stuff throughout in tests. Or better still, find real data (with reasonable file size) and use that as test data.
When you cannot help it, set a seed. Then refactor the existing calls to use the new numpy random Generator. Stop using the legacy API.
The text was updated successfully, but these errors were encountered:
Tests and doc examples are meant to be reproducible. It does not make sense to use random number generator. I suspect the reason behind such rampant usage was a rush to make fake data in a pinch, not because of true randomness was required. There are two things that need to be addressed:
np.random
. For example, maybe you can generate it once and store as a test data file, and then just re-use the same data throughout your tests and doctests. Or you can generate it only once inconftest.py
or use it as fixture, and then use that same stuff throughout in tests. Or better still, find real data (with reasonable file size) and use that as test data.The text was updated successfully, but these errors were encountered: