Skip to content

Commit

Permalink
Improved TypeError message for distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
fonnesbeck committed Jul 17, 2017
1 parent e4fb845 commit 8d2565f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pymc3/distributions/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def __new__(cls, name, *args, **kwargs):
except TypeError:
raise TypeError("No model on context stack, which is needed to "
"instantiate distributions. Add variable inside "
"a 'with model:' block")
"a 'with model:' block, or use the '.dist' syntax "
"for a standalone distribution.")

if isinstance(name, string_types):
data = kwargs.pop('observed', None)
Expand Down

0 comments on commit 8d2565f

Please sign in to comment.