-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix fused ring mappings #56
Conversation
Hi @jthorton @IAlibay what do you think? :) |
Re: new filter - I agree, this would be the best way to do a breaking change without removing the old behaviour completely. Re: default behaviour - this might need more discussion. I can see both viewpoints here. For the current protocols we have, we would want to avoid ring breaks because it's undefined behaviour, but I know @hannahbaumann and I had discussed that there were some cases where it might be worth having an incorrect transformation than none at all. Main things I'd really away here are:
|
Thanks for the discussion @RiesBen and @IAlibay, I agree that this does limit the number of mappings but I think this now follows the best practice advice and might be a sensible default in future. An extra filter and an option in the init to use this filter would make sense for now I'll add those. For some more context I looked into the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 96.23% 96.60% +0.36%
==========================================
Files 13 13
Lines 585 618 +33
==========================================
+ Hits 563 597 +34
+ Misses 22 21 -1 ☔ View full report in Codecov by Sentry. |
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.
Couple of small things, otherwise lgtm!
@IAlibay @hannahbaumann @RiesBen I think this is now ready for a final review, please check that the docs I added make sense to provide more information on this change. |
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 @jthorton , just some small comments on the docs, otherwise lgtm!
src/kartograf/atom_mapper.py
Outdated
@@ -101,12 +103,15 @@ def __init__( | |||
_mapping_algorithm : str, optional | |||
mapping_algorithm.linear_sum_assignment - this allows to swap the | |||
optimization algorithm. Not recommended. | |||
allow_partial_fused_rings: bool | |||
If we should allow partially mapped fused rings `True` or not `False`, default `True`. |
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.
Should this be True
or False
?
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.
Ah I was trying to make it clear what each option did but maybe I should change it to
If we should allow partially mapped fused rings (True) or not (False)
?
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.
The () would be useful visually but not a massive issue. In case Hannah is asking if it should default to False instead - for now we have to leave it to True, but we can deprecate the behaviour and aim for switching to False in the near future.
Co-authored-by: Hannah Baumann <43765638+hannahbaumann@users.noreply.github.com>
Co-authored-by: Hannah Baumann <43765638+hannahbaumann@users.noreply.github.com>
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.
Couple of small things to address, otherwise LGTM.
src/kartograf/atom_mapper.py
Outdated
@@ -101,12 +103,15 @@ def __init__( | |||
_mapping_algorithm : str, optional | |||
mapping_algorithm.linear_sum_assignment - this allows to swap the | |||
optimization algorithm. Not recommended. | |||
allow_partial_fused_rings: bool | |||
If we should allow partially mapped fused rings `True` or not `False`, default `True`. |
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.
The () would be useful visually but not a massive issue. In case Hannah is asking if it should default to False instead - for now we have to leave it to True, but we can deprecate the behaviour and aim for switching to False in the near future.
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
An attempt at fixing #44 by enforcing that all rings an atom is present in must be present in the final mapping which should mean that fused rings are handled correctly.