Skip to content
Snippets Groups Projects
Commit c3ac13df authored by Matthew David Pitkin's avatar Matthew David Pitkin
Browse files

pymc3.py: make sure step is set within the model context manager

parent d5c0628b
No related branches found
No related tags found
1 merge request!260pymc3.py: make sure step is set within the model context manager
......@@ -428,7 +428,8 @@ class Pymc3(MCMCSampler):
curmethod = self.step_method[key].lower()
self.kwargs['step'].append(pymc3.__dict__[step_methods[curmethod]]([self.pymc3_priors[key]]))
else:
self.kwargs['step'] = None if self.step_method is None else pymc3.__dict__[step_methods[self.step_method]]()
with self.pymc3_model:
self.kwargs['step'] = None if self.step_method is None else pymc3.__dict__[step_methods[self.step_method]]()
# if a custom log_likelihood function requires a `sampler` argument
# then use that log_likelihood function, with the assumption that it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment