Skip to content

Commit 9ff19f2

Browse files
author
Joseph Hall
committed
Fix mypy issue
1 parent 86af2dd commit 9ff19f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pymc/sampling/mcmc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
Optional,
3131
Sequence,
3232
Tuple,
33+
Type,
3334
Union,
3435
overload,
3536
)
@@ -92,7 +93,7 @@ def __call__(self, trace: IBaseTrace, draw: Draw):
9293
def instantiate_steppers(
9394
model,
9495
steps: List[Step],
95-
selected_steps: Dict[str, List[Any]],
96+
selected_steps: Dict[Type[BlockedStep], List[Any]],
9697
step_kwargs: Optional[Dict[str, Dict]] = None,
9798
) -> Union[Step, List[Step]]:
9899
"""Instantiate steppers assigned to the model variables.
@@ -125,8 +126,9 @@ def instantiate_steppers(
125126
used_keys = set()
126127
for step_class, vars in selected_steps.items():
127128
if vars:
128-
args = step_kwargs.get(step_class.name, {})
129-
used_keys.add(step_class.name)
129+
name = getattr(step_class, "name")
130+
args = step_kwargs.get(name, {})
131+
used_keys.add(name)
130132
step = step_class(vars=vars, model=model, **args)
131133
steps.append(step)
132134

0 commit comments

Comments
 (0)