Skip to content

Commit 231a6ce

Browse files
committed
Minor fix on Powerlaw prior class
1 parent 151c219 commit 231a6ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/jimgw/prior.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import jax.numpy as jnp
33
from flowMC.nfmodel.base import Distribution
44
from jaxtyping import Array, Float
5-
from typing import Callable
5+
from typing import Callable, Union
66
from dataclasses import field
77

88

@@ -352,16 +352,16 @@ def __init__(
352352
self,
353353
xmin: float,
354354
xmax: float,
355-
alpha: float,
355+
alpha: Union[int, float],
356356
naming: list[str],
357357
transforms: dict[tuple[str, Callable]] = {},
358358
):
359359
super().__init__(naming, transforms)
360360
assert isinstance(xmin, float), "xmin must be a float"
361361
assert isinstance(xmax, float), "xmax must be a float"
362-
assert isinstance(alpha, (float)), "alpha must be a float"
362+
assert isinstance(alpha, (int, float)), "alpha must be a int or a float"
363363
if alpha < 0.0:
364-
assert alpha < 0.0 or xmin > 0.0, "With negative alpha, xmin must > 0"
364+
assert xmin > 0.0, "With negative alpha, xmin must > 0"
365365
assert self.n_dim == 1, "Powerlaw needs to be 1D distributions"
366366
self.xmax = xmax
367367
self.xmin = xmin

0 commit comments

Comments
 (0)