@@ -113,27 +113,29 @@ def instantiate_steppers(_model, steps, selected_steps, step_kwargs=None):
113
113
A fully-specified model object; legacy argument -- ignored
114
114
steps : step function or vector of step functions
115
115
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.
117
117
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.
119
119
step_kwargs : dict
120
120
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.
122
122
123
123
Returns
124
124
-------
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.
127
128
"""
128
129
if step_kwargs is None :
129
130
step_kwargs = {}
130
131
131
132
used_keys = set ()
132
133
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 )
137
139
138
140
unused_args = set (step_kwargs ).difference (used_keys )
139
141
if unused_args :
0 commit comments