Replies: 2 comments
-
Could you:
|
Beta Was this translation helpful? Give feedback.
-
Hi @jo11he,
This is correct, after tudat-team/tudat#323 the SPICE error handling options are set by default to throw regular C++/Python exceptions. You could in theory still overwrite this with one of the spice error handling functions, but this is not recommended, as it breaks compatibility with spiceypy and results in possibly undefined behavior. In issue #256 you had the example code spice.get_body_gravitational_parameter("gibberish") which will now throw a
You could simply wrap this in a from tudatpy.exceptions import spice_exceptions
from tudatpy.interface import spice
body_name = "gibberish"
try:
spice.get_body_gravitational_parameter(body_name)
except spice_exceptions.SpiceNOTRANSLATION:
print(f"Body name {body_name} does not exist or cannot be translated to a SPICE code") and implement your own error handling behavior. I agree that the deprecation warning doesn't help in explaining what to do instead, I will update this and give more explicit suggestions! On a side-note, @DominicDirkx I believe we were planning to close this discussion forum (under the tudatpy repo) in favor for the general, organization-level discussion forum, located here: https://github.com/orgs/tudat-team/discussions, correct? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have gotten this deprecation message when running my old scripts:
Deprecation warning: Setting the SPICE error behavior manually is no longer recommended.
It has been superseded by SPICE exceptions, which take care of this automatically.
See tudat-team/tudat#323 for more information.
I read the information on the linked pull request, but it is not clear to me how the user is supposed to interact with the new feature. Does the user have to set any options to control the spice error handling? Or is it just that tudat interfaces with spice errors now and therefore calls to spice can be embedded in try / except structures?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions