Ah, and when implementing a custom init there needs to be a call to super to get the full class setup:
class CloseToDatePredicate(PythonEnablingPredicate):
def __init__(self, date: AbsoluteDate, tolerance_seconds: float):
self.date = date
self.tolerance_seconds = tolerance_seconds
super(CloseToDatePredicate, self).__init__()
def eventIsEnabled(self, state, eventDetector, g):
print(state.getDate())
return abs(state.getDate().durationFrom(self.date)) <= self.tolerance_seconds
With this it works.
The online notebook through Binder was a really good way to troubleshoot!