Setting Step Handlers in 11.0.2 - setStepHandler method not exposed

I am currently in the process of updating my orekit lib from 10.3 to 11.0.2, and I keep running into errors when it comes to the new way of setting step handlers.

When I dug a little deeper, the error I kept getting was that none of my propagators had the attribute setStepHandler - for example:

AttributeError: 'TLEPropagator' object has no attribute 'setStepHandler'

The same was true for the NumericalPropagator. Doing a python print(dir(propagator)) showed that they did not have clearStepHandlers or setStepHandlers that should come from the org.orekit.propagation.Propagator class.

Funny enough, the Propagators parallelizer function still works fine, but its method for adding step handlers is different, so that is likely why.

Is there some additional step I have missed in setting up propagators in the new version, or is this just my install having this problem?

Tagging @petrus.hyvonen in case there’s anything to do with the wrapper



This is likely an example of where one needs to cast the propagator to get the right interface, this is one of the weaknesses of the Python wrapped objects that all parents may not be visible directly. The casting to indicate which interface to access is done with the cast_ method.

Try to use Propagator.cast_(propagator)


Ah perfect, thanks Petrus!