Open
Description
Some feature observers don't implement the update()
method. For these observers, it would be highly beneficial if they only compute the initialize_features()
method once the user calls it.
Observers that would benefit from lazy evaluation are:
CompositeFeatureObserver
IsCompletedObserver
IsReadyObserver
Implementation suggestion:
For lazy evaluation, these observers could:
- Mark features as "dirty" when
update()
is called - Only recompute features in
initialize_features()
when they're accessed and marked as dirty - Clear the dirty flag after recomputation
This probably should be the FeatureObserver
default behavior, since it already implements the update()
method as simply calling initialize_features()
. In other words, we should change this class instead of the mentioned ones directly. For IsCompletedObserver
we should remove the unnecessary definition of its update()
method.
Tasks
- Implement lazy evaluation in
FeatureObserver
class - Remove
IsCompletedObserver
'supdate()
method