Skip to content

Commit

Permalink
Fixed numpy 2.0 compatibility
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola VIGANO <[email protected]>
  • Loading branch information
Obi-Wan committed Jul 9, 2024
1 parent 58bafc3 commit 5cd8510
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions corrct/regularizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,11 @@ def __init__(
super().__init__(weight=weight, ndims=ndims, upd_mask=upd_mask)

self.pwise_der_norm = pwise_der_norm
if self.pwise_der_norm not in [1, 2, np.Inf]:
if self.pwise_der_norm not in [1, 2, np.inf]:
self._raise_pwise_norm_error()

self.pwise_chan_norm = pwise_chan_norm
if self.pwise_chan_norm not in [1, 2, np.Inf]:
if self.pwise_chan_norm not in [1, 2, np.inf]:
self._raise_pwise_norm_error()

if x_ref is not None:
Expand Down Expand Up @@ -1249,7 +1249,7 @@ def __init__(
normalized: bool = False,
min_approx: bool = True,
pwise_lvl_norm: Union[int, float] = 1,
pwise_chan_norm: Union[int, float] = np.Inf,
pwise_chan_norm: Union[int, float] = np.inf,
x_ref: Optional[NDArray] = None,
):
super().__init__(
Expand All @@ -1265,11 +1265,11 @@ def __init__(
)

self.pwise_lvl_norm = pwise_lvl_norm
if self.pwise_lvl_norm not in [1, 2, np.Inf]:
if self.pwise_lvl_norm not in [1, 2, np.inf]:
self._raise_pwise_norm_error()

self.pwise_chan_norm = pwise_chan_norm
if self.pwise_chan_norm not in [1, 2, np.Inf]:
if self.pwise_chan_norm not in [1, 2, np.inf]:
self._raise_pwise_norm_error()

self.x_ref = x_ref
Expand Down

0 comments on commit 5cd8510

Please sign in to comment.