Skip to content

Remove unnecessary semicolons at end of Python statements #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OceanLab/dyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def eqmodes(N2,z,nm,lat,pmodes=False):
# F_j(z)=-g.he_j d/dzS_j
#
####
if pmodes==True:
if pmodes:
Fi=np.zeros(Si.shape)
for i in np.arange(nm):
Fi[1:-1,i] =\
Expand Down
7 changes: 4 additions & 3 deletions OceanLab/eof.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def eoft(trmat,nm=None):
amp = np.dot(evecs_norm.T,trmat)

#if was chosen a number of eigenvectors
if nm!=None:
if nm is not None:
evecs_norm = evecs_norm[:,:nm]
evals_perc = evals_perc[:nm]
amp = amp[:nm,:]
Expand Down Expand Up @@ -117,7 +117,7 @@ def my_eof_interp(M,nmodes,errmin=1e-15,repmax=None):
print(err)
if err < errmin:
break
if repmax!=None:
if repmax is not None:
if rep>=repmax:
break
rep += 1
Expand Down Expand Up @@ -188,7 +188,8 @@ def ceof(lon, lat, data, nkp = 10, parallel = True):
print('3: Solving the eigenvalue problem')
lamda, loadings = delayed(la.eig)(c).compute() # lamda: eigenvalue, loadings: eigenvectors

l = lamda.conjugate().T; k = np.argsort(l)
l = lamda.conjugate().T
k = np.argsort(l)
lamda, loadings = np.flip(l[k]), np.fliplr(loadings[:,k])
loadings = loadings[:,:nkp]
# In case there were nan values in the orginal data, we need to perform the approach below:
Expand Down
10 changes: 5 additions & 5 deletions OceanLab/oa.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ def vectoa(Xg,Yg,X,Y,U,V,corrlenx,corrleny,err,b=0):
tc = np.array(tc)
tc.shape = ppc[0].shape
d2=((np.tile(xc,(n,1)).T-np.tile(x,(nv,1)))**2+(np.tile(yc,(n,1)).T-np.tile(y,(nv,1)))**2)
R=np.exp(-lambd*d2)+bmo;
R=np.exp(-lambd*d2)+bmo

P=np.zeros((nv,2*n))
# streamfunction-velocity covariance
P[:,0:n]=np.sin(tc)*np.sqrt(d2)*R;
P[:,n:2*n]=-np.cos(tc)*np.sqrt(d2)*R;
P[:,0:n]=np.sin(tc)*np.sqrt(d2)*R
P[:,n:2*n]=-np.cos(tc)*np.sqrt(d2)*R

PSI=np.dot(P,np.linalg.solve(A,uv)) # solvi the linear system
PSI=PSI.reshape(nv2,nv1).T
Expand Down Expand Up @@ -163,7 +163,7 @@ def scaloa(xc, yc, x, y, t=[], corrlenx=None,corrleny=None, err=None, zc=None):
# Gauss-Markov to get the weights that minimize the variance (OI).
tp = None
ep = 1 - np.sum(C.T * np.linalg.solve(A, C.T), axis=0) / (1 - err)
if any(t)==True: ##### was t!=None:
if any(t): ##### was t!=None:
t = np.reshape(t, (n, 1))
tp = np.dot(C, np.linalg.solve(A, t))
#if 0: # NOTE: `scaloa2.m`
Expand All @@ -174,7 +174,7 @@ def scaloa(xc, yc, x, y, t=[], corrlenx=None,corrleny=None, err=None, zc=None):
# tp = tp + mD * np.ones(tp.shape)
return tp, ep

if any(t)==False: ##### was t==None:
if not any(t): ##### was t==None:
print("Computing just the interpolation errors.")
#Normalized mean error. Taking the squared root you can get the
#interpolation error in percentage.
Expand Down
3 changes: 1 addition & 2 deletions OceanLab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import scipy.signal as sg
import xarray as xr

import dask
from dask.distributed import Client, progress
from dask.distributed import Client

##### User functions
#=============================================================================
Expand Down