-
Notifications
You must be signed in to change notification settings - Fork 85
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: Add pyhf.workspace.build #1101
Conversation
src/pyhf/workspace.py
Outdated
workspace = copy.deepcopy(model.spec) | ||
workspace['version'] = '1.0.0' | ||
workspace['measurements'] = [ | ||
{'name': name, 'config': {'poi': model.config.poi_name, 'parameters': []}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ignores fixed parameters. @kratsg maybe we add it in a follow-up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukasheinrich I haven't looked at this much yet, but how much work would it take to get this all in one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this
param_configs = [{'name': param_name, 'inits': model.config.suggested_init()[model.config.param_set(param_name)['slice']], 'bounds': model.config.suggested_bounds()[model.config.param_set(param_name)['slice']), 'fixed': True} for param_name in model.config.parameters if model.config.suggested_fixed()[.....]]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Codecov Report
@@ Coverage Diff @@
## master #1101 +/- ##
==========================================
+ Coverage 96.87% 96.89% +0.01%
==========================================
Files 62 62
Lines 3556 3570 +14
Branches 510 513 +3
==========================================
+ Hits 3445 3459 +14
Misses 68 68
Partials 43 43
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
black seems happy on my machine, but not in CI, @matthewfeickert any idea? |
Where is |
Co-authored-by: Giordon Stark <[email protected]>
a7c1205
to
6af2f85
Compare
Co-authored-by: Giordon Stark <[email protected]>
4f98bf7
to
c75d949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good @lukasheinrich. 👍 I rebased it and fixed a few small things that got dropped in the merges and added in some things missing to the docstring.
This is basically done, but I agree with @kratsg thought that
but we should check a "roundtrip" of sorts with simpler workspaces
Co-authored-by: Matthew Feickert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a formatting suggestion and then I agree with @kratsg's suggestion to only add in non-default settings.
Co-authored-by: Matthew Feickert <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @lukasheinrich. 👍
Description
this is the inverse of
maybe interesting for @alexander-held, too
ReadTheDocs build: https://pyhf.readthedocs.io/en/workspace_maker/_generated/pyhf.workspace.Workspace.html
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: