Skip to content

Use gufe charge utils. gufe/openfe 1.10+ support - #139

Merged
ijpulidos merged 19 commits into
mainfrom
use-gufe-charge-utils
Jun 17, 2026
Merged

Use gufe charge utils. gufe/openfe 1.10+ support#139
ijpulidos merged 19 commits into
mainfrom
use-gufe-charge-utils

Conversation

@ijpulidos

@ijpulidos ijpulidos commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

These set of changes use the gufe.mapping.LigandAtomMapping.get_alchemical_charge_difference capabilities instead of the deprecated utility function in openfe (check https://github.com/OpenFreeEnergy/openfe/blob/c60db0685a937ce8ef0616ea2e563121bf1f9d2d/src/openfe/utils/ligand_utils.py#L6). Enabling support for gufe and openfe 1.9+ releases.

We vendor the utility function which now lies inside a method in the upstream protocols.

@ijpulidos
ijpulidos requested a review from dotsdl June 9, 2026 17:26
@ijpulidos ijpulidos changed the title Use gufe charge utils. gufe/openfe 1.9 support Use gufe charge utils. gufe/openfe 1.10+ support Jun 9, 2026

settings = NonEquilibriumCyclingProtocol.default_settings()
# Change engine platform for tests
settings.engine_settings.compute_platform = "CPU"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly for @dotsdl - please be aware that the default for all this is now CUDA, so if you're running any kind of minimization, etc.. on F@H servers, they'll need to have a CUDA GPU.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see. I'll make a PR into alchemiscale-fah that sets settings.engine_settings.compute_platform to None so that this doesn't trip users up. It's not a setting that has any bearing on the openmm-core used on F@H volunteer hosts downstream.

@IAlibay IAlibay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a couple of comments since I was looking at the github notification - let us know if you need a proper review!

Comment thread feflow/settings/integrators.py Outdated
"""Number of steps for the equilibrium parts of the cycle. Default 12500"""
nonequilibrium_steps: int = 12500
"""Number of steps for the non-equilibrium parts of the cycle. Default 12500"""
barostat: Literal["MonteCarloBarostat", "MonteCarloMembraneBarostat"] = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will membrane support work out of the box?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm you are right, surely not since we are not handling membrane components at all. Maybe we just want to make this one just Literal["MonteCarloBarostat"]? Or what do you suggest?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah maybe that's a good short term solution.

except ValueError as e:
raise ProtocolSupportError(str(e))
# Get the formal change difference between the end states
charge_difference = mapping.get_alchemical_charge_difference()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[nit] you're losing validation re: not doing net charge transformations without PME - probably will want to add that back at some point.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah good catch! This is probably why the CI was taking so long, since the error wasn't being raised and we have a test running a whole DAG with it!

Will re-add the validation and refactor the test such that it doesn't run a whole DAG, even in case the error isn't raised

@dotsdl dotsdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great to me @ijpulidos! Can you elaborate on what you saw in the CI failures? Are they hanging?

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.90%. Comparing base (639b258) to head (2d2d7f9).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
feflow/utils/charge.py 69.23% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   86.86%   87.90%   +1.03%     
==========================================
  Files          11       14       +3     
  Lines        1439     1579     +140     
==========================================
+ Hits         1250     1388     +138     
- Misses        189      191       +2     

☔ View full report in Codecov by Harness.
📢 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.

@ijpulidos
ijpulidos requested review from IAlibay and dotsdl June 16, 2026 15:23

@dotsdl dotsdl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good @ijpulidos!

@IAlibay IAlibay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@ijpulidos
ijpulidos merged commit 83341c1 into main Jun 17, 2026
5 of 6 checks passed
@ijpulidos
ijpulidos deleted the use-gufe-charge-utils branch June 17, 2026 14:08
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.

3 participants