21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
56 stars 37 forks source link

Lightcone distance unit fix #392

Closed daviesje closed 1 month ago

daviesje commented 1 month ago

Since the angular lightcone update, the lightcone_distances field has units. However these units are not saved and loaded from the HDF5 Files.

This is a quick fix which adds the units when required. It might be a better long-term idea to properly save the units of all quantities along with the values, however this will take more time, and currently you cannot call lightcone_redshifts on a lightcone loaded from file.

I have also added a lightcone_redshift check to test_lightcone_roundtrip to catch this in future.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.45%. Comparing base (3c5261c) to head (8672727). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #392 +/- ## ========================================== + Coverage 82.44% 82.45% +0.01% ========================================== Files 13 13 Lines 3116 3118 +2 Branches 841 842 +1 ========================================== + Hits 2569 2571 +2 Misses 391 391 Partials 156 156 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.