Closed teutoburg closed 1 year ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
0d1eece
) 99.02% compared to head (5c565da
) 99.02%. Report is 2 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Easiest way to update the files in skycalc_ipy/data
is to simply remove them, run pytest
and then commit the two changed files back
Running pytest doesn't download them to that data dir, but to the location where the pip installed package is located. And it's 16 files rather than two. I deleted the old ones anyway, apparently they weren't used by the tests anyway?
Perhaps that entire directory can be dropped though, because we can use ScopeSim_data for that.
I want to change the cache location (and download handling generally) to something better, but that'll be in another PR, to keep it simple and separate 🙂
Running pytest doesn't download them to that data dir, but to the location where the pip installed package is located.
Yeah, it downloads the files to that directory if you install skycalc_ipy with pip install -e .
; that was the idea behind it. Downloading to the site-packages directory is a bad thing.
And it's 16 files rather than two. I deleted the old ones anyway, apparently they weren't used by the tests anyway?
I left those two files in when I moved the rest to ScopeSim_data. I think my reasoning was that ScopeSim_data is not yet ready to be used by end-users, and having this directory there allowed people to still make use of the caching functionality. Those two files were just an example. But it is better to delete them.
I want to change the cache location (and download handling generally) to something better, but that'll be in another PR, to keep it simple and separate 🙂
It is already possible to specify the download directory. ScopeSim_data does that.
Using this directory as default made (some) sense when the idea was still to include the data in the package. But that is now moved to ScopeSim_data.
Let's merge this and do the rest later.
Apparently, ESO changed the wavelength unit from µm to nm in the switch to the new server, but also now include that information in the header. This PR should fix that generally, by using the units from the header instead of hardcoding µm, but retain it as a fallback if no unit information is found.
Also, the unit for the flux is not very well converted by
astropy.table.Table
, although creating it directly from the header (i.e.u.Unit(skm.data[1].header["TUNIT2"])
) seems to work fine. I added a simple check to at least see if there's nothing unexpected in the flux unit before overwriting it...