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

chore: [pre-commit.ci] pre-commit autoupdate #2314

Merged
merged 4 commits into from
Sep 5, 2023
Merged
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
exclude: ^validation/|\.dtd$|\.xml$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.281"
rev: "v0.0.287"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -38,13 +38,13 @@ repos:
- id: black-jupyter

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.5.1
# check the oldest and newest supported Pythons
hooks:
- &mypy
Expand All @@ -62,7 +62,7 @@ repos:
rev: 1.7.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.0.281]
additional_dependencies: [ruff==0.0.287]
args: ["--extend-ignore=F821,F401,F841,F811"]

- repo: https://github.com/codespell-project/codespell
Expand Down
8 changes: 3 additions & 5 deletions src/pyhf/parameters/paramsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, **kwargs):

@property
def suggested_fixed(self) -> List[bool]:
if type(self._suggested_fixed) == bool:
if isinstance(self._suggested_fixed, bool):
return [self._suggested_fixed] * self.n_parameters
return self._suggested_fixed

Expand All @@ -47,11 +47,9 @@ def suggested_fixed_as_bool(self) -> bool:

@suggested_fixed.setter
def suggested_fixed(self, value):
if type(value) == bool:
self._suggested_fixed = value
else:
if not isinstance(value, bool):
assert len(value) == self.n_parameters
self._suggested_fixed = value
self._suggested_fixed = value


class unconstrained(paramset):
Expand Down
4 changes: 3 additions & 1 deletion src/pyhf/readxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ def process_measurements(
other_parameter_configs = other_parameter_configs if other_parameter_configs else []

for x in toplvl.findall('Measurement'):
parameter_configs_map: MutableMapping[str, Parameter] = {k['name']: dict(**k) for k in other_parameter_configs} # type: ignore[misc]
parameter_configs_map: MutableMapping[str, Parameter] = {
k['name']: dict(**k) for k in other_parameter_configs
}
lumi = float(x.attrib['Lumi'])
lumierr = lumi * float(x.attrib['LumiRelErr'])

Expand Down
Loading