fix(annnet): follow the node rename in the AnnNet bridges - #60
Merged
Conversation
AnnNet renamed "vertex" to "node" across its public surface with no alias, so both bridges raise against a current AnnNet. add_cellnopt_conditions fails on its first statement, and from_annnet on the matrix and the positional lookup. corneto/contrib/annnet.py graph.vertices() -> graph.nodes() result.add_vertices(...) -> result.add_nodes(...) attrs.get_vertex_attrs(...) -> attrs.get_node_attrs(...) graph.X() -> graph.S graph.get_vertex(i) -> graph.N[i] the reserved key "vertex_id" -> "node_id" corneto/methods/signaling/annnet.py graph.vertices() -> graph.nodes() graph.add_vertices(...) -> graph.add_nodes(...) layers.set_vertex_layer_attrs -> layers.set_node_attrs layers.get_vertex_layer_attrs -> layers.node_attrs layers.layer_vertex_set -> layers.layer_node_set layers.set_layer_attrs -> layers.set_attrs CORNETO keeps its own word everywhere it owns the call: graph.V, get_attr_vertex, add_vertex, vertex_incidence_matrix and problem.expr.vertex_value are untouched. The two AnnNet test modules and the CellNOptDAG tutorial follow, and the interoperability guide says "node" for the AnnNet side of the conversion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AnnNet renamed
vertextonodeacross its whole public surface, with no alias and no deprecation period (it is before its first stable release). Both CORNETO bridges call names that no longer exist, so they raise against a current AnnNet:from_annnetbreaks the same way, ongraph.X()and on the positional lookupgraph.get_vertex(i)— both of which AnnNet removed rather than renamed.The changes
corneto/contrib/annnet.pygraph.vertices()graph.nodes()result.add_vertices(...)result.add_nodes(...)attrs.get_vertex_attrs(...)attrs.get_node_attrs(...)graph.X()graph.Sgraph.get_vertex(i)graph.N[i]"vertex_id""node_id"corneto/methods/signaling/annnet.pygraph.vertices()graph.nodes()graph.add_vertices(...)graph.add_nodes(...)layers.set_vertex_layer_attrs(...)layers.set_node_attrs(...)layers.get_vertex_layer_attrs(...)layers.node_attrs(...)layers.layer_vertex_set(...)layers.layer_node_set(...)layers.set_layer_attrs(...)layers.set_attrs(...)CORNETO keeps its own word wherever CORNETO owns the call.
graph.V,get_attr_vertex,add_vertex,vertex_incidence_matrixandproblem.expr.vertex_valueare untouched — the substitution was guarded by receiver, not applied to the text.The two AnnNet test modules and the CellNOptDAG tutorial follow, and the interoperability guide says "node" for the AnnNet side of the conversion.
Verification
tests/contrib/test_annnet.pyandtests/methods/signaling/test_cellnopt_annnet.pypass against AnnNet atsaezlab/annnet@1fea29f:The one error is
picosmissing in the environment I ran in, not related to this change. The rest of the suite is unchanged: its only failures here are solver-availability ones that fail onmaintoo.ruff checkandruff format --checkare clean on every file touched, under the repository's own configuration.Notes
X()was a second name forS, the signed coefficient incidence matrix, and only one of the two survived.Sis what_edge_coefficientwants.get_vertex(i)took a matrix row. AnnNet removed every position from a lookup:get_nodetakes an id, andG.N[i]is the i-th node of the node sequence, which is what the old call meant here.