-
Notifications
You must be signed in to change notification settings - Fork 5
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
Rjf/expose graph ops #65
Conversation
i'll add an example of error handling for distance units here: app.graph_edge_distance(1756, 'boog')
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this makes sense to me. I left a small request for a comment.
) -> PyResult<f64> { | ||
let du_internal_result: PyResult<Option<DistanceUnit>> = match distance_unit { | ||
Some(du_str) => { | ||
let mut enquoted = du_str.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we could add some comments here to explain why this has to be done or maybe create a simple ops function that does this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for real. i was fishing around for this trick and have run into this previously as well. i'll add a comment, as i'm not sure it's the best way to leverage serde to decode non-parameterized enums from a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh, @nreinicke, i changed my mind; i'll make a generic utility for it, and then leverage that in FromStr implementations for the Unit types. coming right up.
@nreinicke addressed your comment by making that a generic util and then using it in FromStr implementations for the Unit types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, looks great! Thanks for adding these in!
this PR adds a few simple commands to inspect graph attributes from CompassApp and CompassAppWrapper / python CompassApp. that includes:
each time one of these methods is called, we clone the
Arc<DriverReadOnlyLock<Graph>>
, which is a small performance hit which may be acceptable for some one-off operations but may slow things down for large batch queries. if that becomes a bottleneck we can add some batch operations that follow the pattern of these methods to amortize the clone runtime hit.example
using the golden, co test case in the notebook example, i have this for my edges-compass.csv.gz file:
i run these queries and get this result:
Closes #15.