Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix on Powerlaw prior class #47

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/jimgw/prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import jax.numpy as jnp
from flowMC.nfmodel.base import Distribution
from jaxtyping import Array, Float
from typing import Callable
from typing import Callable, Union
from dataclasses import field


Expand Down Expand Up @@ -352,16 +352,16 @@ def __init__(
self,
xmin: float,
xmax: float,
alpha: float,
alpha: Union[int, float],
naming: list[str],
transforms: dict[tuple[str, Callable]] = {},
):
super().__init__(naming, transforms)
assert isinstance(xmin, float), "xmin must be a float"
assert isinstance(xmax, float), "xmax must be a float"
assert isinstance(alpha, (float)), "alpha must be a float"
assert isinstance(alpha, (int, float)), "alpha must be a int or a float"
if alpha < 0.0:
assert alpha < 0.0 or xmin > 0.0, "With negative alpha, xmin must > 0"
assert xmin > 0.0, "With negative alpha, xmin must > 0"
assert self.n_dim == 1, "Powerlaw needs to be 1D distributions"
self.xmax = xmax
self.xmin = xmin
Expand Down
Loading