## [PyX-checkins] pyx/pyx/graph data.py,1.26,1.27

 [PyX-checkins] pyx/pyx/graph data.py,1.26,1.27 From: André Wobst - 2004-08-30 15:29:30 ```Update of /cvsroot/pyx/pyx/pyx/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725 Modified Files: data.py Log Message: catch exceptions of mathtree calculations Index: data.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/graph/data.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** data.py 27 Aug 2004 11:37:39 -0000 1.26 --- data.py 30 Aug 2004 15:29:19 -0000 1.27 *************** *** 389,393 **** vars[var] = points[i] # evaluate expression ! newdata[i] = tree.Calc(**vars) # we could also do: # point[newcolumnnumber] = eval(str(tree), vars) --- 389,396 ---- vars[var] = points[i] # evaluate expression ! try: ! newdata[i] = tree.Calc(**vars) ! except (ArithmeticError, ValueError): ! newdata[i] = None # we could also do: # point[newcolumnnumber] = eval(str(tree), vars) *************** *** 659,662 **** self.points[i] = [None]*l for index, mathtree in enumerate(mathtrees): ! self.points[i][index] = mathtree.Calc(**context) --- 662,668 ---- self.points[i] = [None]*l for index, mathtree in enumerate(mathtrees): ! try: ! self.points[i][index] = mathtree.Calc(**context) ! except (ArithmeticError, ValueError): ! self.points[i][index] = None ```

 [PyX-checkins] pyx/pyx/graph data.py,1.26,1.27 From: André Wobst - 2004-08-30 15:29:30 ```Update of /cvsroot/pyx/pyx/pyx/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21725 Modified Files: data.py Log Message: catch exceptions of mathtree calculations Index: data.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/graph/data.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** data.py 27 Aug 2004 11:37:39 -0000 1.26 --- data.py 30 Aug 2004 15:29:19 -0000 1.27 *************** *** 389,393 **** vars[var] = points[i] # evaluate expression ! newdata[i] = tree.Calc(**vars) # we could also do: # point[newcolumnnumber] = eval(str(tree), vars) --- 389,396 ---- vars[var] = points[i] # evaluate expression ! try: ! newdata[i] = tree.Calc(**vars) ! except (ArithmeticError, ValueError): ! newdata[i] = None # we could also do: # point[newcolumnnumber] = eval(str(tree), vars) *************** *** 659,662 **** self.points[i] = [None]*l for index, mathtree in enumerate(mathtrees): ! self.points[i][index] = mathtree.Calc(**context) --- 662,668 ---- self.points[i] = [None]*l for index, mathtree in enumerate(mathtrees): ! try: ! self.points[i][index] = mathtree.Calc(**context) ! except (ArithmeticError, ValueError): ! self.points[i][index] = None ```