-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Backend selection #106
Backend selection #106
Conversation
…se (Graph Tool or NetworkX) There is also the "default" option, which will mimic the original behaviour which is to try Graph Tool first followed by (trying to) fall back on NetworkX If you specifically select a backend which isn't available, an error will be raised. I also had to update/modify many of the tests to implement this new behaviour, but now everything is passing again.
Thank you very much @Jnelen for your contribution. #68 is a very important issue I had not time to work on for a long time, so it's great you want to fix it! (It will also allow to easily support other backends, as discussed in #69). However, I would like to have a Your current solution, for example, changes the very simple Likewise, with a transparent I hope you won't feel discouraged by these comments. I just think that there is a better design which would be less intrusive and more scalable. Do you think you could change this PR into something on those lines? (If you want to discuss the design further before doing a lot of code changes, feel free to comment under the original issue or open a separate GitHub Discussion.) |
Hi @RMeli , I agree with all your points. I thought my approach would be fine for almost all end users, since the basic rmsd functions are unchanged. However, I do agree it adds some complexity, and anything using graph.py previously would break. I should have thought that through better! I will try to do it again, but would you mind if I do it in a seperate pull request? For now I'd prefer to keep this open as a reference. If I get the new version to work i'll put it as a seperate PR, and we can close/remove this one. |
I think for the end-user having to specify the backend is not a big problem, but I'd prefer to have a clean API (i.e. separation of concerns). And the main issue is maintainability. I would like to see the number of backends grow (even GPU-accelerated ones if needed), and that is why I would like to have them as loosely coupled as possible with the rest of the code base.
Designing software is often a long series of tries. I thought about this quite a bit, and that's why I have something in mind that I think would be clean. But happy to be proven wrong/be convinced otherwise! The only thing I can suggest going forward, is to discuss big design changes beforehand to avoid wasting your time (although discussing on actual code on a PR is much easier and more concrete).
I have no issues keeping this PR open (although all the history/code will remain in the closed PR too). If you still want to work on this, I'd be happy to look at a separate PR. I can also try to better formulate the solution I'm looking for in #68, to avoid misunderstandings. |
I'm going to give it another shot, with an approach that I hope will align better with your view. From there we can see how to further improve it if necessary! Thanks for the feedback and insights! |
Description
This is my attempt to adress issue #68
For the functions that work with _rmsd_isomorphic_core, there is now a specific option to select the backend: "graph_tool" or "networkx". There is also the "default" option, which will mimic the original behavior: first it tries Graph Tool followed by (trying to) fall back on NetworkX. If you specifically select a backend that isn't available, an error will be raised. I also had to update/modify many of the tests to implement this new behavior, but now everything is passing again.
Changelog
Documentation
The recognized arguments for the backend feature are:
They are all case insensitive, so things like "GraphTool" or "NetworkX" will also work without problem
Checklist