Skip to content

Commit

Permalink
Documented get_log_normal
Browse files Browse the repository at this point in the history
Added documentation for `gempyor.utils.get_log_normal` including adding
appropriate type hints.
  • Loading branch information
TimothyWillard committed Jul 5, 2024
1 parent 2aaa6fb commit c09b953
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions flepimop/gempyor_pkg/src/gempyor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,23 @@ def get_truncated_normal(
return scipy.stats.truncnorm(lower, upper, loc=mean, scale=sd)


def get_log_normal(meanlog, sdlog):
"Returns the log normal distribution"
def get_log_normal(
meanlog: float | int,
sdlog: float | int,
) -> scipy.stats._distn_infrastructure.rv_frozen:
"""Returns a log normal distribution.
This function constructs a log normal distribution with the specified
log mean and log standard deviation.
Args:
meanlog: The log of the mean of the log normal distribution.
sdlog: The log of the standard deviation of the log normal distribution.
Returns:
rv_frozen: A frozen instance of the log normal distribution with the
specified parameters.
"""
return scipy.stats.lognorm(s=sdlog, scale=np.exp(meanlog), loc=0)


Expand Down

0 comments on commit c09b953

Please sign in to comment.