Skip to content

Conversation

@hannahbaumann
Copy link
Contributor

@hannahbaumann hannahbaumann commented Oct 9, 2025

Checklist

  • Added a news entry

Developers certificate of origin

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 98.55491% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.23%. Comparing base (3d65447) to head (683b47d).

Files with missing lines Patch % Lines
openfe/protocols/openmm_md/plain_md_methods.py 80.00% 2 Missing ⚠️
openfe/protocols/openmm_utils/system_validation.py 81.81% 2 Missing ⚠️
...nfe/protocols/openmm_septop/equil_septop_method.py 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1561      +/-   ##
==========================================
- Coverage   95.39%   93.23%   -2.17%     
==========================================
  Files         189      189              
  Lines       16646    16922     +276     
==========================================
- Hits        15880    15777     -103     
- Misses        766     1145     +379     
Flag Coverage Δ
fast-tests 93.23% <98.55%> (?)
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.

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.

Some quick things for now.


# If there is an SolvatedPDBComponent, we set the solv_comp
# in the complex to None, as it is only used in the solvent leg
if isinstance(prot_comp, SolvatedPDBComponent):
Copy link
Member

Choose a reason for hiding this comment

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

Why not just return that component? That way we can still assert that solv_comp == None means that there is no solvent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'm not quite following you what you mean here. As we are returning the SolvatedPDBComponent in the prot_comp, are you suggesting to also return it in the solv_comp , in addition or instead of the "normal" SolventComponent? In the membrane case you would currently have both, the SolvatedPDBComponent and the SolventComponent in the ChemicalSystem, one for the complex and one for the solvent.

barostat_frequency: TimestepQuantity = 25.0 * unit.timestep
"""
Frequency at which volume scaling changes should be attempted.
Note: The barostat frequency is ignored for gas-phase simulations.
Default 25 * unit.timestep.
"""
surface_tension: Optional[SurfaceTensionQuantity] = 0 * unit.bar * unit.nanometer
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a validator that this shouldn't be non-zero if you aren't using a MonteCarloBarostat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a validator ensuring the surface_tension is not None when the MonteCarloMembraneBarostat is present. Should there also be a validator to check that the surface_tension is either None or zero when the MonteCarloBarostat is present?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think that would be useful - at least users should know that value doesn't do anything in that case.

Comment on lines 102 to 103
solv_comps = state.get_components_of_type(SolventComponent)
base_solv_comps = state.get_components_of_type(BaseSolventComponent)
Copy link
Member

Choose a reason for hiding this comment

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

Just do the second one and then do an isinstance check later.

Copy link
Contributor Author

@hannahbaumann hannahbaumann Jan 15, 2026

Choose a reason for hiding this comment

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

I attempted a rewrite of this function, however I'm not sure if this is more clear. The challenge is that the ChemicalSystems for these membrane systems are a bit confusing since they will have the SolvatedPDBComponent for the complex leg and a SolventComponent for the solvent leg.
So I think what we're currently supporting is:

  • Vacuum (no BaseSolventComponent)
  • One SolventComponent
  • One SolventComponent paired with one SolvatedPDBComponent

Or would we want to support more scenarios at the moment?

raise ValueError(errmsg)

if solv_comps[0].smiles != "O":
if len(solv_comps) == 1 and solv_comps[0].smiles != "O":
Copy link
Member

Choose a reason for hiding this comment

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

Do the isinstance check here.

errmsg = "nocutoff cannot be used for solvent transformations"
raise ValueError(errmsg)

if len(solv_comps) > 1:
Copy link
Member

Choose a reason for hiding this comment

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

We either should error out if we have more than one solvated PDB component too, or we need to change this so that you have the isinstance check that covers the below test too and then a separate check that if it's a solvated PDB component the box vectors have to be the same across all the PDBs.

For now we only allow for one protein component, so maybe just enforce that here too?

Copy link
Contributor Author

@hannahbaumann hannahbaumann Jan 15, 2026

Choose a reason for hiding this comment

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

Technically we're already enforcing that in the validate_protein, since the SolvatedPDBComponent is also a ProteinComponent it should error out in that check as well. Or do you think we should doublecheck that here as well?
This means of course that we're currently not supporting the presence of one "normal" ProteinComponent and one SolvatedPDBComponent at the same time.

@hannahbaumann
Copy link
Contributor Author

pre-commit.ci autofix

@hannahbaumann hannahbaumann linked an issue Jan 15, 2026 that may be closed by this pull request
@hannahbaumann
Copy link
Contributor Author

gather tests are failing as we will need to update result files on zenodo with the updated settings objects once we're settled on those.

@hannahbaumann hannahbaumann changed the title [ WIP ] Membrane support prototype [ WIP ] Membrane support Jan 19, 2026
@hannahbaumann hannahbaumann requested a review from IAlibay January 22, 2026 09:46
@github-actions
Copy link

🚨 API breaking changes detected! 🚨
View logs for this step

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.

Membrane: Add warning/validation for barostat usage

4 participants