@@ -112,31 +112,31 @@ def instantiate_steppers(_model, steps, selected_steps, step_kwargs=None):
112
112
----------
113
113
model : Model object
114
114
A fully-specified model object; legacy argument -- ignored
115
- steps : step function or vector of step functions
116
- One or more step functions that have been assigned to some subset of
117
- the model's parameters. Defaults to None (no assigned variables).
118
- selected_steps : dictionary of step methods and variables
119
- The step methods and the variables that have were assigned to them .
115
+ steps : list
116
+ A list of zero or more step function instances that have been assigned to some subset of
117
+ the model's parameters.
118
+ selected_steps : dict
119
+ A dictionary that maps a step method class to a list of zero or more model variables .
120
120
step_kwargs : dict
121
121
Parameters for the samplers. Keys are the lower case names of
122
- the step method, values a dict of arguments.
122
+ the step method, values a dict of arguments. Defaults to None.
123
123
124
124
Returns
125
125
-------
126
- methods : list
127
- List of step methods associated with the model's variables.
126
+ methods : list or step
127
+ List of step methods associated with the model's variables, or step method
128
+ if there is only one.
128
129
"""
129
130
if step_kwargs is None :
130
131
step_kwargs = {}
131
132
132
133
used_keys = set ()
133
134
for step_class , vars in selected_steps .items ():
134
- if len (vars ) == 0 :
135
- continue
136
- args = step_kwargs .get (step_class .name , {})
137
- used_keys .add (step_class .name )
138
- step = step_class (vars = vars , ** args )
139
- steps .append (step )
135
+ if vars :
136
+ args = step_kwargs .get (step_class .name , {})
137
+ used_keys .add (step_class .name )
138
+ step = step_class (vars = vars , ** args )
139
+ steps .append (step )
140
140
141
141
unused_args = set (step_kwargs ).difference (used_keys )
142
142
if unused_args :
0 commit comments