spacetelescope / ullyses

Code to create products for the ULLYSES program
https://ullyses.stsci.edu/
BSD 3-Clause "New" or "Revised" License
2 stars 6 forks source link

Fix pytests #59

Closed stscirij closed 1 year ago

stscirij commented 1 year ago

@stscirij can you remind me how to run the tests locally?

If you go to the tests directory, you can either do pytest to run all the tests under pytest. This is sometimes awkward to interpret as the stdout isn't printed. Alternatively, to run each test individually, you can do, from the tests directory ipython import test_wrapper a = test_wrapper.TestWrapper() a.test_av321() a.test_av456() a.test_hd104237e() a.test_v_hk_ori() Make sure you have installed pandas 2.0 or later in your local environment

tapastro commented 1 year ago

@stscirij can you remind me how to run the tests locally?

If you go to the tests directory, you can either do pytest to run all the tests under pytest. This is sometimes awkward to interpret as the stdout isn't printed.

You can try pytest -s or pytest --capture=no to see stdout, if that helps.

jotaylor commented 1 year ago

@stscirij After some trail & error, I fixed all of the issues in the tests that I could. However, with some recent alias updates the names of the AV targets are now out of date. av321 is now av-321 and av456 is av-456. Can you update the following:

  1. names of targets in test_wrapper.py
  2. names of target directories in Box folders
  3. names of HLSPs in Box folders I think with these changes things should start working!
stscirij commented 1 year ago

@stscirij After some trail & error, I fixed all of the issues in the tests that I could. However, with some recent alias updates the names of the AV targets are now out of date. av321 is now av-321 and av456 is av-456. Can you update the following:

  1. names of targets in test_wrapper.py
  2. names of target directories in Box folders
  3. names of HLSPs in Box folders I think with these changes things should start working!

@jotaylor Code is still trying to read non-existent ullyses-utils file pd_targetinfo.json in get_coords(). Maybe tag ullyses-utils with all the new aliases files as version 2 so that ullyses can be in sync?

jotaylor commented 1 year ago

@jotaylor Code is still trying to read non-existent ullyses-utils file pd_targetinfo.json in get_coords(). Maybe tag ullyses-utils with all the new aliases files as version 2 so that ullyses can be in sync?

Oops, that file was not meant to be deleted 😅 I added it back into utils, so if you do a fresh install it should good.

jotaylor commented 1 year ago

Okay, I think things are looking as they should now for the most part. The tests are failing because the products are different than those we delivered in DR6, but that's expected. I also changed the format of the RA/Dec to float instead of string.

However, before we can merge, there is a typo in the python 3.10 run. It's trying to install python 3.1 and failing. @stscirij can you change it to 3.10? I'm not sure if that's done somewhere in the actual code, or in the git settings in the browser.

jotaylor commented 1 year ago

Green check marks?! Haven't seen those in a while. I think we are good to merge! 🥳