Skip to content

Commit

Permalink
Minor fix on Powerlaw prior class
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunhopang committed Dec 5, 2023
1 parent 151c219 commit 231a6ce
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 231a6ce

Please sign in to comment.