-
Notifications
You must be signed in to change notification settings - Fork 55
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
Algorithm standardisation #1896
base: master
Are you sure you want to change the base?
Conversation
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.
some minor comments to address, also, I would vote for standardising on graph
for the input argument instead of g
/// The largest degree | ||
pub fn max_degree<'graph, G: GraphViewOps<'graph>>(graph: &G) -> usize { | ||
graph.nodes().degree().max().unwrap_or(0) | ||
} |
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.
this algorithm is fairly useless now that it's just graph.nodes().degree().max()...
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.
Agreed. I'll just take it out.
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.
Actually, to be fair, all of these 'max_in_degree', 'max_out_degree'... etc do not really rise to the level of algorithms, imo. They're all just one-liners.
What changes were proposed in this pull request?
Standardization of docstrings, method signatures, and return types of many of the algorithms.
Why are the changes needed?
Improves developer experience of the platform.
Does this PR introduce any user-facing change? If yes is this documented?
All docstrings have been updated to reflect changes to method signatures in the Python and Rust functions.
raphtory-graphql/src/model/algorithms/algorithms.rs featured a small internal change to reflect the updates to Dijkstra's algorithm. The code is functionally equivalent, Dijkstra's algorithm just returns an AlgorithmResult which needed to be unpacked properly in the surrounding code.
How was this patch tested?
All Rust and Python tests pass with idempotent results.
Are there any further changes required?
The AlgorithmResults will soon be changed to NodeState results. This PR is still worth it, imo, since it will be easier to mechanically change AlgorithmResult outputs to NodeState outputs and all of the documentation and signature normalizations are valuable.