-
Notifications
You must be signed in to change notification settings - Fork 7
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
Re-implementation of CMS_Z0J_8TEV in the new format #2241
Open
achiefa
wants to merge
23
commits into
master
Choose a base branch
from
new_CMS_Z0J_8TEV
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ea20a14
First commit
achiefa 516bbc9
Legacy label for legacy data
achiefa 8af014f
Add filter + rawdata
achiefa fc80949
Remove legacy data and kin
achiefa d842a8e
Add generated data
achiefa 50f80d7
Update filters and process_options
achiefa 0b47652
Automatically regenerated commondata from PR 2241, branch new_CMS_Z0J…
364eadb
Change figure_by from y to pT
achiefa 33d46b5
Update tests
achiefa a956bf1
Regenerate plot tests
achiefa 87c2197
Regenerate test 2
achiefa a87357c
Remove log
achiefa ece16be
Adjust pixel size test_plot_xq2_custom.png
achiefa d8860ee
Adjust pixel size test_plotfancy.png
achiefa 436ac09
Adjust pixel size test_plot_xq2.png
achiefa 3994947
Re-adjust pixel size test_plotfancy.png
achiefa 6cb506a
From mass to mass squared in metadata description
achiefa e007797
Correct label uncertainties
achiefa 6078d5c
Automatically regenerated commondata from PR 2241, branch new_CMS_Z0J…
e379eb0
Regenerate plots with linux machine
achiefa efaa360
Yet another argument with the test
achiefa 6e34e16
Am I the last one?
achiefa fdbc50e
increase conda test tolerance
RoyStegeman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,40 @@ | ||||||||||
''' | ||||||||||
Filter script for CMS_Z0J_8TEV | ||||||||||
''' | ||||||||||
|
||||||||||
import logging | ||||||||||
|
||||||||||
from filter_utils import Extractor | ||||||||||
import numpy as np | ||||||||||
import yaml | ||||||||||
|
||||||||||
logging.basicConfig(level=logging.INFO, format='[%(levelname)s] %(message)s') | ||||||||||
|
||||||||||
|
||||||||||
def check_dat_with_legacy(observable, rtol=1e-03): | ||||||||||
""" | ||||||||||
Same as `check_unc_with_legacy`, but for central data points. | ||||||||||
""" | ||||||||||
logging.info( | ||||||||||
f"Comparing the new central data implementation with the legacy version for {observable} using rtol = {rtol}." | ||||||||||
) | ||||||||||
|
||||||||||
with open('./data_' + observable + '.yaml', 'r') as file: | ||||||||||
new_data = yaml.safe_load(file) | ||||||||||
|
||||||||||
with open('./data_legacy_' + observable + '.yaml', 'r') as file: | ||||||||||
legacy_data = yaml.safe_load(file) | ||||||||||
|
||||||||||
for i, (new_val, legacy_val) in enumerate( | ||||||||||
zip(new_data['data_central'], legacy_data['data_central']) | ||||||||||
): | ||||||||||
try: | ||||||||||
assert np.allclose(new_val, legacy_val, rtol=rtol) | ||||||||||
except AssertionError as e: | ||||||||||
logging.warning(f"Inconsistency, {new_val} != {legacy_val} in bin: {i+1}") | ||||||||||
|
||||||||||
|
||||||||||
if __name__ == "__main__": | ||||||||||
CMS_Z0J_8TEV = Extractor("./metadata.yaml", "PT-Y", mult_factor=1000) | ||||||||||
_, _, _ = CMS_Z0J_8TEV.generate_data(variant='default', save_to_yaml=True) | ||||||||||
_, _, _ = CMS_Z0J_8TEV.generate_data(variant='sys_10', save_to_yaml=True) | ||||||||||
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
check_unc_with_legacy
lives in a different directory at the same level so I don't think it makes much sense to refer to it here