Skip to content

Commit

Permalink
fix for scipy 1.11.1 (#272)
Browse files Browse the repository at this point in the history
* fix for scipy 1.11.1

* change test trunctatednormal
  • Loading branch information
aloctavodia authored Aug 11, 2023
1 parent d887033 commit 01986c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ disable=missing-docstring,
too-many-statements,
too-few-public-methods,
import-error,
protected-access
protected-access,
no-self-use


# Enable the message, report, category or checker with the given id(s). You can
Expand Down
2 changes: 1 addition & 1 deletion preliz/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def support(self, *args, **kwds): # pylint: disable=unused-argument

def cdf(self, x, *args, **kwds): # pylint: disable=unused-argument
x = np.asarray(x)
return 1 - self.q ** ((x + 1) ** self.beta)
return np.nan_to_num(1 - self.q ** ((x + 1) ** self.beta))

def pmf(self, x, *args, **kwds): # pylint: disable=unused-argument
x = np.asarray(x)
Expand Down
4 changes: 3 additions & 1 deletion preliz/tests/test_maxent.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@
(-0.807, 6.428),
(-0.807, 6.428),
),
(TruncatedNormal(), -1, 1, 0.683, (-np.inf, np.inf), (0, 1)),
# This fails with scipy 1.11.1 if lower or upper are inf
# setting to "large" number for now
(TruncatedNormal(lower=-100, upper=100), -1, 1, 0.683, (-100, 100), (0, 1)),
(
TruncatedNormal(lower=-3, upper=2),
-1,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies = [
"arviz",
"matplotlib>=3.5",
"numpy>=1.22",
"scipy>=1.9.1,<1.11.0",
"scipy>=1.9.1",
]

[tool.flit.module]
Expand Down

0 comments on commit 01986c0

Please sign in to comment.