swagnercarena / paltas

Conduct simulation-based inference on strong gravitational lensing systems.
MIT License
13 stars 12 forks source link

Adding Hdf5 Functionality #47

Closed P-1884 closed 11 months ago

P-1884 commented 1 year ago

@JelleAalbers @swagnercarena As mentioned earlier, here's the code to save the images as compressed hdf5 files rather than numpy. This is added as a kwarg --h5 when running generate.py and train_model.py.

P-1884 commented 1 year ago

Hi Jelle, Thanks for these! I've gone through each one and edited the corresponding sections. I've added a unit test as well - this is very similar to the test_main function in generate_tests.py but for the h5 rather than npy files. I've also added h5py to the requirements list as well.

P-1884 commented 12 months ago

Hi Jelle, Thanks for these! I've fixed what you suggested - the biggest change is I've factored out the metadata checks in the generate_tests file to remove duplication. These checks now pass when I'm running it locally so should (hopefully!) still pass on Github too.

P-1884 commented 11 months ago

Thanks, should be all sorted now! I've also removed the h5py requirement from the text_requirements doc :)

coveralls commented 11 months ago

Coverage Status

coverage: 94.973% (-0.08%) from 95.048% when pulling 3eb4c64c833a6b1cc60a10d310be47c5d6fb2be2 on P-1884:hdf5_new2 into 5d1c8cde9a7e10bc36281a80fb2421df2c719cce on swagnercarena:main.

swagnercarena commented 11 months ago

@P-1884 go ahead and hit merge whenever you want.

P-1884 commented 11 months ago

Thanks Sebastian! I don't think I have write access to paltas yet - could you merge it (or alternatively how can I get write-access?)