Skip to content

Set positions from .gro files#1220

Merged
mattwthompson merged 5 commits intomainfrom
set-positions-from-gro
Jul 10, 2025
Merged

Set positions from .gro files#1220
mattwthompson merged 5 commits intomainfrom
set-positions-from-gro

Conversation

@mattwthompson
Copy link
Member

Description

Beginning #1210

Checklist

  • Add tests
  • Lint
  • Update docstrings

@mattwthompson mattwthompson changed the title ENH: Set positions from .gro file Set positions from .gro files May 13, 2025
@mattwthompson mattwthompson linked an issue May 13, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented May 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.86%. Comparing base (2011dcc) to head (7910c4e).
⚠️ Report is 66 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1220   +/-   ##
=======================================
  Coverage   93.85%   93.86%           
=======================================
  Files          72       72           
  Lines        6233     6240    +7     
=======================================
+ Hits         5850     5857    +7     
  Misses        383      383           

☔ 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.

@mattwthompson mattwthompson marked this pull request as ready for review July 8, 2025 15:21
@mattwthompson mattwthompson added this to the 0.4.3 milestone Jul 8, 2025
@mattwthompson mattwthompson mentioned this pull request Jul 9, 2025
3 tasks
Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

This is approved, but it does have the fairly pointy edge case of being vulnerable to different atom orderings. It may be more trouble than it's worth to police this (since truly scrambled atom orderings will lead to massive energies and likely crashes right after) but I think the docstring at least needs to contain this warning in a way that's hard to miss. And I'd be OK with even more extreme cautions, like a UserWarning that's always omitted when the function is used unless the user sets a flag or something (though that's quite extreme so it's not a blocking requirement for merge).

self,
gro_file: Path | str,
):
"""Set the positions of this `Interchange` from a GROMACS coordinate `.gro` file."""
Copy link
Member

Choose a reason for hiding this comment

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

(blocking) Add a sentence or two here loudly cautioning that this only checks that the NUMBER of atoms matches, and that anything with the right number of atoms will be accepted, even if the actual ordering is scrambled.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great point

@mattwthompson mattwthompson merged commit 1b67e48 into main Jul 10, 2025
16 checks passed
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.

Interchange.positions_from_gro() instance method

2 participants