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

ci: add mypy back to pre-commit #499

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ repos:
rev: 25.1.0
hooks:
- id: black
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.14.1
# hooks:
# - id: mypy
# name: mypy with Python 3.12
# files: src/cabinetry
# additional_dependencies: ["numpy>=1.22", "boost-histogram>=1.0.1", "click>=8", "types-tabulate", "types-PyYAML", "hist>=2.3.0"]
# args: ["--python-version=3.12"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
name: mypy with Python 3.12
files: src/cabinetry
additional_dependencies: ["numpy>=1.22", "boost-histogram>=1.0.1", "click>=8", "types-tabulate", "types-PyYAML", "hist>=2.3.0"]
args: ["--python-version=3.12"]
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
Expand Down
6 changes: 3 additions & 3 deletions src/cabinetry/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def _parameters_maximizing_constraint_term(
Returns:
List[float]: parameters maximizing the model constraint term
"""
best_pars = [] # parameters maximizing constraint term
best_pars: List[float] = [] # parameters maximizing constraint term
i_aux = 0 # current position in auxiliary data list
i_poisson = 0 # current position in list of Poisson rescale factors

Expand All @@ -760,9 +760,9 @@ def _parameters_maximizing_constraint_term(
else:
rescale_factors = [1.0] * n_params # no rescaling by default

best_pars += list(
best_pars += (
np.asarray(aux_data[i_aux : i_aux + n_params]) / rescale_factors
)
).tolist()
i_aux += n_params

else:
Expand Down
Loading