KarrLab / wc_lang

Language for describing whole-cell models as reaction networks
MIT License
9 stars 3 forks source link

False positive possible in Model._get_cyclic_deps() #138

Closed artgoldberg closed 4 years ago

artgoldberg commented 4 years ago

Model._get_cyclic_deps() detect cyclic dependencies among Observable and Function instances. It can report false cycles if Observable and Function instances have the same ids.

E.g., assume this network, where O stands for Observable and F for Function and the attribute is the id.

F.b -> F.a -> O.b -> O.a

Since digraph edges depend on just id in digraph.add_edge(model.id, other_model.id) this example will incorrectly report a cycle.

Fix: include the object type in the edges.

artgoldberg commented 4 years ago

Not a problem. _get_cyclic_deps() only checks for cycles within types, which must have unique ids.