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

rustworkx validation #9

Open
wants to merge 7 commits into
base: rust-cli
Choose a base branch
from

Conversation

mplsgrant
Copy link

I outsourced the validation of graphml files to GraphML and added a test against a correct graphml file.

GraphML is a file I pulled from rustworkx which is a rust re-write of the networkx library that we use in our python cli. I did need to slightly modify the file in a couple ways: to accept "False" and "True" as boolean and improve some error handling and reporting.

Regarding validation itself, I looks to me like the validation in the python cli mostly happens at the xml/graphml level, meaning that validation occurs against the key declarations within the xml file itself for nodes and against the declaration of edges for edges. This means that I couldn't find much in the way of validation against the json schema file itself, especially for the edges.

This file comes from:
https://github.com/Qiskit/rustworkx/blob/d5521e3ac8f1332c2caf0b172fc24b19a9352699/src/graphml.rs#L1

I don't see an obvious way to use rustworkx as a crate because they seem to have built the api to
talk with python.
I'm keeping the old python functions as comments in case I want to come back and morph them into
a rust api. I have already morphed one of the parsing functions.
I pulled GraphML from rustworkx, which appears to be a rust re-write of networkx (the library used
in the python implementation of the cli).

We may want to look into further validation beyond just the internal xml consistency.
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.

1 participant