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

Make Transformation and NonTransformation subclass TransformationBase #311

Merged
merged 14 commits into from
Dec 10, 2024

Conversation

dotsdl
Copy link
Member

@dotsdl dotsdl commented Apr 25, 2024

In some cases it can be awkward for NonTransformation to be a subclass of Transformation, such as in alchemiscale, for cases where NonTransformation should be handled very differently.

Switching to a shared, abstract base class for Transformation and NonTransformation simplifies this.

…nBase`

In some cases it can be awkward for `NonTransformation` to be a subclass
of `Transformation`, such as in `alchemiscale`, for cases where
`NonTransformation` should be handled very differently. Switching to a
shared, abstract base class for `Transformation` and `NonTransformation`
simplifies this.
@pep8speaks
Copy link

pep8speaks commented Apr 25, 2024

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

Line 75:80: E501 line too long (80 > 79 characters)
Line 283:80: E501 line too long (80 > 79 characters)

Comment last updated at 2024-04-25 06:03:17 UTC

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Thanks for opening this @dotsdl - as a first initial triage, could you possibly add in a rever rst file with a short summary of this update and any expected API breaks?

@dotsdl
Copy link
Member Author

dotsdl commented Apr 25, 2024

I can do that, no problem @IAlibay! I also need to fix the broken tests yet as well.

@dotsdl
Copy link
Member Author

dotsdl commented Apr 25, 2024

To be clear, this isn't blocking anything on alchemiscale; it's just something @ianmkenney and I noticed while working on this one: OpenFreeEnergy/alchemiscale#270

@IAlibay
Copy link
Member

IAlibay commented Jun 29, 2024

@dotsdl possibly a crazy question - does this technically change the gufe keys for transformation objects? I can't remember if it captures the parent class signatures

(partly asking because of the test failures)

@IAlibay
Copy link
Member

IAlibay commented Jun 29, 2024

The follow up question I have is if we need a 1.x gufe policy on key stability?

@dotsdl dotsdl self-assigned this Oct 4, 2024
@dotsdl
Copy link
Member Author

dotsdl commented Oct 4, 2024

Will pursue a review on this from Alyssa when she starts.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

This looks good to me, couple of comments though.

gufe/transformations/transformation.py Show resolved Hide resolved
gufe/transformations/transformation.py Show resolved Hide resolved
@dotsdl dotsdl added this to the Release 1.2 milestone Nov 12, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.49%. Comparing base (4ee7647) to head (45583b0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
gufe/transformations/transformation.py 98.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
- Coverage   98.67%   98.49%   -0.18%     
==========================================
  Files          36       36              
  Lines        2117     2131      +14     
==========================================
+ Hits         2089     2099      +10     
- Misses         28       32       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dotsdl
Copy link
Member Author

dotsdl commented Dec 5, 2024

@IAlibay can I get another review from you? I also used this as an opportunity to clean up some docstrings, and adjust the reprs for Transformation and NonTransformation to include the name attribute.

@dotsdl dotsdl requested review from ianmkenney and atravitz and removed request for ianmkenney December 5, 2024 16:23
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

lgtm thanks!

Copy link
Contributor

@atravitz atravitz left a comment

Choose a reason for hiding this comment

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

This refactor is a big improvement imo, just a couple docstrings and clarifying questions.

gufe/transformations/transformation.py Outdated Show resolved Hide resolved
gufe/transformations/transformation.py Outdated Show resolved Hide resolved
gufe/transformations/transformation.py Outdated Show resolved Hide resolved
gufe/transformations/transformation.py Outdated Show resolved Hide resolved
@dotsdl
Copy link
Member Author

dotsdl commented Dec 10, 2024

pre-commit.ci autofix

@dotsdl dotsdl merged commit 387ae03 into main Dec 10, 2024
17 of 19 checks passed
@dotsdl dotsdl deleted the transformation-base-class branch December 10, 2024 05:44
@dotsdl
Copy link
Member Author

dotsdl commented Dec 10, 2024

Thanks @IAlibay and @atravitz! Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants