Skip to content

Introduce abstract base class to unify LON and CMLON #14

@pFornagiel

Description

@pFornagiel

Description

Currently, both LON and CMLON independently implement an identical _allclose helper method:

# duplicated in both LON and CMLON
def _allclose(self, f1: float | None, f2: float | None) -> bool:
...

This duplication could be addressed by introducing an abstract base class (e.g. _LONBase(ABC)) that provides a shared implementation of _allclose (and any other future shared utilities) and defines a common API (abstract properties/methods) that both LON and CMLON are required to implement - n_vertices, n_edges, vertex_fitness, get_sinks, compute_metrics, etc.

This is relevant support for discrete problems is planned (#2), so this unified interface will help with analysis and visualization logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions