Skip to content

Add lazy evaluation support for non-incremental feature observers #41

Open
@Pabloo22

Description

@Pabloo22

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:

  1. Mark features as "dirty" when update() is called
  2. Only recompute features in initialize_features() when they're accessed and marked as dirty
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions