Skip to content

Commit

Permalink
feat: allow custom top-level properties in configuration schema (#488)
Browse files Browse the repository at this point in the history
* allow custom top-level properties in configuration schema
  • Loading branch information
alexander-held authored Oct 1, 2024
1 parent d410d35 commit 8f78894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cabinetry/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,5 +422,5 @@
"additionalProperties": false
}
},
"additionalProperties": false
"additionalProperties": true
}
3 changes: 2 additions & 1 deletion tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def test_validate():
}
assert configuration.validate(config_valid)

# not exactly one data sample
# not exactly one data sample, custom additional top-level properties
config_multiple_data_samples = {
"General": {"Measurement": "", "HistogramFolder": "", "InputPath": ""},
"Regions": [{"Name": "", "Filter": "", "Variable": "", "Binning": [0, 1]}],
"Samples": [{"Name": "", "Tree": ""}],
"NormFactors": [{"Name": ""}],
"ABC": [],
}
with pytest.raises(
NotImplementedError, match="can only handle cases with exactly one data sample"
Expand Down

0 comments on commit 8f78894

Please sign in to comment.