EUREC4A-UK / lagtraj

Python trajectory code for Lagrangian simulations
MIT License
9 stars 9 forks source link

Add `--pack` to pack all netCDF and yaml files used to produce a forcing/trajectory into a .tar.gz file #163

Open leifdenby opened 2 years ago

leifdenby commented 2 years ago

Just now asking @sjboeing for some forcings he's produced I realised it would be useful to have an argument that could be passed to the commands which produce trajectories and forcings which would save the result into a .tar.gz file, including any intermediate files and the source yaml-files. If we also included the git commit for the copy of lagtraj which produced the forcings this should make creating a forcing complete reproducible, apart from the source-data, including that would be too much. This could also be a handy way of copying trajectories/forcings around.

Suggested contents for running for example

python -m lagtraj.forcings.create lagtraj://eurec4a_20200202_first_short --conversion dephy

Would be all yaml-files (domain, trajectory and forcing), trajectory netCDF file and forcing netCDF file (including intermediate file before converting to dephy format) and reference to the git commit hash. All would stored in the directory layout that we use in lagtraj so that one could simply un-tar the file and run lagtraj afresh.

Thoughts @sjboeing ?

sjboeing commented 2 years ago

Ah I got confused. Do you mean running:

python -m lagtraj.forcings.create lagtraj://eurec4a_20200202_first_short --conversion dephy --pack

?

Sounds good! Did we talk about including the git commit into the individual netcdf files before? Not sure what is the best approach here.

leifdenby commented 2 years ago

Ah I got confused. Do you mean running:

python -m lagtraj.forcings.create lagtraj://eurec4a_20200202_first_short --conversion dephy --pack

Yes! Sorry, that was the key bit! :laughing:

Did we talk about including the git commit into the individual netcdf files before? Not sure what is the best approach here.

Yes, I think we might have done. I'll make another issue for that