From 74f720574b710f1609b263bd0e16c0a744a2b632 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 13 Feb 2024 16:22:34 -0700 Subject: [PATCH 1/3] addresses numpy warning converting array to scalar --- pygfunction/pipes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygfunction/pipes.py b/pygfunction/pipes.py index d02e70ac..9527b813 100644 --- a/pygfunction/pipes.py +++ b/pygfunction/pipes.py @@ -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 From 0d6e429d003cbf96f613aa83821f6d286af5afa2 Mon Sep 17 00:00:00 2001 From: Massimo Cimmino Date: Mon, 22 Apr 2024 10:28:31 -0400 Subject: [PATCH 2/3] Extract first element of the 2d array --- pygfunction/pipes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygfunction/pipes.py b/pygfunction/pipes.py index 9527b813..a89f970f 100644 --- a/pygfunction/pipes.py +++ b/pygfunction/pipes.py @@ -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][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 From f1ca7c0647003064e311b4cfdf8c854188c3940a Mon Sep 17 00:00:00 2001 From: Massimo Cimmino Date: Mon, 22 Apr 2024 11:28:03 -0400 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59610ae8..e8e778e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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