LSSTDESC / RESSPECT

The RESSPECT project is a result from an inter-collaboration agreement established between the Cosmostatistics Initiative (COIN) and the LSST Dark Energy Science Collaboration (DESC) with the goal of developing a recommendation system for telescope resource allocation able to optimize photometric supernova cosmology anaylsis.
MIT License
1 stars 0 forks source link

Audit and review existing testing #4

Closed drewoldag closed 1 month ago

drewoldag commented 1 month ago

All of the unit tests, and the end to end tests are executed using python 3.8. And when running that locally either with pytest ./tests or pipx run tox -e py38 -b the tests run to completion (now that the dependencies have been updated)

However, if we try to run the tests using python 3.11 for instance, this unit tests doesn't pass - test_fish_deriv_m.

When the PPT is applied to the project, all tests will be run against all the supported versions of python, so even though all the tests currently run, it's unlikely that 3.8 will be the only supported python version (since it's end of life date is in Oct 2024)

drewoldag commented 1 month ago

The issue above was related to the version of astropy that was being used. Newer version of python use a newer version of astropy, and the signature of the class being initialized by that test has changed. Specifying the parameter names in the module being tested (the one that instantiates the class instance) fixes the issue.

drewoldag commented 1 month ago

There are two tests that have been marked as skipped that I would like to review:

drewoldag commented 1 month ago

The test test_batch_functions.py:test_entropy_from_probs_b_M_C wasn't being provided a sample input with the correct shape. The function being tested uses numpy, and operates on the second and third axis of the input. But 1d input was being provided. Changing the test input to the correct shape fixes the problem. However, there's no confirmation that the output of the function is correct, and the function itself is so small that it might not be worth testing.