Skip to content

Commit

Permalink
Fix to allow cmenergies with more than 1 dp
Browse files Browse the repository at this point in the history
Fixes #42
  • Loading branch information
alisonrclarke committed Nov 30, 2021
1 parent b484848 commit 89de02b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hepdata_validator/submission_file_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def check_cmenergies(data_item):
try:
cmenergy = float(cmenergy)
except ValueError:
m = re.match(r'^\d+\.?\d?-\d+\.?\d?$', cmenergy)
m = re.match(r'^\d+\.?\d*-\d+\.?\d*$', cmenergy)
if not m or len(cmenergies) > 1:
raise ValidationError("Invalid value (in GeV) for cmenergies: '%s'" % cmenergy,
path=['keywords', i, 'name', 'cmenergies'],
Expand Down
4 changes: 2 additions & 2 deletions testsuite/test_data/valid_submission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ description: The measured total cross sections. The first systematic uncertaint
keywords: # used for searching, possibly multiple values for each keyword
- { name: reactions, values: [P P --> Z0 Z0 X]}
- { name: observables, values: [SIG]}
- { name: cmenergies, values: [7000.0-8000.0]}
data_file: data2.yaml
- { name: cmenergies, values: [7000.01-8000.000001]}
data_file: data2.yaml

0 comments on commit 89de02b

Please sign in to comment.