Skip to content

Update LAMMPS to latest version#512

Merged
jan-janssen merged 7 commits into
mainfrom
lammps
Jun 8, 2026
Merged

Update LAMMPS to latest version#512
jan-janssen merged 7 commits into
mainfrom
lammps

Conversation

@jan-janssen

@jan-janssen jan-janssen commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated LAMMPS dependency from version 2024.08.29 to 2025.07.22
    • Made compatibility adjustments for the updated LAMMPS API

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dacbfaf3-4f4d-41d8-845b-31f8df4f5c12

📥 Commits

Reviewing files that changed from the base of the PR and between aefdbb3 and e175861.

📒 Files selected for processing (2)
  • .ci_support/environment-lammps.yml
  • src/structuretoolkit/analyse/snap.py

📝 Walkthrough

Walkthrough

This PR updates the LAMMPS conda dependency to version 2025.07.22 and adapts the SNAP analysis module to the updated LAMMPS API. The atom creation function now uses atomid instead of id, and per-atom property extraction migrates to a new extraction method signature.

Changes

LAMMPS version upgrade and SNAP API migration

Layer / File(s) Summary
LAMMPS dependency version update
.ci_support/environment-lammps.yml
LAMMPS conda dependency version pinned to 2025.07.22, preserving the openmpi build selector.
SNAP analysis migration to new LAMMPS API
src/structuretoolkit/analyse/snap.py
lmp.create_atoms invocation updated to use atomid=None parameter instead of id=None. Per-atom id and type extraction migrated from extract_atom_iarray to lmp.numpy.extract_atom with nelem parameter, preserving atom id validation and type flattening logic.

Possibly related PRs

  • pyiron/structuretoolkit#362: Both PRs update .ci_support/environment-lammps.yml to bump the LAMMPS dependency version as part of version maintenance.

🐰 A LAMMPS bump hops along,
With API dances new and strong,
The SNAP analyzer learns to play,
With atomid parameters the modern way!

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: updating LAMMPS to a newer version, as evidenced by the environment file change (2024.08.29 → 2025.07.22) and corresponding API adjustments in the code.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lammps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jan-janssen

jan-janssen commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

The package seems to be available:

conda-forge/lammps/2025.07.22/linux-64/lammps-2025.07.22-cpu_py312_h9341614_mpi_openmpi_0.conda

But conda does not find it.

The following package could not be installed
      └─ lammps =2025.7.22 *openmpi* does not exist (perhaps a typo or a missing channel).

@jan-janssen

Copy link
Copy Markdown
Member Author
======================================================================
ERROR: test_calc_a_matrix_snappy (test_snap.TestSNAPInternal.test_calc_a_matrix_snappy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/structuretoolkit/structuretoolkit/tests/test_snap.py", line 789, in test_calc_a_matrix_snappy
    mat_a = _calc_snap_derivatives(
        lmp=self.lmp,
    ...<2 lines>...
        cutoff=10.0,
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.14/site-packages/structuretoolkit/analyse/snap.py", line 619, in _calc_snap_derivatives
    _set_ase_structure(lmp=lmp, structure=structure)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/miniconda3/envs/test/lib/python3.14/site-packages/structuretoolkit/analyse/snap.py", line 269, in _set_ase_structure
    lmp.create_atoms(
    ~~~~~~~~~~~~~~~~^
        n=len(structure),
        ^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        shrinkexceed=False,
        ^^^^^^^^^^^^^^^^^^^
    )
    ^
TypeError: lammps.create_atoms() got an unexpected keyword argument 'id'

@jan-janssen jan-janssen marked this pull request as draft June 8, 2026 08:01
@jan-janssen

Copy link
Copy Markdown
Member Author
======================================================================
ERROR: test_calc_a_matrix_snappy (test_snap.TestSNAP.test_calc_a_matrix_snappy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/structuretoolkit/structuretoolkit/tests/test_snap.py", line 678, in test_calc_a_matrix_snappy
    mat_a = stk.analyse.get_snap_descriptor_derivatives(
        structure=self.structure,
    ...<9 lines>...
        cutoff=10.0,
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/structuretoolkit/analyse/snap.py", line 159, in get_snap_descriptor_derivatives
    return _calc_snap_derivatives(
        lmp=lmp, structure=structure, bispec_options=bispec_options, cutoff=cutoff
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/structuretoolkit/analyse/snap.py", line 644, in _calc_snap_derivatives
    return _extract_computes_snap(
        lmp=lmp,
    ...<2 lines>...
        num_types=number_species,
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/structuretoolkit/analyse/snap.py", line 550, in _extract_computes_snap
    lmp_atom_ids = lmp.numpy.extract_atom_iarray("id", num_atoms).flatten()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'numpy_wrapper' object has no attribute 'extract_atom_iarray'
======================================================================
ERROR: test_calc_a_matrix_snappy (test_snap.TestSNAPInternal.test_calc_a_matrix_snappy)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/structuretoolkit/structuretoolkit/tests/test_snap.py", line 789, in test_calc_a_matrix_snappy
    mat_a = _calc_snap_derivatives(
        lmp=self.lmp,
    ...<2 lines>...
        cutoff=10.0,
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/structuretoolkit/analyse/snap.py", line 644, in _calc_snap_derivatives
    return _extract_computes_snap(
        lmp=lmp,
    ...<2 lines>...
        num_types=number_species,
    )
  File "/home/runner/miniconda3/envs/test/lib/python3.13/site-packages/structuretoolkit/analyse/snap.py", line 550, in _extract_computes_snap
    lmp_atom_ids = lmp.numpy.extract_atom_iarray("id", num_atoms).flatten()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'numpy_wrapper' object has no attribute 'extract_atom_iarray'
----------------------------------------------------------------------

Comment on lines -550 to 551
lmp_atom_ids = lmp.numpy.extract_atom_iarray("id", num_atoms).flatten()
lmp_atom_ids = lmp.numpy.extract_atom(name="id").flatten()
cond = bool(np.all(lmp_atom_ids == 1 + np.arange(num_atoms)))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changes in lammps/lammps#4304

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.90%. Comparing base (aefdbb3) to head (e175861).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #512   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files          29       29           
  Lines        2004     2004           
=======================================
  Hits         1962     1962           
  Misses         42       42           

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

@jan-janssen jan-janssen marked this pull request as ready for review June 8, 2026 10:49
@jan-janssen jan-janssen merged commit f09027e into main Jun 8, 2026
20 of 21 checks passed
@jan-janssen jan-janssen deleted the lammps branch June 8, 2026 10:50
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.

1 participant