-
Notifications
You must be signed in to change notification settings - Fork 19
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
add function to create a minimal network with redundancy for all nodes #559
Conversation
This sounds handy. I'm curious if doubly connected MST is rigorously defined, but I'm sure there's ways to approximate it. One hacky way would be to run MST, set the chosen edges to bad values then rerun the MST alg to get the "2nd best" network. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #559 +/- ##
==========================================
+ Coverage 91.29% 91.38% +0.08%
==========================================
Files 117 117
Lines 7287 7357 +70
==========================================
+ Hits 6653 6723 +70
Misses 634 634
☔ View full report in Codecov by Sentry. |
doing something like this. I'm currently just running an MST, then removing those edges from the fully-connected network, then running MST again, then adding the two MSTs together. |
@richardjgowers this is working for me locally, so ready for review. I'm not familiar with how you've set up testing, should I add tests for this function somewhere? A simple test would be to assert that all nodes are connected to |
@JenkeScheen |
added a test that all nodes are connected to at least two edges. @richardjgowers please fiddle with the tests as you see fit, the copy-pasting from |
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.
Thanks! This is a great contribution.
One definite fix needed: looks like a test isn't being prefaced by test_
, so it isn't running.
Other suggestions are mainly potential improvements to the tests.
Hello @JenkeScheen! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2023-10-10 08:28:18 UTC |
…edge_data['object']) for _, _, _, edge_data in current_best_edges] for _, _, _, edge_data in current_best_edges: mappings.append(edge_data['object']) Don't use a list comprehension unless you're assigning it to something. Co-authored-by: David W.H. Swenson <[email protected]>
Thanks for the review @dwhswenson, should be ready for another look now. |
@JenkeScheen looks like CI is unhappy |
thanks @mikemhenry, should be good now. |
now mypy needs some tlc https://github.com/OpenFreeEnergy/openfe/actions/runs/6271512074/job/17031266889?pr=559#step:6:13 |
Thanks @JenkeScheen This week most of us are busy at the MDAnalysis UGM, so if this doesn't get a review this week, I will be sure to get some eyes on it next Wednesday (10/04) |
These mypy errors are coming in from files not in in this PR, so I am guessing that something got merged in either without mypy passing, or there was an update to mypy so we have a new error to fix...
|
Yeah this one just suddenly appeared it seems. |
Looks like it came along with matplotlib 3.8.0 matplotlib/matplotlib#26812 |
Developers certificate of origin
I'm building a function that will generate a
LigandNetwork
where each node is connected to two edges. This will increase performance during analysis by introducing redundancy: if one of the two edges has a high error associated with it, the other edge (hopefully with much lower error) will be weighted to contribute more to the DG estimation.The basic algorithm will be based on
openfe.setup.ligand_network_planning.generate_minimal_spanning_network
, but will also add the 'second-best-scoring` edge for each node.