Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YODA writer: Skip ill-defined error components #54

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

20DM
Copy link
Collaborator

@20DM 20DM commented Dec 2, 2023

Hi,

the last column in Table 13 of this entry has a +/- none error component in each cell. This seems to be related to a TypeError coming from the array writer:

ERROR:hepdata_converter.writers.array_writer:TypeError encountered when parsing none
ERROR:hepdata_converter.writers.array_writer:TypeError encountered when parsing none
ERROR:hepdata_converter.writers.array_writer:TypeError encountered when parsing none

... and is currently causing the YODA2 writer to crash for this entry. This change set skips such components in order to work around the issue, but we also might want to add a check for this sort of thing as part of the upload procedure (unless we're doing that already and this is just an artefact of the old-to-new HepData migration? 🤷 ).

Cheers,
Chris

@coveralls
Copy link

Coverage Status

coverage: 91.708% (+0.004%) from 91.704%
when pulling a8bf671 on 20DM:patch_for_none_errors
into 885629e on HEPData:main.

@GraemeWatt
Copy link
Member

Thanks for pointing out this problem and providing a fix. There are sometimes (caught) TypeError exceptions for badly formatted records, but the writers should be able to tolerate these errors. The other formats (csv, root, yaml, yoda1) all still produce an output. Trying to upload the YAML download of this record to the Sandbox gives an error message with the most recent hepdata-validator version:

Invalid error value none: value must be a number (possibly ending in %) in 'dependent_variables.values[0].errors[1].symerror'

But this wasn't the case with the older hepdata-validator version when the original record was uploaded by STAR in 2021.

I don't see a reason to keep the none error values, so I've removed them from the data tables of https://www.hepdata.net/record/ins1253360 . The validation with the most recent hepdata-validator version now passes, as does the existing conversion to YODA2. I'll still merge this PR in case any other records have a similar problem.

@GraemeWatt GraemeWatt merged commit 26658e4 into HEPData:main Dec 5, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants