Serialization: Add docstrings

This commit is contained in:
Moreno 2018-06-07 09:52:13 +01:00
parent 7b2af57aee
commit 11aa6ea27b
24 changed files with 393 additions and 69 deletions

View file

@ -30,7 +30,15 @@ class Bernoulli(Likelihood):
self.log_concave = True
def to_dict(self):
input_dict = super(Bernoulli, self)._to_dict()
"""
Convert the object into a json serializable dictionary.
Note: It uses the private method _save_to_input_dict of the parent.
:return dict: json serializable dictionary containing the needed information to instantiate the object
"""
input_dict = super(Bernoulli, self)._save_to_input_dict()
input_dict["class"] = "GPy.likelihoods.Bernoulli"
return input_dict