Skip to content

Commit fe4e0c5

Browse files
committed
added docs to methods
1 parent b34742d commit fe4e0c5

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

pymc/model/core.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,21 +1570,35 @@ def __getitem__(self, key):
15701570

15711571
def __contains__(self, key):
15721572
return key in self.named_vars or self.name_for(key) in self.named_vars
1573-
1573+
15741574
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+
"""
15751579
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+
]
15771584
if len(check_for_gp_vars) > 0:
15781585
raise Exception("Unable to clone Gaussian Process Variables")
1579-
1586+
15801587
return clone_model(self)
1581-
1588+
15821589
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+
"""
15831594
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+
]
15851599
if len(check_for_gp_vars) > 0:
15861600
raise Exception("Unable to clone Gaussian Process Variables")
1587-
1601+
15881602
return clone_model(self)
15891603

15901604
def replace_rvs_by_values(

0 commit comments

Comments
 (0)