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.
Description
Currently, both
LONandCMLONindependently implement an identical_allclosehelper method: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 bothLONandCMLONare 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.