Skip to content

membrane CLI support#1896

Open
atravitz wants to merge 24 commits intomainfrom
membrane_cli_prototype
Open

membrane CLI support#1896
atravitz wants to merge 24 commits intomainfrom
membrane_cli_prototype

Conversation

@atravitz
Copy link
Copy Markdown
Contributor

Checklist

  • All new code is appropriately documented (user-facing code must have complete docstrings).
  • Added a news entry, or the changes are not user-facing.
  • Ran pre-commit: you can run pre-commit locally or comment on this PR with pre-commit.ci autofix.

Manual Tests: these are slow so don't need to be run every commit, only before merging and when relevant changes are made (generally at reviewer-discretion).

Developers certificate of origin

@atravitz atravitz force-pushed the membrane_cli_prototype branch from 3303023 to 59b7c48 Compare April 8, 2026 22:23
Base automatically changed from membrane_prototype to main April 16, 2026 18:06
@atravitz atravitz force-pushed the membrane_cli_prototype branch 2 times, most recently from 5e87d6a to 96ed3d8 Compare April 16, 2026 22:05
@atravitz atravitz changed the title [WIP] membrane CLI prototype [WIP] membrane CLI support Apr 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 98.40000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.96%. Comparing base (fc6689e) to head (f3d155d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/openfecli/commands/plan_rbfe_network.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1896      +/-   ##
==========================================
- Coverage   94.28%   89.96%   -4.33%     
==========================================
  Files         214      215       +1     
  Lines       19000    19327     +327     
==========================================
- Hits        17915    17388     -527     
- Misses       1085     1939     +854     
Flag Coverage Δ
fast-tests 89.96% <98.40%> (?)
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 force-pushed the membrane_cli_prototype branch 2 times, most recently from a725cce to fc98c2b Compare April 20, 2026 21:57
@atravitz atravitz changed the title [WIP] membrane CLI support membrane CLI support Apr 21, 2026
@atravitz atravitz force-pushed the membrane_cli_prototype branch from e92d58b to 339ef68 Compare April 22, 2026 22:47
Copy link
Copy Markdown
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 ! I added some comments regarding validation and error handling.
One thing that's currently missing is that the network planner always adds a SolventComponent to the ChemicalSystem, however the membrane case does not support a SolventComponent in the complex.
Once you add the protocol.validate to the network planner, this would also raise an Error.

Comment thread src/openfecli/commands/plan_rbfe_network.py Outdated
Comment thread src/openfecli/parameters/protein.py Outdated
Comment thread src/openfecli/commands/plan_rbfe_network.py Outdated
@hannahbaumann hannahbaumann self-assigned this Apr 23, 2026
@atravitz atravitz force-pushed the membrane_cli_prototype branch from 42a42bb to 038177b Compare April 23, 2026 23:51
@atravitz atravitz marked this pull request as ready for review April 24, 2026 00:07
Comment thread docs/mambaf9t4jj8g5ei
Copy link
Copy Markdown
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 , this looks great! Left some small comments, the only important one is the catching of the actual error which would be very helpful to users I think.

Comment thread src/openfecli/commands/plan_rbfe_network.py Outdated
with runner.isolated_filesystem():
result = runner.invoke(plan_rbfe_network, args)

assert result.exit_code == 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to directly test for the ComponentValidationError here?

return protein_class.from_pdb_file(input_file)
elif _contains_any_substring(input_file, _PDBX_EXT):
return protein_class.from_pdbx_file(input_file)
except ValueError:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think here I would catch and print the actual error. E.g. in the protein membrane case where no box vector is provided, the user wouldn't know why it was unable to load the file. The error would have said:
Error: Could not determine box_vectors. Please provide them explicitly via the ``box_vectors`` argument or enable ``infer_box_vectors``
So maybe something like this?

except ValueError as e:
    click.secho(
        f"Unable to load a {protein_class.__name__} from {input_file}.\nError: {e}",
        err=True
    )

): # this silences some stderr spam
return NOT_PARSED
def _contains_any_substring(input: str, substrings: Iterable[str]) -> bool:
return any([substring in input for substring in substrings])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be safer to check for the file ending? Though of course it could also be gziped, so I'm not sure. I was just thinking in case .pdb could just be part of the file name, without it being a pdb file?

_ = _get_protein_membrane(filename, None)

captured = capsys.readouterr()
assert "Unable to load a ProteinMembraneComponent" in captured.err
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you add the actual Error to this, I would here also check for the box vector thing in the error.

@atravitz atravitz force-pushed the membrane_cli_prototype branch from 47a2a03 to f3d155d Compare April 24, 2026 13:59
@github-actions
Copy link
Copy Markdown

No API break detected ✅

@atravitz atravitz added this to the 1.11.0 milestone Apr 24, 2026
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.

2 participants