Hi Tom,

On 10.09.06, Tom Bridgman wrote:
> Opps!  I found some older code where x-axis errors are plotted with no  
> problem.
> 
> The issue is probably a bad data point in my dx calculation (as it runs  
> fine without the error bars).   Unfortunately, the program runs to  
> completion and I don't see indication of an error until the eps or PDF  
> file fails to load.  I'll need to check each point.

Too bad. Can you give us an example showing where PyX accepts
everything but the result is broken PostScript and/or PDF?

> Is there a flag that can activate more robust checking in the data side  
> of the plotting process or is there another clever solution to catch  
> these before the file is written?

Originally the idea is that PyX checks everything in form of catching
the proper exceptions. It does all the math for the graph that way,
that "broken" data points are ignored. For example if you have some
data, which is not a float, the data reader keeps it as a string. If
you do some math with it, the exceptions raised by Python are catched
and the data point is omitted. So far so good ... it's the best we can
do without loosing too much performance. In most cases, this works
well for say negative values on a logarithmic axes or for marking bad
data points by "*" or similar. But for floats it depends on how your
floating point unit handles such cases. This is highly plattform
dependend (and sometimes even configurable). Python itself does
different things on different plattforms (and it's a known "feature"
... the issue has been discussed by the python folks again and again).
Try math.sqrt(-1) on an Linux/ia32 and OSX/PPC. IIRC in one case you
get an exceptions and in the other an NaN float value *but* no
exception.

Now the problem is, that when no exception is raised but NaN or
+Inf/-Inf occur as floating point values, those values might
eventually be written to the final output. This does not only happen
in the graph module, but for paths etc. as well. Its not clear how to
properly fix that (i.e. in a plattform independend manner and without
much overhead in time).

This is open for discussion. It's a todo item in our CHANGES file for
ages. I would be interested in your case in order to understand
whether we can at least improve the situation somehow. Unfortunately
my knowledge in this area is quite limited. It might be (I even expect
so since I guess quite some subscribers of this list are doing math in
Python) that somebody on this list might know how to deal/improve the
situation ...


André

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to