HEPData / hepdata_lib

Library for getting your data into HEPData
https://hepdata-lib.readthedocs.io
MIT License
15 stars 39 forks source link

Validation of output tarballs #189

Closed AndreasAlbert closed 2 years ago

AndreasAlbert commented 2 years ago

With this PR, Submission.create_files now automatically calls the hepdata validator on the output file. An AssertionError is thrown if the tar ball is found to be invalid.

Closes #160

AndreasAlbert commented 2 years ago

I also added a new remove_old option to create_files. If set to True, the output directory is deleted before the new files are written. This ensures that no unrelated files accidentally end up in the tar ball, which the validator would identify as an error. Since many of our notebooks use the same output directory naming, consecutive execution of the notebooks -- as done in our tests -- can provoke this error if the folder is not removed between executions.

clelange commented 2 years ago

I forgot, shall we remove Python2 support with this PR? That would mean removing it from https://github.com/HEPData/hepdata_lib/blob/master/setup.py#L30

AndreasAlbert commented 2 years ago

Removed python2 from setup.py now