Skip to content

Commit

Permalink
Improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
marcpaterno committed Aug 2, 2024
1 parent a51b3fc commit e421487
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions firecrown/likelihood/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@
class ConstGaussian(GaussFamily):
"""A Gaussian log-likelihood with a constant covariance matrix."""

def compute_loglike(self, tools: ModelingTools):
"""Compute the log-likelihood."""
def compute_loglike(self, tools: ModelingTools) -> float:
"""Compute the log-likelihood.
:params tools: The modeling tools used to compute the likelihood.
:return: The log-likelihood.
"""
return -0.5 * self.compute_chisq(tools)

def make_realization_vector(self) -> np.ndarray:
"""Create a new realization of the model."""
"""Create a new (randomized) realization of the model.
:return: A new realization of the model
"""
theory_vector = self.get_theory_vector()
assert self.cholesky is not None
new_data_vector = theory_vector + np.dot(
Expand Down

0 comments on commit e421487

Please sign in to comment.