Skip to content

Commit b654be9

Browse files
chore: [pre-commit.ci] pre-commit autoupdate (#2240)
* Update pre-commit hooks: - github.com/astral-sh/ruff-pre-commit: v0.0.270 → v0.0.276 - github.com/asottile/blacken-docs: 1.13.0 → 1.14.0 - github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1 - github.com/codespell-project/codespell: v2.2.4 → v2.2.5 * Add ClassVar type hint and apply isort. - Avoid RUF012 Mutable class attributes should be annotated with `typing.ClassVar`.
1 parent a25f196 commit b654be9

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
exclude: ^validation/|\.dtd$|\.xml$
2828

2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: "v0.0.270"
30+
rev: "v0.0.276"
3131
hooks:
3232
- id: ruff
3333
args: ["--fix", "--show-fixes"]
@@ -38,13 +38,13 @@ repos:
3838
- id: black-jupyter
3939

4040
- repo: https://github.com/asottile/blacken-docs
41-
rev: 1.13.0
41+
rev: 1.14.0
4242
hooks:
4343
- id: blacken-docs
4444
additional_dependencies: [black==23.3.0]
4545

4646
- repo: https://github.com/pre-commit/mirrors-mypy
47-
rev: v1.3.0
47+
rev: v1.4.1
4848
# check the oldest and newest supported Pythons
4949
hooks:
5050
- &mypy
@@ -62,11 +62,11 @@ repos:
6262
rev: 1.7.0
6363
hooks:
6464
- id: nbqa-ruff
65-
additional_dependencies: [ruff==0.0.270]
65+
additional_dependencies: [ruff==0.0.276]
6666
args: ["--extend-ignore=F821,F401,F841,F811"]
6767

6868
- repo: https://github.com/codespell-project/codespell
69-
rev: v2.2.4
69+
rev: v2.2.5
7070
hooks:
7171
- id: codespell
7272
files: ^.*\.(py|md|rst)$

src/pyhf/workspace.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55
* the observed data (optional)
66
* fit configurations ("measurements")
77
"""
8+
from __future__ import annotations
9+
10+
import collections
11+
import copy
812
import logging
13+
from typing import ClassVar
14+
915
import jsonpatch
10-
import copy
11-
import collections
12-
from pyhf import exceptions
13-
from pyhf import schema
14-
from pyhf.pdf import Model
16+
17+
from pyhf import exceptions, schema
1518
from pyhf.mixins import _ChannelSummaryMixin
19+
from pyhf.pdf import Model
1620

1721
log = logging.getLogger(__name__)
1822

@@ -284,7 +288,7 @@ class Workspace(_ChannelSummaryMixin, dict):
284288
A JSON-serializable object that is built from an object that follows the :obj:`workspace.json` `schema <https://scikit-hep.org/pyhf/likelihood.html#workspace>`__.
285289
"""
286290

287-
valid_joins = ['none', 'outer', 'left outer', 'right outer']
291+
valid_joins: ClassVar[list[str]] = ['none', 'outer', 'left outer', 'right outer']
288292

289293
def __init__(self, spec, validate: bool = True, **config_kwargs):
290294
"""

0 commit comments

Comments
 (0)