From a172809784d8fe8dda7945eb1009ea1130ac3e9d Mon Sep 17 00:00:00 2001 From: Stephen Roberts Date: Fri, 5 Jun 2026 21:53:12 +1000 Subject: [PATCH] Replace removed np.bool8 alias with np.bool_ for NumPy 2.x np.bool8 was removed in NumPy 2.0, so SuperLink.reposition_junctions() (nsuperlink.py) and QualityBuilder construction (nquality.py) raise AttributeError under NumPy >= 2.0. Use np.bool_, matching the alias already used elsewhere in the codebase (e.g. superlink.py). Co-Authored-By: Claude Opus 4.8 --- pipedream_solver/nquality.py | 2 +- pipedream_solver/nsuperlink.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipedream_solver/nquality.py b/pipedream_solver/nquality.py index 0818254..c68bde0 100644 --- a/pipedream_solver/nquality.py +++ b/pipedream_solver/nquality.py @@ -101,7 +101,7 @@ def __init__(self, hydraulics, superjunction_params, superlink_params, self._kI = self.hydraulics._kI self._K_j = superjunction_params['K'].values.astype(np.float64) self._c_j = superjunction_params['c_0'].values.astype(np.float64) - self.bc = superjunction_params['bc'].values.astype(np.bool8) + self.bc = superjunction_params['bc'].values.astype(np.bool_) if junction_params is not None: self._K_Ik = junction_params['K'].values.astype(np.float64) self._c_Ik = junction_params['c_0'].values.astype(np.float64) diff --git a/pipedream_solver/nsuperlink.py b/pipedream_solver/nsuperlink.py index 107355e..829d03f 100644 --- a/pipedream_solver/nsuperlink.py +++ b/pipedream_solver/nsuperlink.py @@ -1679,7 +1679,7 @@ def reposition_junctions(self, reposition=None): _H_dk = H_j[_J_dk] # Handle which superlinks to reposition if reposition is None: - reposition = np.ones(NK, dtype=np.bool8) + reposition = np.ones(NK, dtype=np.bool_) # Reposition junctions numba_reposition_junctions(_x_Ik, _z_inv_Ik, _h_Ik, _dx_ik, _Q_ik, _H_dk, _b0, _zc, _xc, _m, _elem_pos, _i_1k, _I_1k,