Closed marcobortolami closed 1 year ago
Do you think we should also modify test_io.py? An easy peasy way would be to just change the names tod
and other_tod
to tod1
and tod2
, so the test is slightly more strong and tests also the case that was problematic, fixed with this PR.
I committed my idea of improvement for test_io.py
:) I can revert the changes if you don't like them;)
Two questions:
False
-False
,False
-True
,True
-False
,True
-True
) because the True
-True
case is missing and the last test test_quaternions_in_hdf5
is completely degenerate with test_gzip_compression_in_obs
. Maybe one of the flags was mistakenly put to False
? I propose to modify the last two test names as test_gzip_compression_in_obs_mjd
and test_gzip_compression_in_obs_no_mjd
with obvious setting of the flags.I committed my idea of improvement for test_io.py:) I can revert the changes if you don't like them;)
Please keep it! I like it!
Why we define the two tod field types as float 64 and 32 but then we assert that they are both float 32? The test passes and I'm confused...
Because the function read_list_of_observations
automatically converts every TOD it reads in the dtype specified by the parameter tod_dtype
, and the default is np.float32
.
Here we test the reading of an observation with and without mjd and gzip. However, not all the 4 combinations of the flags are present (
False
-False
,False
-True
,True
-False
,True
-True
) because theTrue
-True
case is missing and the last testtest_quaternions_in_hdf5
is completely degenerate withtest_gzip_compression_in_obs
. Maybe one of the flags was mistakenly put toFalse
? I propose to modify the last two test names astest_gzip_compression_in_obs_mjd
andtest_gzip_compression_in_obs_no_mjd
with obvious setting of the flags.
No, the problem here is that test_quaternions_in_hdf5
was a placeholder for a more complex test I have never had the chance to complete. (There are no quaternions in HDF5 so far…).
I wouldn't bother add the True
-True
case, as the code used to compress the file using GZip does not depend on the fact that MJD dates be used or not. The best thing is to just remove test_quaternions_in_hdf5
altogether.
Thanks for having spotted these issues! From my side, this PR can be merged.
Please keep it! I like it!
Ok:)
Because the function read_list_of_observations automatically converts every TOD it reads in the dtype specified by the parameter tod_dtype, and the default is np.float32.
Oh, right, now I noticed the conversion!
I wouldn't bother add the True-True case
Ok!
The best thing is to just remove test_quaternions_in_hdf5 altogether.
Done!
This PR solves #261.