Skip to content

Commit

Permalink
Add vars property to CompoundStep
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Sep 22, 2021
1 parent 31a9f14 commit d926746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,7 @@ def assign_step_methods(model, step=None, methods=STEP_METHODS, step_kwargs=None
except TypeError:
steps.append(step)
for step in steps:
try:
assigned_vars = assigned_vars.union(set(step.vars))
except AttributeError:
for method in step.methods:
assigned_vars = assigned_vars.union(set(method.vars))
assigned_vars = assigned_vars.union(set(step.vars))

# Use competence classmethods to select step methods for remaining
# variables
Expand Down
4 changes: 4 additions & 0 deletions pymc3/step_methods/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ def reset_tuning(self):
for method in self.methods:
if hasattr(method, "reset_tuning"):
method.reset_tuning()

@property
def vars(self):
return [var for method in self.methods for var in method.vars]

0 comments on commit d926746

Please sign in to comment.