Skip to content

Commit 366323a

Browse files
ricardoV94michaelosthege
authored andcommitted
Add vars property to CompoundStep
1 parent 97dc4bd commit 366323a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pymc3/sampling.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,7 @@ def assign_step_methods(model, step=None, methods=STEP_METHODS, step_kwargs=None
187187
except TypeError:
188188
steps.append(step)
189189
for step in steps:
190-
try:
191-
assigned_vars = assigned_vars.union(set(step.vars))
192-
except AttributeError:
193-
for method in step.methods:
194-
assigned_vars = assigned_vars.union(set(method.vars))
190+
assigned_vars = assigned_vars.union(set(step.vars))
195191

196192
# Use competence classmethods to select step methods for remaining
197193
# variables

pymc3/step_methods/compound.py

+4
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,7 @@ def reset_tuning(self):
7171
for method in self.methods:
7272
if hasattr(method, "reset_tuning"):
7373
method.reset_tuning()
74+
75+
@property
76+
def vars(self):
77+
return [var for method in self.methods for var in method.vars]

0 commit comments

Comments
 (0)