Skip to content

HOOMD-Blue handling Virtual sites for TIP4P water xml#956

Open
CalCraven wants to merge 9 commits intomosdef-hub:mainfrom
CalCraven:xyz-precision
Open

HOOMD-Blue handling Virtual sites for TIP4P water xml#956
CalCraven wants to merge 9 commits intomosdef-hub:mainfrom
CalCraven:xyz-precision

Conversation

@CalCraven
Copy link
Copy Markdown
Contributor

@CalCraven CalCraven commented Feb 3, 2026

PR Summary: This PR should enable passing of various TIP-4P, and other forcefield models, enabling efficient handling of both virtual sites and rigid bodies.

PR Checklist


  • Includes appropriate unit test(s)
  • Appropriate docstring(s) are added/updated
  • Code is (approximately) PEP8 compliant
  • Issue(s) raised/addressed?

pre-commit-ci bot and others added 2 commits February 3, 2026 00:17
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 82.99595% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.54%. Comparing base (54e3bb6) to head (e852a44).

Files with missing lines Patch % Lines
gmso/core/topology.py 44.44% 15 Missing ⚠️
gmso/external/convert_hoomd.py 90.10% 9 Missing ⚠️
gmso/utils/compatibility.py 20.00% 8 Missing ⚠️
gmso/core/virtual_type.py 82.50% 7 Missing ⚠️
gmso/core/virtual_site.py 87.50% 2 Missing ⚠️
gmso/utils/expression.py 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #956      +/-   ##
==========================================
- Coverage   93.96%   93.54%   -0.43%     
==========================================
  Files          67       67              
  Lines        7693     7883     +190     
==========================================
+ Hits         7229     7374     +145     
- Misses        464      509      +45     

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

yield site

def iter_sites(self, key, value):
"""Iterate through this topology's sites and virtual_sites based on certain attribute and their values.
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.

Is this doc string mixed up with the one in iter_sites_and_virtual_sites?

)
# attach potential to VirtualSitType
virtualsite_group.append(virtual_type.etree(params_units_def))
# potential_group.append(virtual_type.virtual_potential.etree(potential_params_units_def))
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.

Can these commented lines be removed?

xyz = u.unyt_array(
[site.position.to_value(base_units["length"]) for site in top.sites]
)
if shift_coords:
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.

Why are we removing the coordiante shift? Is this being handled somewhere else? shift_coords is still a parameter in to_gsd_snapshot and to_hoomd_snapshot

@chrisjonesBSU
Copy link
Copy Markdown
Contributor

Thanks or re-working this to support virtual sites. I'll test it out some this week, but it looks pretty close to complete from what I can tell.

return potential


def _organize_generate_topology_molecule_info(top):
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 was just thinking thismight be better suited as a method in Topology as there might be use cases other than writing rigid bodies in HOOMD.

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.

Or, if we don't want to add it as a class method for Topology (to reduce clutter) maybe this should live in a utils module instead.

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