File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -559,6 +559,7 @@ def __init__(
559
559
560
560
@property
561
561
def model (self ):
562
+ warnings .warn ("Model.model property is deprecated. Just use Model." , FutureWarning )
562
563
return self
563
564
564
565
@property
@@ -629,7 +630,7 @@ def compile_logp(
629
630
Whether to sum all logp terms or return elemwise logp for each variable.
630
631
Defaults to True.
631
632
"""
632
- return self .model . compile_fn (self .logp (vars = vars , jacobian = jacobian , sum = sum ))
633
+ return self .compile_fn (self .logp (vars = vars , jacobian = jacobian , sum = sum ))
633
634
634
635
def compile_dlogp (
635
636
self ,
@@ -646,7 +647,7 @@ def compile_dlogp(
646
647
jacobian:
647
648
Whether to include jacobian terms in logprob graph. Defaults to True.
648
649
"""
649
- return self .model . compile_fn (self .dlogp (vars = vars , jacobian = jacobian ))
650
+ return self .compile_fn (self .dlogp (vars = vars , jacobian = jacobian ))
650
651
651
652
def compile_d2logp (
652
653
self ,
@@ -663,7 +664,7 @@ def compile_d2logp(
663
664
jacobian:
664
665
Whether to include jacobian terms in logprob graph. Defaults to True.
665
666
"""
666
- return self .model . compile_fn (self .d2logp (vars = vars , jacobian = jacobian ))
667
+ return self .compile_fn (self .d2logp (vars = vars , jacobian = jacobian ))
667
668
668
669
def logp (
669
670
self ,
Original file line number Diff line number Diff line change @@ -1107,6 +1107,13 @@ def test_model_pytensor_config():
1107
1107
assert pytensor .config .mode != "JAX"
1108
1108
1109
1109
1110
+ def test_deprecated_model_property ():
1111
+ m = pm .Model ()
1112
+ with pytest .warns (FutureWarning , match = "Model.model property is deprecated" ):
1113
+ m_property = m .model
1114
+ assert m is m_property
1115
+
1116
+
1110
1117
def test_model_parent_set_programmatically ():
1111
1118
with pm .Model () as model :
1112
1119
x = pm .Normal ("x" )
You can’t perform that action at this time.
0 commit comments