Skip to content

Commit

Permalink
Merge branch 'master' into build/use-hatchling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held authored Nov 7, 2024
2 parents a04d069 + 8f78894 commit 81cd337
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ repos:
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.11.2
hooks:
- id: mypy
name: mypy with Python 3.9
files: src/cabinetry
additional_dependencies: ["numpy>=1.22", "boost-histogram>=1.0.1", "click>=8", "types-tabulate", "types-PyYAML", "hist>=2.3.0"]
# numpy 1.25 is no longer compatible with Python 3.8, so use Python >=3.9 for type checking
args: ["--python-version=3.9"]
- id: mypy
name: mypy with Python 3.12
files: src/cabinetry
Expand Down
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 81cd337

Please sign in to comment.