From 4dcf793161e878aee1330545f77b083e809aed65 Mon Sep 17 00:00:00 2001 From: "david.standingford" Date: Thu, 19 Jan 2023 17:01:39 +0000 Subject: [PATCH 1/3] Replaced np.float with float --- pyKriging/coKriging.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyKriging/coKriging.py b/pyKriging/coKriging.py index 3f98506..f4120bd 100644 --- a/pyKriging/coKriging.py +++ b/pyKriging/coKriging.py @@ -111,9 +111,9 @@ def distanceXcXe(self): def updatePsi(self): - self.PsicXc = np.zeros((self.nc,self.nc), dtype=np.float) - self.PsicXe = np.zeros((self.ne,self.ne), dtype=np.float) - self.PsicXcXe = np.zeros((self.nc,self.ne), dtype=np.float) + self.PsicXc = np.zeros((self.nc,self.nc), dtype=float) + self.PsicXe = np.zeros((self.ne,self.ne), dtype=float) + self.PsicXcXe = np.zeros((self.nc,self.ne), dtype=float) # # print self.thetac # print self.pc From 110dad585c2e2fa0e0e6e113341d69edeb3e9284 Mon Sep 17 00:00:00 2001 From: "david.standingford" Date: Thu, 19 Jan 2023 17:02:32 +0000 Subject: [PATCH 2/3] Replaced indeterminate if ... elif with if ... else --- pyKriging/krige.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyKriging/krige.py b/pyKriging/krige.py index ead9883..079da05 100644 --- a/pyKriging/krige.py +++ b/pyKriging/krige.py @@ -208,7 +208,7 @@ def expimp(self, x): y_min = np.min(self.y) if S <= 0.: EI = 0. - elif S > 0.: + else: EI_one = ((y_min - self.predict_normalized(x)) * (0.5 + 0.5*m.erf(( 1./np.sqrt(2.))*((y_min - self.predict_normalized(x)) / S)))) @@ -223,7 +223,7 @@ def weightedexpimp(self, x, w): y_min = np.min(self.y) if S <= 0.: EI = 0. - elif S > 0.: + else: EI_one = w*((y_min - self.predict_normalized(x)) * (0.5 + 0.5*m.erf((1./np.sqrt(2.))*((y_min - self.predict_normalized(x)) / S)))) From 5ed30de9d9b3bae955cfcc818df23e81feeb3c1a Mon Sep 17 00:00:00 2001 From: "david.standingford" Date: Thu, 19 Jan 2023 17:04:02 +0000 Subject: [PATCH 3/3] Replaced numpy.float with float --- pyKriging/matrixops.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyKriging/matrixops.py b/pyKriging/matrixops.py index 2cdb5c4..df75258 100644 --- a/pyKriging/matrixops.py +++ b/pyKriging/matrixops.py @@ -6,7 +6,7 @@ class matrixops(): def __init__(self): self.LnDetPsi = None - self.Psi = np.zeros((self.n,self.n), dtype=np.float) + self.Psi = np.zeros((self.n,self.n), dtype=float) self.psi = np.zeros((self.n,1)) self.one = np.ones(self.n) self.mu = None @@ -22,7 +22,7 @@ def updateData(self): self.distance[i,j]= np.abs((self.X[i]-self.X[j])) def updatePsi(self): - self.Psi = np.zeros((self.n,self.n), dtype=np.float) + self.Psi = np.zeros((self.n,self.n), dtype=float) self.one = np.ones(self.n) self.psi = np.zeros((self.n,1)) newPsi = np.exp(-np.sum(self.theta*np.power(self.distance,self.pl), axis=2)) @@ -32,7 +32,7 @@ def updatePsi(self): self.U = self.U.T def regupdatePsi(self): - self.Psi = np.zeros((self.n,self.n), dtype=np.float) + self.Psi = np.zeros((self.n,self.n), dtype=float) self.one = np.ones(self.n) self.psi = np.zeros((self.n,1)) newPsi = np.exp(-np.sum(self.theta*np.power(self.distance,self.pl), axis=2)) @@ -107,4 +107,4 @@ def regression_predicterr_normalized(self,x): pass SSqr = np.abs(SSqr[0]) - return np.power(SSqr,0.5)[0] \ No newline at end of file + return np.power(SSqr,0.5)[0]