lnccbrown / HSSM

Development of HSSM package
Other
82 stars 11 forks source link

Refactor test functions with parametrization #554

Closed cpaniaguam closed 3 months ago

cpaniaguam commented 3 months ago

This pull request refactors the test_likelihoods.py file by adding extra parametrization. The test_no_inf_values_a, test_no_inf_values_t, and test_no_inf_values_v functions are combined into a single test_no_inf_values function. The test_bbox function is also refactored to use parametrization.

cpaniaguam commented 3 months ago

@AlexanderFengler It's kind of strange that on my local computer the tests for test_lapse_distribution_cav are not passing.

Any ideas why? Maybe I didn't install things correctly?


=============================================================================================== short test summary info ================================================================================================
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-blackbox] - KeyError: 'rt,response'
====================================================================================== 12 failed, 7 passed, 14 warnings in 31.57s ======================================================================================
AlexanderFengler commented 3 months ago

@AlexanderFengler It's kind of strange that on my local computer the tests for test_lapse_distribution_cav are not passing.

Any ideas why? Maybe I didn't install things correctly?

=============================================================================================== short test summary info ================================================================================================
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.0-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.01-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.05-blackbox] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-analytical] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-approx_differentiable] - KeyError: 'rt,response'
FAILED tests/test_likelihoods.py::test_lapse_distribution_cav[0.5-blackbox] - KeyError: 'rt,response'
====================================================================================== 12 failed, 7 passed, 14 warnings in 31.57s ======================================================================================

@cpaniaguam no idea actually. I will check on my end and report back.

What's process did you follow for install?

AlexanderFengler commented 3 months ago

@cpaniaguam I think the branch was behind main and some bug-fixes happened in the meanwhile. There was a larger refactor that happened, and it created a number (however shallow) bugs. I got errors initially, but all good after merging in newest main.