-
Notifications
You must be signed in to change notification settings - Fork 13
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 filter method to LinkGraph #269
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @CunliangGeng and the rest of your teammates on Graphite |
3d06904
to
46802fc
Compare
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 for having added the filter, very very useful :)
I think there is a bug in the code - see the comment.
Also, note that the filter gives different results compared to when I filter on the same objects as it follows:
gcfs_selected = gcfs[:5]
bgcs_selected = [bgc for gcf in gcfs_selected for bgc in gcf.bgcs]
mfs_selected = mfs[:5]
spectra_selected = [spec for mf in mfs_selected for spec in mf.spectra]
lg_selected = LinkGraph()
for gcf in gcfs_selected:
for spec in spectra_selected:
if links.has_link(gcf, spec):
lg_selected.add_link(gcf, spec, **links.get_link_data(gcf, spec))
for mf in mfs_selected:
if links.has_link(gcf, mf):
lg_selected.add_link(gcf, mf, **links.get_link_data(gcf, mf))
# lg_selected has 74 links
Compared to when I do this
lg_selected = links.filter(gcfs_selected, spectra_selected)
# lg_selected has 68 links
Try |
Indeed it works! :D |
93d215d
to
a18ed84
Compare
Merge activity
|
Quality Gate passedIssues Measures |
To solve #265