Closed mattkwiecien closed 1 year ago
Note for myself
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Summary
Our tests don't consistently pass, which can be misleading for new contributors who find their new PR may lead to a failed build.
This was caused by 2 main issues, not completely tearing down the tests (e.g. cleanup) and a runtime error thrown by NaMaster that bubbles up the stack into our code.
With these changes I verified all tests pass (individually or all together) and all temporary files get cleaned up
NaMaster issue
write_to
on namaster workspace, covariances and this writes to a file. This can randomly throw a runtime exception "Unable to write to file"pytest-retry
which allows us to re-run tests that fail, I allow the tests affected by this bug to re-try 5 times. If we succeed once, we know it was the NaMaster issue and we pass the test.Test changes
setup_module()
andteardown_module()
. These run once at the beginning of each test file. This allows us to have more controlled reading/writing of files without constantly needing to check if files exist or deleting files that should still exist.tests/tmp/
directory. Before they were writing to separate directories.tmp/
subdirectory. This works but because of the code structure we would need 1 configuration file per test.Code Changes
clobber
argument toget_covariance_block
to allow a user to recalculate the covariance if they want to. Currently the only way to do that is manual or re-instantiate the class. This simplifies the test as well as giving more functionality to the user.Build changes
--no-bin
(see comments), this was causing mpich tests to fail. I updated the build script to use the new option--no-cache-dir