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
Comet with eccentricity close to 1.0 causing a warning #239
Comments
Searching for the words "Near-parabolic" in this repository will get you close—to within a page or two of the error message. But to search for the error message itself, ask GitHub for the phrase Line 180 in 7cd1754
Alas, I guess that GitHub search doesn't understand that It is indeed a bit awkward that the underlying C code is talking directly to the user rather than raising the issue where Python can see it. Let's trace: after printing the message, Line 351 in 2b695de
It looks like it's setting a flag I've never heard of. Let's look for its definition. Here it is:
Well, then. I wonder if PyEphem should be checking that flag every time it calls |
@Bernmeister — As you'll see in the commit shown just above, I have removed the old printed warning from the underlying C library, and have instead added detection of the error flag and raised an exception for this circumstance. If you get the chance to try it out with a local install of the development version, I'll be interested to hear whether the change fixes things on your end too! To install the development version of this project, run:
|
Ran the test script and got:
Winner winner, chicken dinner! Thank you @brandon-rhodes One point: Running |
When running this test code:
I get the following warning:
I searched for the warning text on both the
PyEphem
andXEphem
sites but no such luck (I also added searching.h
files to no avail.In the data line,
e = 0.999725
, the eccentricity, is very close to1.0
. From the conversion tool, line83
, the eccentricity should bep
for parabolic, note
for elliptical, but that's a data issue, which is ultimately and, correctly I presume, tripping the warning.Now that I know the warning exists, I can preemptively do something like:
Is it possible to catch this warning?
The text was updated successfully, but these errors were encountered: