@@ -292,7 +292,7 @@ def __new__(
292
292
293
293
rv_out .logp = _make_nice_attr_error ("rv.logp(x)" , "pm.logp(rv, x)" )
294
294
rv_out .logcdf = _make_nice_attr_error ("rv.logcdf(x)" , "pm.logcdf(rv, x)" )
295
- rv_out .random = _make_nice_attr_error ("rv.random()" , "rv.eval( )" )
295
+ rv_out .random = _make_nice_attr_error ("rv.random()" , "pm.draw(rv )" )
296
296
return rv_out
297
297
298
298
@classmethod
@@ -351,7 +351,7 @@ def dist(
351
351
352
352
rv_out .logp = _make_nice_attr_error ("rv.logp(x)" , "pm.logp(rv, x)" )
353
353
rv_out .logcdf = _make_nice_attr_error ("rv.logcdf(x)" , "pm.logcdf(rv, x)" )
354
- rv_out .random = _make_nice_attr_error ("rv.random()" , "rv.eval( )" )
354
+ rv_out .random = _make_nice_attr_error ("rv.random()" , "pm.draw(rv )" )
355
355
return rv_out
356
356
357
357
@@ -488,6 +488,10 @@ def __new__(
488
488
functools .partial (str_for_symbolic_dist , formatting = "latex" ), rv_out
489
489
)
490
490
491
+ rv_out .logp = _make_nice_attr_error ("rv.logp(x)" , "pm.logp(rv, x)" )
492
+ rv_out .logcdf = _make_nice_attr_error ("rv.logcdf(x)" , "pm.logcdf(rv, x)" )
493
+ rv_out .random = _make_nice_attr_error ("rv.random()" , "pm.draw(rv)" )
494
+
491
495
return rv_out
492
496
493
497
@classmethod
@@ -546,10 +550,9 @@ def dist(
546
550
# This is needed for resizing from dims in `__new__`
547
551
rv_out .tag .ndim_supp = ndim_supp
548
552
549
- # TODO: Create new attr error stating that these are not available for DerivedDistribution
550
- # rv_out.logp = _make_nice_attr_error("rv.logp(x)", "pm.logp(rv, x)")
551
- # rv_out.logcdf = _make_nice_attr_error("rv.logcdf(x)", "pm.logcdf(rv, x)")
552
- # rv_out.random = _make_nice_attr_error("rv.random()", "rv.eval()")
553
+ rv_out .logp = _make_nice_attr_error ("rv.logp(x)" , "pm.logp(rv, x)" )
554
+ rv_out .logcdf = _make_nice_attr_error ("rv.logcdf(x)" , "pm.logcdf(rv, x)" )
555
+ rv_out .random = _make_nice_attr_error ("rv.random()" , "pm.draw(rv)" )
553
556
return rv_out
554
557
555
558
0 commit comments