Skip to content

Commit

Permalink
Merge pull request #2227 from NNPDF/add_scalevar_test
Browse files Browse the repository at this point in the history
add test_unique_theoryid_variations
  • Loading branch information
RoyStegeman authored Nov 26, 2024
2 parents 676e70f + 400d569 commit 9eb9f73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions validphys2/src/validphys/tests/test_scalevariationtheoryids.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import importlib.resources as resources

from ruamel.yaml import YAML

import validphys.scalevariations

yaml = YAML()


def test_unique_theoryid_variations():
"""Check that for each theoryid there is only one set of scale variations in
scalevariationtheoryids.yaml
"""
file_path = resources.files(validphys.scalevariations).joinpath("scalevariationtheoryids.yaml")
with file_path.open("r") as file:
data = yaml.load(file)
thids = [k["theoryid"] for k in data["scale_variations_for"]]
assert len(thids) == len(set(thids))

0 comments on commit 9eb9f73

Please sign in to comment.