Permalink
Browse files

Initializing model with pre-existing database now re-associates trace…

…s with model nodes.
  • Loading branch information...
1 parent 055b94f commit 1d2657a0f13d106a6268441b2695815784d3680e @fonnesbeck fonnesbeck committed Feb 1, 2012
Showing with 6 additions and 1 deletion.
  1. +1 −1 CREDITS.rst
  2. +5 −0 pymc/Model.py
View
@@ -8,7 +8,7 @@ Development team
* Christopher Fonnesbeck
* David Huard
* Anand Patil
-
+* John Salvatier
Contributors
============
View
@@ -203,6 +203,11 @@ def __init__(self, input=None, db='ram', name='Sampler', reinit_model=True, calc
self._iter = None
self._state = ['status', '_current_iter', '_iter']
+
+ if hasattr(db, '_traces'):
+ # Put traces on objects
+ for v in self._variables_to_tally:
+ v.trace = self.db._traces[v.__name__]
def _sum_deviance(self):
# Sum deviance from all stochastics

0 comments on commit 1d2657a

Please sign in to comment.