Skip to content
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

AttributeError: module 'numpy' has no attribute 'float128' #9

Open
hafez-ahmad opened this issue Sep 22, 2020 · 1 comment
Open

AttributeError: module 'numpy' has no attribute 'float128' #9

hafez-ahmad opened this issue Sep 22, 2020 · 1 comment

Comments

@hafez-ahmad
Copy link

sorry for opening another issue, I am using windows 10 and python 3.8

0% [==========>]100% | Elapsed Time: 0 s | Estimated Time: 0 s | Info: Init time |
0% [==========3]100% | Elapsed Time: 12 s | Estimated Time: 535 s | Info: # of E 2 |

AttributeError Traceback (most recent call last)
in
----> 1 negative_eddies=analyseddyzt(sla,lon,lat,0,1,1,levels,preferences=preferences
2 ,areamap=areamap,areaparms=checkarea,filters=filters
3 ,maskopt='contour',diagnostics=False,pprint=True)

c:\users\hafez\miniconda3\lib\site-packages\trackeddy-0.1-py3.8.egg\trackeddy\tracking.py in analyseddyzt(data, x, y, t0, t1, tstep, levels, areamap, mask, physics, eddycenter, preferences, checkgauss, areaparms, maskopt, mode, filters, timeanalysis, destdir, saveformat, diagnostics, plotdata, pprint, debug)
661 levels_scan = [levellist[ll], np.inf]
662
--> 663 eddies, check, numbereddies = scan_eddym(dataanomaly, x, y, levels_scan, ii
664 , areamap, mask=mask, destdir=destdir
665 , physics=physics, eddycenter=eddycenter, maskopt=maskopt \

c:\users\hafez\miniconda3\lib\site-packages\trackeddy-0.1-py3.8.egg\trackeddy\tracking.py in scan_eddym(data, lon, lat, levels, date, areamap, mask, destdir, physics, eddycenter, maskopt, preferences, mode, basemap, checkgauss, areaparms, usefullfit, diagnostics, plotdata, debug)
299 fixvalues = [lon_contour, lat_contour, extremvalue,
300 center_extrem[0], center_extrem[1]]
--> 301 gausssianfitp, R2 = fit2Dcurve(data_in_contour,
302 fixvalues,
303 level, initial_guess=initial_guess, date='', \

c:\users\hafez\miniconda3\lib\site-packages\trackeddy-0.1-py3.8.egg\trackeddy\geometryfunc.py in fit2Dcurve(var, values, level, initial_guess, date, mode, diagnostics)
520 #print("\n ----Fit----")
521 #pdb.set_trace()
--> 522 res = minimize(gaussian2Dresidual, initial_guess,args=(coords,varm),
523 method='SLSQP',options={'xtol': 1e-12, 'disp': False})
524 fitdict = res.x

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize_minimize.py in minimize(fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options)
623 return _minimize_cobyla(fun, x0, args, constraints, **options)
624 elif meth == 'slsqp':
--> 625 return _minimize_slsqp(fun, x0, args, jac, bounds,
626 constraints, callback=callback, **options)
627 elif meth == 'trust-constr':

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize\slsqp.py in _minimize_slsqp(func, x0, args, jac, bounds, constraints, maxiter, ftol, iprint, disp, eps, callback, finite_diff_rel_step, **unknown_options)
366
367 # ScalarFunction provides function and gradient evaluation
--> 368 sf = _prepare_scalar_function(func, x, jac=jac, args=args, epsilon=eps,
369 finite_diff_rel_step=finite_diff_rel_step,
370 bounds=new_bounds)

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize\optimize.py in _prepare_scalar_function(fun, x0, jac, args, bounds, epsilon, finite_diff_rel_step, hess)
259 # ScalarFunction caches. Reuse of fun(x) during grad
260 # calculation reduces overall function evaluations.
--> 261 sf = ScalarFunction(fun, x0, args, grad, hess,
262 finite_diff_rel_step, bounds, epsilon=epsilon)
263

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize_differentiable_functions.py in init(self, fun, x0, args, grad, hess, finite_diff_rel_step, finite_diff_bounds, epsilon)
74
75 self._update_fun_impl = update_fun
---> 76 self._update_fun()
77
78 # Gradient evaluation

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize_differentiable_functions.py in _update_fun(self)
164 def _update_fun(self):
165 if not self.f_updated:
--> 166 self._update_fun_impl()
167 self.f_updated = True
168

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize_differentiable_functions.py in update_fun()
71
72 def update_fun():
---> 73 self.f = fun_wrapped(self.x)
74
75 self._update_fun_impl = update_fun

c:\users\hafez\miniconda3\lib\site-packages\scipy\optimize_differentiable_functions.py in fun_wrapped(x)
68 def fun_wrapped(x):
69 self.nfev += 1
---> 70 return fun(x, *args)
71
72 def update_fun():

c:\users\hafez\miniconda3\lib\site-packages\trackeddy-0.1-py3.8.egg\trackeddy\geometryfunc.py in gaussian2Dresidual(popt, coords, varm)
459 def gaussian2Dresidual(popt, coords, varm):
460 g=twoD_Gaussian(coords,*popt).reshape(np.shape(varm))
--> 461 residual = np.exp(np.abs(np.float128(np.nanmean(abs(varm - g))))) - 1
462 #print('Residual:',np.nanmean(residual))
463 return residual

c:\users\hafez\miniconda3\lib\site-packages\numpy_init_.py in getattr(attr)
212 return Tester
213 else:
--> 214 raise AttributeError("module {!r} has no attribute "
215 "{!r}".format(name, attr))
216

AttributeError: module 'numpy' has no attribute 'float128'

@josuemtzmo
Copy link
Owner

Thanks for the info, I'm about to recode in a more modular way TrackEddy, so I will shift to float64 then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants