Skip to content

Remove empty special_pairs objects in HOOMD forcefield and code CI update - #997

Open
CalCraven wants to merge 9 commits into
mainfrom
r-cut_empty-pairs
Open

Remove empty special_pairs objects in HOOMD forcefield and code CI update#997
CalCraven wants to merge 9 commits into
mainfrom
r-cut_empty-pairs

Conversation

@CalCraven

@CalCraven CalCraven commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

PR Summary:

Removal and better testing of different special pairs handling in the GMSO Forcefield to HOOMD conversion. Any special pairs that are empty, i.e. (value is 1), so they're not treated specially, can be removed from the special pairs handling.

Also, fix many suggestions made during pre-commit from #995

PR Checklist


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

@CalCraven

Copy link
Copy Markdown
Contributor Author

Can get an Error:

**ERROR**: No pairs are defined.

When performing sim.run, and this is the source. It's not actually causing any simulation issues, i.e. the simulation will run as intended, but will be nice to remove this message so users can better diagnose real errors with their setup.

    for force in forces:
        if isinstance(force, hoomd.md.special_pair.LJ):
            if len(list(force.params.items())) is 0:
                remove=True
                break
    if remove:
        forces.remove(force)
    return forces

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.17%. Comparing base (466c00b) to head (2f8fed4).

Files with missing lines Patch % Lines
gmso/utils/expression.py 40.00% 6 Missing ⚠️
gmso/formats/top.py 86.48% 5 Missing ⚠️
gmso/core/topology.py 92.85% 3 Missing ⚠️
gmso/external/convert_parmed.py 85.00% 3 Missing ⚠️
gmso/core/views.py 88.23% 2 Missing ⚠️
gmso/utils/conversions.py 81.81% 2 Missing ⚠️
gmso/utils/ff_utils.py 90.00% 2 Missing ⚠️
gmso/external/convert_hoomd.py 98.27% 1 Missing ⚠️
gmso/formats/mcf.py 87.50% 1 Missing ⚠️
gmso/parameterization/topology_parameterizer.py 85.71% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #997      +/-   ##
==========================================
+ Coverage   93.14%   93.17%   +0.03%     
==========================================
  Files          67       67              
  Lines        8151     8174      +23     
==========================================
+ Hits         7592     7616      +24     
+ Misses        559      558       -1     

☔ View full report in Codecov by Harness.
📢 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.

@CalCraven

Copy link
Copy Markdown
Contributor Author

This PR is also going to update many of the Linting issues noticed in the latest pre-commit PR.

@CalCraven CalCraven changed the title Remove empty special_pairs objects in HOOMD forcefield Remove empty special_pairs objects in HOOMD forcefield and code CI update Sep 3, 2026
Comment thread gmso/formats/lammpsdata.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
Comment thread gmso/tests/test_hoomd.py Fixed
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