File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -1570,21 +1570,35 @@ def __getitem__(self, key):
1570
1570
1571
1571
def __contains__ (self , key ):
1572
1572
return key in self .named_vars or self .name_for (key ) in self .named_vars
1573
-
1573
+
1574
1574
def __copy__ (self ):
1575
+ """
1576
+ Clone a pymc model by overiding the python copy method using the clone_model method from fgraph.
1577
+ if guassian process variables are detected then an exception will be raised.
1578
+ """
1575
1579
from pymc .model .fgraph import clone_model
1576
- check_for_gp_vars = [k for x in ['_rotated_' , '_hsgp_coeffs_' ] for k in self .named_vars .keys () if x in k ]
1580
+
1581
+ check_for_gp_vars = [
1582
+ k for x in ["_rotated_" , "_hsgp_coeffs_" ] for k in self .named_vars .keys () if x in k
1583
+ ]
1577
1584
if len (check_for_gp_vars ) > 0 :
1578
1585
raise Exception ("Unable to clone Gaussian Process Variables" )
1579
-
1586
+
1580
1587
return clone_model (self )
1581
-
1588
+
1582
1589
def __deepcopy__ (self , _ ):
1590
+ """
1591
+ Clone a pymc model by overiding the python copy method using the clone_model method from fgraph.
1592
+ if guassian process variables are detected then an exception will be raised.
1593
+ """
1583
1594
from pymc .model .fgraph import clone_model
1584
- check_for_gp_vars = [k for x in ['_rotated_' , '_hsgp_coeffs_' ] for k in self .named_vars .keys () if x in k ]
1595
+
1596
+ check_for_gp_vars = [
1597
+ k for x in ["_rotated_" , "_hsgp_coeffs_" ] for k in self .named_vars .keys () if x in k
1598
+ ]
1585
1599
if len (check_for_gp_vars ) > 0 :
1586
1600
raise Exception ("Unable to clone Gaussian Process Variables" )
1587
-
1601
+
1588
1602
return clone_model (self )
1589
1603
1590
1604
def replace_rvs_by_values (
You can’t perform that action at this time.
0 commit comments