Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjmat and property-order #36

Open
LoePhi opened this issue Dec 5, 2023 · 0 comments
Open

adjmat and property-order #36

LoePhi opened this issue Dec 5, 2023 · 0 comments

Comments

@LoePhi
Copy link

LoePhi commented Dec 5, 2023

Issue

When using d3graph.graph() or d3graph.set_node_properties(), the order of properties provided needs to match the order of the instance attribute adjmat. I don't hink this behaviour is documented and it can lead to some issues.

  1. The adjmat attribute does not maintain the same order as the user-provided adjacency matrix. This discrepancy arises because d3graph.graph() calls d3graph.set_edge_properties(), which reorders the matrix into alphabetical order.
  2. Attempting to provide properties in alphabetical order may fail. d3graph.graph() calls data_checks, which calls remove_special_chars. This changes the node names, which can also change their alphabetical order (for example if the name start with a special character, like "µm_wave"). Thus d3graph.set_edge_properties() might produce a different order for adjmat than one would obtain ordering the user-provided adjacency matrix.

Suggested fix

  • Document that properties need to given in alphabetic order.
  • Make the removal of optional chars optional and/or issue a warning if special chars are removed from the node names
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

No branches or pull requests

1 participant