From 49300a8f68b6a6836ba0d0594991a516a812692f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1cio=20Moreira=20de=20Souza?= <74324577+dacioms@users.noreply.github.com> Date: Thu, 11 Jul 2024 17:19:08 -0300 Subject: [PATCH] Numpy depreciate namespace np.NaN replaced by np.nan --- CoolPlot/Plot/Common.py | 14 +++++++------- CoolPlot/Plot/SimpleCycles.py | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CoolPlot/Plot/Common.py b/CoolPlot/Plot/Common.py index c971eac..6a336e0 100644 --- a/CoolPlot/Plot/Common.py +++ b/CoolPlot/Plot/Common.py @@ -277,8 +277,8 @@ def calc_sat_range(self, Trange=None, Prange=None, num=200): warnings.warn( "An error occurred for the critical inputs, skipping it.", UserWarning) - xcrit = np.NaN - ycrit = np.NaN + xcrit = np.nan + ycrit = np.nan X = np.empty_like(one) Y = np.empty_like(one) @@ -302,8 +302,8 @@ def calc_sat_range(self, Trange=None, Prange=None, num=200): warnings.warn( "An error occurred for inputs {0:f}, {1:f} with index {2:s}: {3:s}".format(one[index], two[index], str(index), str(e)), UserWarning) - X[index] = np.NaN - Y[index] = np.NaN + X[index] = np.nan + Y[index] = np.nan err = True self.x = X; self.y = Y return @@ -361,9 +361,9 @@ def calc_range(self, xvals=None, yvals=None): warnings.warn( "An error occurred for inputs {0:f}, {1:f} with index {2:s}: {3:s}".format(vals[0][index], vals[1][index], str(index), str(e)), UserWarning) - vals[2][index] = np.NaN - guesses.rhomolar = np.NaN - guesses.T = np.NaN + vals[2][index] = np.nan + guesses.rhomolar = np.nan + guesses.T = np.nan err = True for i, v in enumerate(idxs): diff --git a/CoolPlot/Plot/SimpleCycles.py b/CoolPlot/Plot/SimpleCycles.py index ecd4d58..4482356 100644 --- a/CoolPlot/Plot/SimpleCycles.py +++ b/CoolPlot/Plot/SimpleCycles.py @@ -75,8 +75,8 @@ def TwoStage(Ref, Q, Te, Tc, DTsh, DTsc, eta_oi, f_p, Tsat_ic, DTsh_ic, Ts_Ph='P p = np.zeros_like(T) s = np.zeros_like(T) rho = np.zeros_like(T) - T[0] = np.NAN - s[0] = np.NAN + T[0] = np.nan + s[0] = np.nan T[1] = Te + DTsh pe = PropsSI('P', 'T', Te, 'Q', 1.0, Ref) pc = PropsSI('P', 'T', Tc, 'Q', 1.0, Ref) @@ -219,8 +219,8 @@ def EconomizedCycle(Ref, Qin, Te, Tc, DTsh, DTsc, eta_oi, f_p, Ti, Ts_Ph='Ts', s s = np.zeros_like(T) rho = np.zeros_like(T) - T[0] = np.NAN - s[0] = np.NAN + T[0] = np.nan + s[0] = np.nan T[1] = Te + DTsh pe = PropsSI('P', 'T', Te, 'Q', 1.0, Ref) pc = PropsSI('P', 'T', Tc, 'Q', 1.0, Ref)