Skip to content

Conversation

@atravitz
Copy link
Contributor

gufe added new tests to GufeTokenizableTestsMixin for json and msgpack roundtripping, and it caught that roundtripping RelativeHybridTopologyProtocol and AbsoluteSolvationProtocol does not reproduce the same gufe key.

This is because the original object's early_termination_target_error's units are kilocalorie_per_mole, but when it's loaded back in, it's in units of kilocalorie / mole

We think this is because of pydantic casting, and changing the pydantic class to expect kilocalorie_per_mole solves this.

Checklist

  • Added a news entry

Developers certificate of origin

@atravitz
Copy link
Contributor Author

@hannahbaumann you made this edit here:573f271#diff-24e303f93e84a4ff799a85a45f35209e516f389c3fa823a2f20106a89843bb25L462

so I'd like to know if there's any reason we should be keeping this as kcal/mol as opposed to kilocalorie_per_mole

my understanding is that this is an openmm vs. openff convention difference: https://github.com/openforcefield/openff-units?tab=readme-ov-file#openmm-interoperability

@codecov
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.57%. Comparing base (429138a) to head (b17714b).
Report is 101 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1210      +/-   ##
==========================================
- Coverage   93.09%   92.57%   -0.53%     
==========================================
  Files         141      141              
  Lines       10651    10667      +16     
==========================================
- Hits         9916     9875      -41     
- Misses        735      792      +57     
Flag Coverage Δ
fast-tests 92.57% <100.00%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atravitz atravitz changed the title switch kcal/mol to kilocalorie_per_mole for roundtip consistency switch kcal/mol to kilocalorie_per_mole for roundtrip consistency Mar 25, 2025
@atravitz atravitz requested a review from ijpulidos March 25, 2025 16:20
Copy link
Contributor

@hannahbaumann hannahbaumann left a comment

Choose a reason for hiding this comment

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

Thanks @atravitz , lgtm!

@atravitz atravitz marked this pull request as ready for review March 25, 2025 16:51
Copy link
Member

@ianmkenney ianmkenney left a comment

Choose a reason for hiding this comment

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

Under the assumption that this is reasonable for the other reviewers, as they are more familiar with downstream effects, this looks good to me.

It might also be good to check to see what happens if a user provides a quantity in kcal/mol, rather than relying on the default, and if this comes up again.

@atravitz atravitz requested a review from mikemhenry March 25, 2025 17:30
@mikemhenry
Copy link
Contributor

It might also be good to check to see what happens if a user provides a quantity in kcal/mol, rather than relying on the default, and if this comes up again.

That exact point was raised during our meeting so we will add a test to make sure it works

Copy link
Contributor

@mikemhenry mikemhenry left a comment

Choose a reason for hiding this comment

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

Just need a test to make sure if a user sets something with 'kcal/mol' style it works -- it absolutely should since that is how this works BUT we will want that test since if we ever change the way our models work, we could introduce a regression

@github-actions
Copy link

No API break detected ✅

@atravitz atravitz added this to the v1.3.1 milestone Mar 25, 2025
@atravitz atravitz self-assigned this Mar 25, 2025
@atravitz atravitz requested a review from mikemhenry March 25, 2025 19:42
@atravitz atravitz added the bug Something isn't working label Mar 25, 2025
Copy link
Contributor

@mikemhenry mikemhenry left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikemhenry mikemhenry merged commit 3744840 into main Mar 25, 2025
13 checks passed
@mikemhenry mikemhenry deleted the fix/kcal_mismatch branch March 25, 2025 19:46
@mikemhenry
Copy link
Contributor

Also, no need for a news entry since this really does not affect users at all

def instance(self):
pass

class TestRelativeHybridTopologyProtocolOtherUnits(GufeTokenizableTestsMixin):
Copy link
Member

Choose a reason for hiding this comment

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

I was looking at the tests earlier today and stumbled upon this - the name is really confusing. Can we maybe consider switching it out to something else? (especially having it in tokenization just threw me off).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants