Status: New Owner: ---- Labels: Type-Defect Priority-Medium New issue 1458 by flor...@mickler.org: ValueError: c:\python25\Lib\site-packages\sympy\core\numbers.py:497:function __new__ 1-th argument must be of type (<type 'int'>, <type 'long'>, <type 'str'>, <class 'sympy.core.numbers.Integer'>) but got 1997898322 http://code.google.com/p/sympy/issues/detail?id=1458
hi! i get this output + backtrace which i can't explain: [snip] p1: Point(-57, -16) <class 'sympy.geometry.point.Point'> p2: Point(-57, 85) <class 'sympy.geometry.point.Point'> p1: Point(-57, -16) <class 'sympy.geometry.point.Point'> p2: Point(586, -85) <class 'sympy.geometry.point.Point'> p1: Point(-57, -16) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> p1: Point(586, -85) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> p1: Point(-155, -85) <class 'sympy.geometry.point.Point'> p2: Point(-155, 85) <class 'sympy.geometry.point.Point'> p1: Point(-155, -85) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> p1: Point(-155, 85) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> p1: Point(-57, -16) <class 'sympy.geometry.point.Point'> p2: Point(586, -85) <class 'sympy.geometry.point.Point'> p1: Point(-57, -16) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> p1: Point(586, -85) <class 'sympy.geometry.point.Point'> p2: Point(-155, -3526/643) <class 'sympy.geometry.point.Point'> Traceback (most recent call last): File "szenario1_rueckspiegel.py", line 89, in <module> optimierung.getKonfigurierteSzene() File "D:\mickler\deflecto\_config_mickler\Configurator.py", line 52, in getKonfigurierteSzene self.stelleAnSzeneRum(meineSzene) File "D:\mickler\deflecto\_config_mickler\Configurator.py", line 123, in stelleAnSzeneRum optSolution = scipy.optimize.brute(self.func,ranges=((-1,3),(-1,3)),args=(dieSzene,xCam,yCam,xLcd,yLcd,sLcd)) File "c:\python25\lib\site-packages\scipy\optimize\optimize.py", line 1880, in brute Jout = vecfunc(*grid) File "C:\Python25\lib\site-packages\numpy\lib\function_base.py", line 1886, in __call__ _res = array(self.ufunc(*newargs),copy=False, File "c:\python25\lib\site-packages\scipy\optimize\optimize.py", line 1874, in _scalarfunc return func(params,*args) File "D:\mickler\deflecto\_config_mickler\constrainedConfigurator2.py", line 50, in funktional d = self.analyzer.measureScene(scene) File "D:\mickler\deflecto\_config_mickler\analyzeScene.py", line 449, in measureScene bewertung *= self.bewerter[i].measureScene(scene) File "D:\mickler\deflecto\_config_mickler\analyzeScene.py", line 347, in measureScene Bewertung_Surface = self.bewerteTrefferBild(SurfacePoints,Flaechentreffer) File "D:\mickler\deflecto\_config_mickler\analyzeScene.py", line 311, in bewerteTrefferBild intersections = geo2.intersection(areaSeen,areaLCD) File "c:\python25\lib\site-packages\sympy\geometry\util.py", line 40, in intersection res = GeometryEntity.do_intersection(entities[0], entities[1]) File "c:\python25\Lib\site-packages\sympy\geometry\entity.py", line 37, in do_intersection return e2.intersection(e1) File "c:\python25\lib\site-packages\sympy\geometry\polygon.py", line 146, in intersection inter = GeometryEntity.do_intersection(side, o) File "c:\python25\Lib\site-packages\sympy\geometry\entity.py", line 37, in do_intersection return e2.intersection(e1) File "c:\python25\lib\site-packages\sympy\geometry\polygon.py", line 146, in intersection inter = GeometryEntity.do_intersection(side, o) File "c:\python25\Lib\site-packages\sympy\geometry\entity.py", line 37, in do_intersection return e2.intersection(e1) File "c:\python25\lib\site-packages\sympy\geometry\line.py", line 287, in intersection if (inter in self) and (inter in o): File "c:\python25\lib\site-packages\sympy\geometry\line.py", line 515, in __contains__ if (Point.distance(self.p1,o) <= d) and (Point.distance(self.p2,o) <= d): File "c:\python25\lib\site-packages\sympy\geometry\point.py", line 163, in distance return sqrt( sum([(a-b)**2 for a,b in zip(p1,p2)]) ) File "c:\python25\Lib\site-packages\sympy\core\numbers.py", line 817, in __add__ return Rational.__add__(a, b) # a,b -not- b,a File "c:\python25\lib\site-packages\sympy\core\sympify.py", line 271, in __sympifyit_wrapper return func(a, b) File "c:\python25\Lib\site-packages\sympy\core\numbers.py", line 567, in __add__ return Rational(self.p * other.q + self.q * other.p, self.q * other.q) File "c:\python25\Lib\site-packages\sympy\core\cache.py", line 267, in wrapper new_args = tuple([template.process(a,func,i) for (a, template, i) in zip(args, self.arg_templates, range(len(args)))]) File "c:\python25\Lib\site-packages\sympy\core\cache.py", line 189, in process raise ValueError('%s %s-th argument must be of type %r but got %r' % (func_src, index, self.allowed_types, obj)) ValueError: c:\python25\Lib\site-packages\sympy\core\numbers.py:497:function __new__ 1-th argument must be of type (<type 'int'>, <type 'long'>, <type 'str'>, <class 'sympy.core.numbers.Integer'>) but got 1997898322 > Exit code: 1 i have put this print in the corresponding point.py distance method: (because quite frankly, this is as far as i understand the code in question. from then on, it's a black box for me) @staticmethod def distance(p1, p2): """ Get the Euclidean distance between two points. Example: ======== >>> p1,p2 = Point(1, 1), Point(4, 5) >>> Point.distance(p1, p2) 5 """ print "p1:",p1,type(p1),"p2:",p2,type(p2) return sqrt( sum([(a-b)**2 for a,b in zip(p1,p2)]) ) what is happening in cache.py and numbers.py? do i have to print something else to debug this properly? any help is appreciated. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to sympy-issues@googlegroups.com To unsubscribe from this group, send email to sympy-issues+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en -~----------~----~----~----~------~----~------~--~---