Skip to content

Adapt code to newer networkx version #14

@steve725

Description

@steve725

Hi,
I'm using networkx 2.6.1 and got two errors in pytopkapi/pretreatment.py.
To fix the errors I had to change:

  • change line 194:
    from
    ar_label_sort = np.array(nx.topological_sort(network_dag))
    to
    ar_label_sort = np.array(list(nx.topological_sort(network_dag)))

  • change line 201:
    from
    dag_copy = nx.copy.deepcopy(network_dag)
    to
    dag_copy = network_dag.copy()

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