Oct-11-2019, 11:07 AM
So, as I was using this loop in two different cases, I could trace the origin of the bug. I finally found that there was a difference in the time execution of the "for loop" if I change the position of the parameters in the definition of the function and use keywords arguments. Here is the old definition of the function:
I am quite surprised by this bug. Do you think that passing the arguments as keywords arguments can change the execution time of the "for loop" ?
def hybrid_dual_resolution(N,Nl,Nhs,Nls,alpha,betaH1,betaH2,betaH3,betaL1,betaL2,betaL3, opt_file_hr,opt_file_lr,loc_radh,loc_radl,upd_a, infl=1.0,rot=False,mp=False,taper='GC',**kwargs):Here is the new definition of the function where I give the arguments as keywords arguments:
def hybrid_dual_resolution(opt_file_hr=None,opt_file_lr=None,upd_a='DEnKF', N=3,Nhs=200,Nl=32,Nls=200,loc_radh=17.7,loc_radl=8.75, alpha=0.04, betaH1=1.,betaH2=0.,betaH3=0., betaL1=0.,betaL2=1.,betaL3=0., taper='GC',infl=1.0, rot=False,mp=False,**kwargs):And now the time of execution of the loop is the same in both cases and close to the minimum time I mentioned in the previous post.
I am quite surprised by this bug. Do you think that passing the arguments as keywords arguments can change the execution time of the "for loop" ?