Skip to content

Commit 4972258

Browse files
authored
Fix for 3727. (#3856)
1 parent 4a37e24 commit 4972258

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pymc3/model.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def _build_joined(self, cost, args, vmap):
713713
return args_joined, theano.clone(cost, replace=replace)
714714

715715

716-
class Model(Factor, WithMemoization, metaclass=ContextMeta, context_class='Model'):
716+
class Model(Factor, WithMemoization, metaclass=ContextMeta):
717717
"""Encapsulates the variables and likelihood factors of a model.
718718
719719
Model class can be used for creating class based models. To create
@@ -855,7 +855,7 @@ def root(self):
855855
def isroot(self):
856856
return self.parent is None
857857

858-
@property # type: ignore -- mypy can't handle decorated types.
858+
@property # type: ignore
859859
@memoize(bound=True)
860860
def bijection(self):
861861
vars = inputvars(self.vars)
@@ -1232,6 +1232,10 @@ def _repr_latex_(self, name=None, dist=None):
12321232

12331233
__latex__ = _repr_latex_
12341234

1235+
# this is really disgusting, but it breaks a self-loop: I can't pass Model
1236+
# itself as context class init arg.
1237+
Model._context_class = Model
1238+
12351239

12361240
def set_data(new_data, model=None):
12371241
"""Sets the value of one or more data container variables.

0 commit comments

Comments
 (0)