Skip to content
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

[WIP] Fe setup structure remodelling #346

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

RiesBen
Copy link
Contributor

@RiesBen RiesBen commented Sep 11, 2024

This is a draft!

The idea of the draft is to make gufe future ready for future developments and to indictate the power of certain approaches as they are more general than currently indicated.

Example:
so network planners are not really dependent on LigandAtomMappings, but ComponentMappings, that could be any type of component.

_Note: _

  • This PR was discussed in the protocol dev round.
  • Changes are only in setup, rest is just refactoring.

Principles:

  • Changes should not be API-breaking.

Thoughts:

  • A ChemicalSystem could be interpreted as a collection of Components and therefore this should be reflected in the definitions.

@RiesBen RiesBen linked an issue Sep 11, 2024 that may be closed by this pull request
@pep8speaks
Copy link

pep8speaks commented Sep 11, 2024

Hello @RiesBen! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 34:80: E501 line too long (86 > 79 characters)

Line 11:80: E501 line too long (82 > 79 characters)

Line 11:1: E302 expected 2 blank lines, found 1
Line 20:80: E501 line too long (81 > 79 characters)
Line 25:36: W292 no newline at end of file

Line 31:1: W391 blank line at end of file

Line 59:1: W391 blank line at end of file

Line 28:80: E501 line too long (136 > 79 characters)
Line 40:80: E501 line too long (89 > 79 characters)

Line 15:80: E501 line too long (96 > 79 characters)
Line 281:12: W292 no newline at end of file
Line 281:12: W292 no newline at end of file
Line 281:12: W292 no newline at end of file

Line 20:80: E501 line too long (109 > 79 characters)

Line 7:5: E271 multiple spaces after keyword
Line 9:1: E302 expected 2 blank lines, found 1
Line 24:80: E501 line too long (111 > 79 characters)
Line 34:80: E501 line too long (89 > 79 characters)

Line 16:1: E302 expected 2 blank lines, found 1
Line 127:31: E127 continuation line over-indented for visual indent
Line 188:80: E501 line too long (80 > 79 characters)

Line 12:1: E302 expected 2 blank lines, found 1
Line 19:55: E231 missing whitespace after ':'
Line 19:80: E501 line too long (95 > 79 characters)
Line 20:80: E501 line too long (97 > 79 characters)
Line 29:22: E222 multiple spaces after operator
Line 32:5: E303 too many blank lines (2)
Line 32:40: E225 missing whitespace around operator
Line 36:80: E501 line too long (94 > 79 characters)
Line 36:81: E225 missing whitespace around operator

Comment last updated at 2024-09-18 08:20:34 UTC

@RiesBen RiesBen changed the title [WIP] Fe setup structure [WIP] Fe setup structure remodelling Sep 11, 2024
@RiesBen RiesBen self-assigned this Sep 11, 2024
@RiesBen RiesBen added the enhancement New feature or request label Sep 11, 2024
@dotsdl dotsdl self-requested a review September 11, 2024 21:11
there are few discussion points left.
@dotsdl
Copy link
Member

dotsdl commented Sep 25, 2024

@RiesBen please let me know when you'd like a review from me! Happy to help you get this into gufe!

@dotsdl dotsdl added this to the Release 1.1 milestone Sep 25, 2024
@@ -16,12 +16,6 @@

from .chemicalsystem import ChemicalSystem

from .mapping import (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't move all these imports, this will break the API

# This code is part of gufe and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/gufe
"""Defining the relationship between different components"""
from .componentmapping import ComponentMapping
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this can't go away until 2.0


# Todo: connect to protocols - use this for labels?

class RFEComponentLabels(str, Enum):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs more discusison, I don't remember this being in the plans for updating things, definitely using labels for components seems like something we don't want to do.

@@ -27,4 +27,5 @@ def suggest_mappings(self,
Suggests zero or more :class:`.AtomMapping` objects, which are possible
atom mappings between two :class:`.Component` objects.
"""
...
raise NotImplementedError("This function was not implemented.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this (...) is a pattern we use quite widely for our abcs?

@@ -37,22 +37,23 @@ def componentA_to_componentB(self) -> Mapping[int, int]:
entity in the other component (e.g. the atom disappears), therefore
resulting in a KeyError on query
"""
...
raise NotImplementedError("This function was not implemented.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

from .atom_mapping import AtomMapping


class AtomMappingScorer(GufeTokenizable):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in line with what we discussed, so this feature I think it ok to include.

from .component_mapping import ComponentMapping


class ComponentMapper(GufeTokenizable):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also in line with what was discussed.


from .component_mapping import ComponentMapping

class NetworkPlan(GufeTokenizable):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very briefly looking at class names, I don't think Plan is the right word here. It's not immediately clear what it does.

@dotsdl dotsdl modified the milestones: Release 1.1, Release 2.0.0 Oct 3, 2024
@dotsdl
Copy link
Member

dotsdl commented Oct 4, 2024

@RiesBen can you offer a response to @IAlibay above? Can you give us a checklist of things you aim to do before you declare this PR ready for review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Planned
Development

Successfully merging this pull request may close these issues.

Build ComponentMapping, ComponentMappingScorer
4 participants