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

Add a test for all commondata files #1994

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

scarlehoff
Copy link
Member

@scarlehoff scarlehoff commented Mar 8, 2024

I am skipping the error due to #1991 since I guess that will take some time (and better to have some testing as soon as possible).

I am checking:

  • Whether the data can be loaded
  • The kinematics can be loaded and:
  • The central data can be loaded and has the right ndata
  • The uncertainties can be loaded
    • The stat key is correctly used
    • The inter-dataset correlations have unique name
    • All treatment is either MULT or ADD

All of this is checked for all datasets and variant regardless of whether they have a theory or not.
Any other ideas for things to test?

This closes #1990

(the current failure is for a fix already in master, will rebase)

Base automatically changed from fix_cross_correlation_type to master March 8, 2024 15:21
@scarlehoff scarlehoff linked an issue Mar 8, 2024 that may be closed by this pull request
Copy link
Member

@RoyStegeman RoyStegeman left a comment

Choose a reason for hiding this comment

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

Seems fine to me!

I can't think of an important check that's missing. If you really wanted there are some more checks on the metadata you could add, but since the checks you can do will never cover all mistakes someone implementing a dataset can make it may become a bit random and pointless.

@@ -159,7 +160,8 @@ def _hqp_yq_xq2map(kin_dict):

def _hqp_yqq_xq2map(kin_dict):
# Compute x, Q2
ratio = np.sqrt(kin_dict[_Vars.m_t2]) / kin_dict[_Vars.sqrts]
mass2 = _get_or_fail(kin_dict, [_Vars.m_t2, _Vars.m_ttBar])
Copy link
Member

Choose a reason for hiding this comment

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

Why do you do _get_or_fail here but not for the variables?

Copy link
Member Author

Choose a reason for hiding this comment

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

The others will fail if they are not there (because it's a dict). It's just a way of having some general control over the situation of having more than one possibility for one variable. Although right now is basically a dictionary.get with a fallback

validphys2/src/validphys/tests/test_datafiles.py Outdated Show resolved Hide resolved
validphys2/src/validphys/tests/test_datafiles.py Outdated Show resolved Hide resolved
scarlehoff and others added 2 commits March 9, 2024 17:36
@scarlehoff scarlehoff added the redo-regressions Recompute the regression data label Mar 9, 2024
@scarlehoff scarlehoff merged commit 04b3e7e into master Mar 9, 2024
@scarlehoff scarlehoff deleted the add_test_for_commondata branch March 9, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redo-regressions Recompute the regression data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a test for all (new) commondata
2 participants