Skip to content

Conversation

@atravitz
Copy link
Contributor

I think we were pinned to openff-units==0.2.0 and pint<0.22 because we were waiting on this: OpenFreeEnergy/gufe#533.

Trying an unpin now to see where we're at.

Checklist

  • Added a news entry

Developers certificate of origin

@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.47%. Comparing base (aaf6fdd) to head (31a3ae1).
⚠️ Report is 230 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1374      +/-   ##
==========================================
- Coverage   94.63%   92.47%   -2.17%     
==========================================
  Files         143      143              
  Lines       10962    10962              
==========================================
- Hits        10374    10137     -237     
- Misses        588      825     +237     
Flag Coverage Δ
fast-tests 92.47% <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.

@IAlibay
Copy link
Member

IAlibay commented Jun 18, 2025

I believe by doing this bump, we will have to fully migrate to pydantic v2+ (iirc interchange v0.4 and above is pydantic 2 only and openff-units 0.3 is does not work with pre-0.4 versions of interchange).

@IAlibay
Copy link
Member

IAlibay commented Jun 18, 2025

Regarding the mypy failures, this is what we're seeing here: OpenFreeEnergy/gufe#533

We'll need to import Quantity directly from openff.units for typing.

@IAlibay
Copy link
Member

IAlibay commented Jun 18, 2025

For the EitherQuantity failure, the best answer will be to just directly call "from_openmm" instead. kT in ThermodynamicState should be in OpenMM units.

@atravitz atravitz mentioned this pull request Jun 18, 2025
2 tasks
@atravitz atravitz mentioned this pull request Jun 18, 2025
2 tasks
@atravitz atravitz changed the title unpin openff-units and pint bump openff-units and pint pins Jun 18, 2025
@atravitz
Copy link
Contributor Author

the last nagging mypy errors are:

> openfe/protocols/openmm_utils/multistate_analysis.py:370: error: "type[Quantity]" has no attribute "from_list"  [attr-defined]
> openfe/protocols/openmm_rfe/equil_rfe_methods.py:261: error: "Quantity" has no attribute "u"  [attr-defined]

I'm going to ignore these to get this PR merged, but im curious if this is expected or fixable @mattwthompson (I see from openff-units that this inherits directly from pint and therefore might be out of your control).

@atravitz atravitz requested review from IAlibay and mikemhenry June 23, 2025 18:31
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.

I'm going to put a block as "I need to review this", since it llikely means other ongoing work needs fixing.

@atravitz atravitz added this to the v1.5.0 milestone Jun 23, 2025
Copy link
Contributor

@mattwthompson mattwthompson left a comment

Choose a reason for hiding this comment

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

unit.Quantity and Quanitity should be completely substitute-able with each other. Is that not the case? / I wonder if these changes are motivated by runtime changes or attempts to make Mypy happy?

Of course, it's possible that this is wrong and/or out of date. It might be worth revisiting, though I won't be able to do that until mid-July at the earliest.

The addition of several # type: ignores is surely unfortunate but the code should work fine otherwise?

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.

Couple of things, otherwise lgtm.


sim_time = round(sim_length.to('attosecond').m)
ts = round(timestep.to('attosecond').m)
sim_time = round(sim_length.to('attosecond').m) # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

Oddly enough, mypy does define __round__, so we should be able to call round on the attosecond Quantity and then call its magnitude, but something is going wrong here.

Looks like there's some stalled PRs on mypy to deal partially with this.

'forward_dDGs': unit.Quantity.from_list(forward_dDGs),
'reverse_DGs': unit.Quantity.from_list(reverse_DGs),
'reverse_dDGs': unit.Quantity.from_list(reverse_dDGs)
'forward_DGs': Quantity.from_list(forward_DGs), # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

These are all because the pyi from openff-units doesn't define the method. Manually adding it fixes the problem. Raising the issue here: openforcefield/openff-units#127

atravitz and others added 2 commits June 25, 2025 09:23
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
@atravitz
Copy link
Contributor Author

thank you for the additional fixes, @IAlibay! it looks like the two remaining items are tracked in openff and mypy, so we're good to merge here?

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.

just one spare space that needs removing

@github-actions
Copy link

No API break detected ✅

@atravitz atravitz enabled auto-merge (squash) June 25, 2025 17:13
@atravitz atravitz merged commit d33975c into main Jun 25, 2025
13 checks passed
@atravitz atravitz deleted the unpin_units branch June 25, 2025 18:13
@mattwthompson mattwthompson mentioned this pull request Jul 7, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants