Skip to content

Commit

Permalink
Merge pull request #272 from mitchute/fix-numpy-warning
Browse files Browse the repository at this point in the history
Fix Numpy DeprecationWarning: Conversion of an array with ndim > 0 to a scalar
  • Loading branch information
MassimoCimmino authored Apr 22, 2024
2 parents 78fb638 + f1ca7c0 commit a0a82df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 2.3 (in development)

### Bug fixes

* [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.

## Version 2.2.2 (2023-01-09)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion pygfunction/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2259,7 +2259,7 @@ def update_thermal_resistances(self, R_ff, R_fp):
# Outer pipe to borehole wall thermal resistance
R_fg = thermal_resistances(
self.pos, self.r_out[self._iOuter], self.b.r_b, self.k_s, self.k_g,
R_fp, J=self.J)[1][0]
R_fp, J=self.J)[1][0,0]
# Delta-circuit thermal resistances
self._Rd = np.zeros((2*self.nPipes, 2*self.nPipes))
self._Rd[self._iInner, self._iInner] = np.inf
Expand Down

0 comments on commit a0a82df

Please sign in to comment.