Skip to content

fix(annnet): follow the node rename in the AnnNet bridges - #60

Merged
pablormier merged 1 commit into
saezlab:mainfrom
deeenes:fix/annnet-node-rename
Aug 7, 2026
Merged

fix(annnet): follow the node rename in the AnnNet bridges#60
pablormier merged 1 commit into
saezlab:mainfrom
deeenes:fix/annnet-node-rename

Conversation

@deeenes

@deeenes deeenes commented Aug 7, 2026

Copy link
Copy Markdown
Member

What

AnnNet renamed vertex to node across 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:

File "corneto/methods/signaling/annnet.py", line 109, in add_cellnopt_conditions
    known_vertices = set(graph.vertices())
AttributeError: 'AnnNet' object has no attribute 'vertices'

from_annnet breaks the same way, on graph.X() and on the positional lookup graph.get_vertex(i) — both of which AnnNet removed rather than renamed.

The changes

corneto/contrib/annnet.py

before after
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]
reserved key "vertex_id" "node_id"

corneto/methods/signaling/annnet.py

before after
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 wherever CORNETO owns the call. graph.V, get_attr_vertex, add_vertex, vertex_incidence_matrix and problem.expr.vertex_value are 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.py and tests/methods/signaling/test_cellnopt_annnet.py pass against AnnNet at saezlab/annnet@1fea29f:

7 passed, 1 error

The one error is picos missing 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 on main too.

ruff check and ruff format --check are clean on every file touched, under the repository's own configuration.

Notes

  • AnnNet's X() was a second name for S, the signed coefficient incidence matrix, and only one of the two survived. S is what _edge_coefficient wants.
  • get_vertex(i) took a matrix row. AnnNet removed every position from a lookup: get_node takes an id, and G.N[i] is the i-th node of the node sequence, which is what the old call meant here.
  • The changelog for the rename is at https://github.com/saezlab/annnet/blob/main/CHANGELOG.md.

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.
@pablormier
pablormier merged commit c2d24f6 into saezlab:main Aug 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants