Skip to content

Improve position warning context - #2188

Open
giovanni-br wants to merge 3 commits into
OpenFreeEnergy:mainfrom
giovanni-br:improve-position-warning-context
Open

giovanni-br wants to merge 3 commits into
OpenFreeEnergy:mainfrom
giovanni-br:improve-position-warning-context

Conversation

@giovanni-br

@giovanni-br giovanni-br commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #2159.

This PR makes the set_and_check_new_positions warning easier to understand.

Previously, the warning only showed global atom indices, for example
mapping 0 : 4. This made it difficult to identify the affected atoms in a
real system.

The warning now includes the old and new residue names, residue IDs, chain IDs,
and atom names, while keeping the global atom indices for debugging.

Example:

mapping old atom 0 (residue LIG 1, chain X, atom C1x) to new atom 4
(residue LIG 2, chain 1, atom C2x) deviates by more than 1.0

Tested with:

python -m pytest -s --log-cli-level=WARNING \
  src/openfe/tests/protocols/openmm_rfe/test_hybrid_top_protocol.py::test_setup_ligand_overlap_warning

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes

Codex assisted with drafting the implementation and test update. I reviewed the
changes and ran the targeted test locally.

Checklist

  • All new code is appropriately documented.
  • Added a news entry, or the changes are not user-facing.
  • Ran pre-commit.
  • Filled in the AI generated code disclosure.

Manual Tests: not run; this change only improves warning messages.

  • GPU integration tests
  • example notebook testing
  • packaging tests

Developers certificate of origin

  • I certify that this contribution is covered by the MIT License and the Developer Certificate of Origin.

@giovanni-br

Copy link
Copy Markdown
Author

pre-commit.ci autofix

@IAlibay IAlibay self-assigned this Sep 16, 2026
@IAlibay
IAlibay self-requested a review September 16, 2026 14:19
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.

set_and_check_new_positions warning isn't very helpful

2 participants