desihub / desisurvey

Code for desi survey planning and implementation
BSD 3-Clause "New" or "Revised" License
2 stars 7 forks source link

remove sys.exit from afternoonplan; fix tests #44

Closed sbailey closed 7 years ago

sbailey commented 7 years ago

This PR removes a spurious sys.exit() in afternoonplan.surveyPlan.assignHA and fixes a degrees vs. hours units bug in test_surveyplan.py.

More details:

There was a spurious sys.exit() at the end of afternoonplan.surveyPlan.assignHA(). Oddly, standard "python setup.py test" tests did not catch this because apparently that causes the tests to exit rather than getting caught as an error. However, surveysim tests using desisurvey did error, correctly noticing this as a SystemExit. I don't know the structural difference.

Either way, removing the sys.exit() allowed all the tests to run, highlighting a different degrees vs. hours bug in test_surveyplan; this time the bug was in the test itself rather than the code.

After merging this we'll be back in a state where surveysim+desisurvey pass tests together on master. Going via a PR to highlight the oddity of the impact of sys.exit() on the tests. If someone wants to look into this after it gets merged, git hash f419509 was the state of master with the problem.

dkirkby commented 7 years ago

These issues are both already fixed in the redux branch, so please hold off merging until I can sort this out.

dkirkby commented 7 years ago

This PR should no longer be necessary after #45.