-
Notifications
You must be signed in to change notification settings - Fork 167
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
Reorganize code into modules #396
Conversation
Pull Request Test Coverage Report for Build 1105247807
💛 - Coveralls |
Wow, I love this!
|
I agree Edit:
I didn't merge |
This reverts commit 22abf85.
…to reorganize-code
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.
Overall this is awesome! I'm really happy to get rid of the 5k line (and continuing to grow) lib.rs and put things in real modules. I'd like to move forward on merging this sooner rather than later since it basically conflicts with every other PR. Now that we have a more organized structure we can continue to bikeshed on where things go moving forward, especially as it doesn't actually effect our user API we have the freedom to move things around a lot. I just had 2 inline comments on alternatives to avoid the module inception.
Also, it would be really good if you could add something to:
https://github.com/Qiskit/retworkx/blob/main/CONTRIBUTING.md about the code structure now. Basically about how lib.rs is for the python module exports and global code, where we put pyfunction definitions vs pure rust code, standalone modules vs directories, etc. Once the contributing guide is updated I think this is ready to go.
I incorporated the feedback, now we no longer have module inceptions. I also added a small section on |
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.
Overall this is great. Thanks for making those updates quickly. I've got a few inline nits on the contributor docs but nothing major, I'll just apply them and merge this! Then we have the fun of rebasing everything :)
I was just curious if there was an impact on compile time, I just did side by side testing locally and there was no difference for me with this PR applied. |
Closes #300
The organization steps were:
api.rst
topic.rs
topic/mod.rs
for the Python implementations andtopic/xyz.rs
for implementationsDetails worth sharing are:
weight_callable
andNodeRemoved
stayed atlib.rs
because they are omnipresent; because they are pure Rust code I thought it was a reasonable placewrap_pyfunction(module_name::function_name)
is currently not supported, so all functions had to be importedother_algo
did not feel very descriptive