Skip to content

Newer NetworkX package would break SepTop method #36

@jsjyhzy

Description

@jsjyhzy

Dear developers

I am trying to install this package freshly through conda, and found SepTop method will break near

  File "/public/data/femto_test/test-SepTop.py", line 29, in <module>
    complex_topology, complex_system = femto.fe.septop.setup_complex(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/modules/femto/0.3.1/lib/python3.12/site-packages/femto/fe/septop/_setup.py", line 234, in setup_complex
    system, topology, ligand_1_ref_idxs, ligand_2_ref_idxs = _setup_system(
                                                             ^^^^^^^^^^^^^^
  File "/public/modules/femto/0.3.1/lib/python3.12/site-packages/femto/fe/septop/_setup.py", line 187, in _setup_system
    ligand_1_ref_idxs, ligand_2_ref_idxs = femto.fe.reference.select_ligand_idxs(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/modules/femto/0.3.1/lib/python3.12/site-packages/femto/fe/reference.py", line 341, in select_ligand_idxs
    ligand_queries = _create_ligand_queries(ligand_1, ligand_2, method)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/modules/femto/0.3.1/lib/python3.12/site-packages/femto/fe/reference.py", line 300, in _create_ligand_queries
    query_1 = _create_ligand_queries_baumann(ligand_1, None)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/modules/femto/0.3.1/lib/python3.12/site-packages/femto/fe/reference.py", line 171, in _create_ligand_queries_baumann
    for node_paths in networkx.shortest_path(ligand_graph).values()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'generator' object has no attribute 'values'

I believe this cause by the return type change of function networkx.shortest_path which documented at https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.generic.shortest_path.html
It seems that this package should require a networkx not newer than 3.5, if this requirement could be restricted during installation or documented in the README or tutorials, that would be a great help for new comers like me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions