Repository navigation
Error or warn if we have a disconnected network - #154
Conversation
Added 'allow_disconnected' parameter to enable creation of disconnected networks and included warnings for disconnected networks.
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
|
pre-commit.ci autofix |
hannahbaumann
left a comment
There was a problem hiding this comment.
Thanks @IAlibay this looks good! Just left that comment regarding the error message.
|
|
||
| if not ln.is_connected(): | ||
| if not allow_disconnected: | ||
| errmsg = "Failed to create a connected network where all nodes are either directly or undirectly connected to each other." |
There was a problem hiding this comment.
| errmsg = "Failed to create a connected network where all nodes are either directly or undirectly connected to each other." | |
| errmsg = "Failed to create a connected network where all nodes are either directly or indirectly connected to each other." |
There was a problem hiding this comment.
Or maybe undirectly is a word?
There was a problem hiding this comment.
I wonder if there's a good way to help the user understand why/what it not connected, e.g. listing the ligand(s) that are separate or the cluster sizes. If the network is large and e.g. 50 ligands are disconnected from 50 other ligands (two separate networks), then it would not make sense to list the ligands individually, but if one or two ligands are separate from the rest, it would be helpful. I'm not sure, what do you think?
There was a problem hiding this comment.
Or maybe undirectly is a word?
Nope, just me being unable to spell. Fixed.
There was a problem hiding this comment.
I wonder if there's a good way to help the user understand why/what it not connected, e.g. listing the ligand(s) that are separate or the cluster sizes. If the network is large and e.g. 50 ligands are disconnected from 50 other ligands (two separate networks), then it would not make sense to list the ligands individually, but if one or two ligands are separate from the rest, it would be helpful. I'm not sure, what do you think?
I see what you mean here - I'm really not sure how to do that cleanly though :/ As you say, it's impossible to know what nodes will be disconnected, that could easily become a nightmare.
How about telling them they can get the disconnected network to inspect if they call the method with allow_disconnected? What do you think @hannahbaumann ?
There was a problem hiding this comment.
Yes that sounds great!
There was a problem hiding this comment.
Done, I think 😅 - let me know how it looks!
Co-authored-by: Hannah Baumann <43765638+hannahbaumann@users.noreply.github.com>
hannahbaumann
left a comment
There was a problem hiding this comment.
Thanks @IAlibay , lgtm!
Added 'allow_disconnected' parameter to enable creation of disconnected networks and included warnings for disconnected networks.