Skip to content

Commit 032b9e7

Browse files
committed
clarify docs, invert guard
1 parent f2967dd commit 032b9e7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pymc3/sampling.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,29 @@ def instantiate_steppers(_model, steps, selected_steps, step_kwargs=None):
113113
A fully-specified model object; legacy argument -- ignored
114114
steps : step function or vector of step functions
115115
One or more step functions that have been assigned to some subset of
116-
the model's parameters. Defaults to None (no assigned variables).
116+
the model's parameters.
117117
selected_steps : dictionary of step methods and variables
118-
The step methods and the variables that have were assigned to them.
118+
The step methods and the (possibly zero) variables that have were assigned to them.
119119
step_kwargs : dict
120120
Parameters for the samplers. Keys are the lower case names of
121-
the step method, values a dict of arguments.
121+
the step method, values a dict of arguments. Defaults to None.
122122
123123
Returns
124124
-------
125-
methods : list
126-
List of step methods associated with the model's variables.
125+
methods : list or step
126+
List of step methods associated with the model's variables, or step method
127+
if there is only one.
127128
"""
128129
if step_kwargs is None:
129130
step_kwargs = {}
130131

131132
used_keys = set()
132133
for step_class, vars in selected_steps.items():
133-
args = step_kwargs.get(step_class.name, {})
134-
used_keys.add(step_class.name)
135-
step = step_class(vars=vars, **args)
136-
steps.append(step)
134+
if vars:
135+
args = step_kwargs.get(step_class.name, {})
136+
used_keys.add(step_class.name)
137+
step = step_class(vars=vars, **args)
138+
steps.append(step)
137139

138140
unused_args = set(step_kwargs).difference(used_keys)
139141
if unused_args:

0 commit comments

Comments
 (0)