Skip to content

Commit

Permalink
Merge pull request #288 from MassimoCimmino/maintenance/issue285_nump…
Browse files Browse the repository at this point in the history
…y_v2_0

Maintenance/issue285 numpy v2 0
  • Loading branch information
MassimoCimmino authored Jun 23, 2024
2 parents a1d5b46 + 7cd3582 commit 6b9cede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

* [Issue 255](https://github.com/MassimoCimmino/pygfunction/issues/255) - Default to an `orientation` of `0.` when `tilt` is `0.` in `boreholes.Borehole` class.
* [Issue 274](https://github.com/MassimoCimmino/pygfunction/issues/274) - Fixed scalar assignment from ndim-1 array. It is deprecated as of `numpy` version `1.25`. Only ndim-0 arrays can be treated as scalars.
* [Issue 285](https://github.com/MassimoCimmino/pygfunction/issues/285) - Use `numpy.complex128` instead of `numpy.cfloat`. This is to comply with backward-incompatible changes introduced in `numpy` version `2.0`.

## Version 2.2.2 (2023-01-09)

Expand Down
4 changes: 2 additions & 2 deletions pygfunction/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3056,7 +3056,7 @@ def multipole(pos, r_out, r_b, k_s, k_g, R_fp, T_b, q_p, J,
# Multipoles (EQ. 38)
# -------------------
if J > 0:
P = np.zeros((n_p, J), dtype=np.cfloat)
P = np.zeros((n_p, J), dtype=np.complex128)
coeff = -np.array([[(1 - (k+1)*beta_m)/(1 + (k+1)*beta_m)
for k in range(J)] for beta_m in beta_p])
while eps_max > eps and it < it_max:
Expand Down Expand Up @@ -3161,7 +3161,7 @@ def _F_mk(q_p, P, n_p, J, r_b, r_out, z, pikg, sigma):
Matrix F_mk from Claesson and Hellstrom (2011), EQ. 34.
"""
F = np.zeros((n_p, J), dtype=np.cfloat)
F = np.zeros((n_p, J), dtype=np.complex128)
dz = np.add.outer(z, -z) + np.eye(n_p)
zz = np.multiply.outer(z, np.conj(z))
for k in range(J):
Expand Down

0 comments on commit 6b9cede

Please sign in to comment.