Skip to content

Commit

Permalink
temporary require Numpy < 2.0 (#1420)
Browse files Browse the repository at this point in the history
* Currently require numpy < 2.0, till other packages updated their wheels/compatibility
* Used ruff code check to ensure own compatibility
  • Loading branch information
PaulJonasJost authored Jun 26, 2024
1 parent 825550a commit 1a3123d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pypesto/history/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
trace = pd.read_csv(self.file, header=[0, 1], index_col=0)
# replace 'nan' in cols with np.NAN
cols = pd.DataFrame(trace.columns.to_list())
cols[cols == "nan"] = np.NaN
cols[cols == "nan"] = np.nan
trace.columns = pd.MultiIndex.from_tuples(
cols.to_records(index=False).tolist()
)
Expand All @@ -78,11 +78,11 @@ def __init__(
self._update_counts_from_trace()

def _update_counts_from_trace(self) -> None:
self._n_fval = self._trace[(N_FVAL, np.NaN)].max()
self._n_grad = self._trace[(N_GRAD, np.NaN)].max()
self._n_hess = self._trace[(N_HESS, np.NaN)].max()
self._n_res = self._trace[(N_RES, np.NaN)].max()
self._n_sres = self._trace[(N_SRES, np.NaN)].max()
self._n_fval = self._trace[(N_FVAL, np.nan)].max()
self._n_grad = self._trace[(N_GRAD, np.nan)].max()
self._n_hess = self._trace[(N_HESS, np.nan)].max()
self._n_res = self._trace[(N_RES, np.nan)].max()
self._n_sres = self._trace[(N_SRES, np.nan)].max()

def update(
self,
Expand Down
2 changes: 1 addition & 1 deletion pypesto/visualize/optimizer_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def optimizer_convergence(
2,
)
if grad is not None
else np.NaN
else np.nan
)
for grad in result.optimize_result.grad
]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ keywords =

[options]
install_requires =
numpy >= 1.19.1, != 1.24.0
numpy >= 1.19.1, != 1.24.0, < 2.0
scipy >= 1.5.2
pandas >= 1.5.0
cloudpickle >= 1.5.0
Expand Down

0 comments on commit 1a3123d

Please sign in to comment.