Skip to content

Commit 1901125

Browse files
committed
drop off the additional List
1 parent 510b30e commit 1901125

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/pyhf/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def paramset_to_rootnames(paramset):
1919
paramset (:obj:`pyhf.paramsets.paramset`): The parameter set.
2020
2121
Returns:
22-
:obj:`List[str]` or :obj:`str`: The generated parameter names
22+
:obj:`list[str]` or :obj:`str`: The generated parameter names
2323
(for the non-scalar/scalar case) respectively.
2424
2525
Example:

src/pyhf/modifiers/staterror.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
import logging
2-
from typing import List
34

45
import pyhf
56
from pyhf import events
@@ -10,7 +11,7 @@
1011
log = logging.getLogger(__name__)
1112

1213

13-
def required_parset(sigmas, fixed: List[bool]):
14+
def required_parset(sigmas, fixed: list[bool]):
1415
n_parameters = len(sigmas)
1516
return {
1617
'paramset_type': 'constrained_by_normal',

src/pyhf/parameters/paramsets.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import List
2-
31
import pyhf
42

53
__all__ = [
@@ -29,7 +27,7 @@ def __init__(self, **kwargs):
2927
)
3028

3129
@property
32-
def suggested_fixed(self) -> List[bool]:
30+
def suggested_fixed(self) -> list[bool]:
3331
if isinstance(self._suggested_fixed, bool):
3432
return [self._suggested_fixed] * self.n_parameters
3533
return self._suggested_fixed

src/pyhf/pdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import copy
44
import logging
5-
from typing import List, Union
5+
from typing import Union
66

77
import pyhf.parameters
88
import pyhf
@@ -406,7 +406,7 @@ def param_set(self, name):
406406
"""
407407
return self.par_map[name]['paramset']
408408

409-
def suggested_fixed(self) -> List[bool]:
409+
def suggested_fixed(self) -> list[bool]:
410410
"""
411411
Identify the fixed parameters in the model.
412412

src/pyhf/readxml.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
IO,
66
Callable,
77
Iterable,
8-
List,
98
MutableMapping,
109
MutableSequence,
1110
Sequence,
@@ -99,7 +98,7 @@ def extract_error(hist: uproot.behaviors.TH1.TH1) -> list[float]:
9998
"""
10099

101100
variance = hist.variances() if hist.weighted else hist.to_numpy()[0]
102-
return cast(List[float], np.sqrt(variance).tolist())
101+
return cast(list[float], np.sqrt(variance).tolist())
103102

104103

105104
def import_root_histogram(

0 commit comments

Comments
 (0)