Open smmaurer opened 6 years ago
I wrote a simple context manager that manages the numpy and python random states. Might be applicable here:
https://github.com/AZMAG/smartpy_core/blob/master/smartpy_core/wrangling.py#L12 https://github.com/AZMAG/smartpy_core/blob/master/smartpy_core/tests/test_wrangling.py#L163
Some of our unit tests are probabilistic, so they sometimes fail.
The tests are intended to verify that things like sampling weights are being applied correctly. But since the sampling is random, occasionally the tests don't pass. We should make this more sophisticated :slightly_smiling_face:
Here's an example of a probabilistic test: https://github.com/UDST/choicemodels/blob/master/tests/test_mct.py#L46
And a failure that was resolved simply by re-running the test: https://travis-ci.org/UDST/choicemodels/jobs/427893157