Using PythonEnablingPredicate for EventEnablingPredicateFilter

Dear community,

I am struggling to import PythonEnablingPredicate.
When I do the following, an error pops up as follows.

from org.orekit.propagation.events import EventEnablingPredicateFilter, PythonEnablingPredicate
java.lang.java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: org.orekit.propagation.events.PythonEnablingPredicate

I have looked through Orekit/src/main/java/org/orekit/propagation/events at develop · CS-SI/Orekit · GitHub and seems there is no class called PythonEnablingPredicate.

I have downloaded “orekit-jpype==13.0.2.0”.

Can I have a guide on how to enable using PythonEnablingPredicate?

Sincerely,

Hi,
You are using the new jpype Python wrapper instead of the legacy JCC Python wrapper. In the jpype wrapper, the interfaces work differently, please check out the documentation: Files · master · Orekit / orekit_jpype · GitLab

Your code should look something like:

from jpype import JImplements, JOverride
from org.orekit.propagation.events import EventEnablingPredicateFilter, EnablingPredicate

@JImplements(EnablingPredicate)
class MyCustomEnablingPredicate:
    @JOverride
    def eventIsEnabled(self, state, detector, g) -> bool:
        # Do something and return True or False