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

feat: Allow readxml to demote validation exception to warning #1865

Merged
merged 4 commits into from
May 23, 2022

Conversation

kratsg
Copy link
Contributor

@kratsg kratsg commented May 23, 2022

Pull Request Description

This resolves #1864. Added functionality pyhf.readxml to push the exception down to a warning if needed, so conversion still works for invalid XML workspaces, but will still warn that it is invalid. This also adds it to pyhf xml2json as well.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Add ability to passing validation_as_error=False to readxml.parse to warn when the workspace
is invalid instead of just raising an exception (default is to raise exception).
* Add --validation-as-error/validation-as-warning flag to xml2json command line interface to
switch between the two (default is to raise exception).

@kratsg kratsg added API Changes the public API CLI Affects the CLI API feat/enhancement New feature or request user request Request coming form a pyhf user labels May 23, 2022
@kratsg kratsg self-assigned this May 23, 2022
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #1865 (1196065) into master (de4ce07) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1865   +/-   ##
=======================================
  Coverage   98.16%   98.17%           
=======================================
  Files          68       68           
  Lines        4315     4322    +7     
  Branches      725      726    +1     
=======================================
+ Hits         4236     4243    +7     
  Misses         46       46           
  Partials       33       33           
Flag Coverage Δ
contrib 26.39% <0.00%> (-0.05%) ⬇️
doctest 60.73% <36.36%> (-0.06%) ⬇️
unittests-3.10 96.04% <100.00%> (+<0.01%) ⬆️
unittests-3.7 96.02% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pyhf/cli/rootio.py 92.30% <100.00%> (+0.15%) ⬆️
src/pyhf/readxml.py 94.57% <100.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de4ce07...1196065. Read the comment docs.

Copy link
Member

@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍 Thanks for fixing the coverage!

@matthewfeickert matthewfeickert merged commit b4abe41 into master May 23, 2022
@matthewfeickert matthewfeickert deleted the feat/skipValidationxml2json branch May 23, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes the public API CLI Affects the CLI API feat/enhancement New feature or request user request Request coming form a pyhf user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Skip schema validation for xml2json
2 participants