Skip to content

Commit

Permalink
Fix a remaining issue with numpy 2.0 compatibility of the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Jul 17, 2024
1 parent f30cbb6 commit a41e59b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/modules/fluid_properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ to use the `iapws` back end:
>>> nwk.solve("design")
>>> round(tu.eta_s.val, 3)
0.841
np.float64(0.841)
Implementing a custom engine
Expand Down
8 changes: 5 additions & 3 deletions src/tespy/networks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2231,12 +2231,14 @@ def matrix_inversion(self):
if self.use_cuda:
self.increment = cu.asnumpy(cu.dot(
cu.linalg.inv(cu.asarray(self.jacobian)),
-cu.asarray(self.residual)))
-cu.asarray(self.residual)
))
else:
self.increment = np.linalg.inv(
self.jacobian).dot(-self.residual)
self.jacobian
).dot(-self.residual)
self.lin_dep = False
except np.linalg.linalg.LinAlgError:
except np.linalg.LinAlgError:
self.increment = self.residual * 0

def update_variables(self):
Expand Down

0 comments on commit a41e59b

Please sign in to comment.