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

Re-implementation of CMS_Z0J_8TEV in the new format #2241

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ea20a14
First commit
achiefa Dec 6, 2024
516bbc9
Legacy label for legacy data
achiefa Dec 9, 2024
8af014f
Add filter + rawdata
achiefa Dec 9, 2024
fc80949
Remove legacy data and kin
achiefa Dec 9, 2024
d842a8e
Add generated data
achiefa Dec 9, 2024
50f80d7
Update filters and process_options
achiefa Dec 9, 2024
0b47652
Automatically regenerated commondata from PR 2241, branch new_CMS_Z0J…
Dec 9, 2024
364eadb
Change figure_by from y to pT
achiefa Dec 9, 2024
33d46b5
Update tests
achiefa Dec 9, 2024
a956bf1
Regenerate plot tests
achiefa Dec 9, 2024
87c2197
Regenerate test 2
achiefa Dec 9, 2024
a87357c
Remove log
achiefa Dec 9, 2024
ece16be
Adjust pixel size test_plot_xq2_custom.png
achiefa Dec 9, 2024
d8860ee
Adjust pixel size test_plotfancy.png
achiefa Dec 9, 2024
436ac09
Adjust pixel size test_plot_xq2.png
achiefa Dec 9, 2024
3994947
Re-adjust pixel size test_plotfancy.png
achiefa Dec 9, 2024
6cb506a
From mass to mass squared in metadata description
achiefa Dec 9, 2024
e007797
Correct label uncertainties
achiefa Dec 9, 2024
6078d5c
Automatically regenerated commondata from PR 2241, branch new_CMS_Z0J…
Dec 9, 2024
e379eb0
Regenerate plots with linux machine
achiefa Dec 11, 2024
efaa360
Yet another argument with the test
achiefa Dec 11, 2024
6e34e16
Am I the last one?
achiefa Dec 11, 2024
fdbc50e
increase conda test tolerance
RoyStegeman Dec 11, 2024
a7a997d
Clean filter.py
achiefa Dec 16, 2024
9726798
Add docstrings
achiefa Dec 16, 2024
86fe496
Cleaning filter files
achiefa Dec 18, 2024
2d8976d
Remove `save_to_yaml` option.
achiefa Dec 18, 2024
450f731
Remove `table` from __extract_kinematics
achiefa Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e

# Python tests for the installed validphys package
# Note that the default tolerance in the conda test is higher than the pip test
pytest --pyargs --mpl validphys --mpl-default-tolerance 22
pytest --pyargs --mpl validphys --mpl-default-tolerance 24

platformstr=`uname`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ data_central:
- 460.5
- 222.6
- 109.8
- 61.84
- 6.18400000e+01
- 30.19
- 13.55
- 1.35500000e+01
- 0.6181
- 9862.0
- 2863.0
Expand All @@ -18,16 +18,16 @@ data_central:
- 58.13
- 29.85
- 13.76
- 0.6122000000000001
- 6.12200000e-01
- 9205.0
- 2588.0
- 935.5
- 416.3
- 199.0
- 103.1
- 54.06
- 5.40600000e+01
- 28.45
- 13.64
- 1.36400000e+01
- 0.5521
- 6893.0
- 1933.0
Expand All @@ -37,10 +37,10 @@ data_central:
- 84.62
- 47.57
- 24.13
- 11.3
- 1.13000000e+01
- 0.4657
- 3709.0
- 1021.0
- 1.02100000e+03
- 381.6
- 176.6
- 90.49
Expand Down
40 changes: 40 additions & 0 deletions nnpdf_data/nnpdf_data/commondata/CMS_Z0J_8TEV/filter.py
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.
achiefa marked this conversation as resolved.
Show resolved Hide resolved
"""
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)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, _, _ = CMS_Z0J_8TEV.generate_data(variant='default', save_to_yaml=True)
_, _, _ = CMS_Z0J_8TEV.generate_data(variant='sys_10', save_to_yaml=True)
CMS_Z0J_8TEV.generate_data(variant='default', save_to_yaml=True)
CMS_Z0J_8TEV.generate_data(variant='sys_10', save_to_yaml=True)

Loading
Loading