Skip to content

Inconsistent existence of coordinate systems in node attributes #244

@kevinchern

Description

@kevinchern

Graph node attributes contain inconsistent node attributes depending on initialization.
This makes downstream code unnecessarily complex and unreliable

Example:

import dwave_networkx as dnx

P = dnx.pegasus_graph(6, coordinates=False)
print(P.nodes[20])

P = dnx.pegasus_graph(6, coordinates=True)
print(P.nodes[0, 0, 4, 0])

P = dnx.pegasus_graph(6, nice_coordinates=True)
print(P.nodes[0, 0, 0, 0, 0])

outputs

{'pegasus_index': (0, 0, 4, 0)}
{'linear_index': 20}
{'linear_index': 20, 'pegasus_index': (0, 0, 4, 0)}

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