Skip to content

Rename and document Analysis.particle_energy()#5226

Merged
jngrad merged 13 commits intoespressomd:pythonfrom
Nikhil-4595:rename_particle_energy
Jan 9, 2026
Merged

Rename and document Analysis.particle_energy()#5226
jngrad merged 13 commits intoespressomd:pythonfrom
Nikhil-4595:rename_particle_energy

Conversation

@Nikhil-4595
Copy link
Copy Markdown
Contributor

@Nikhil-4595 Nikhil-4595 commented Jan 8, 2026

Fixes #5039

Description of changes:

  • API change: rename Analysis.particle_energy() to Analysis.particle_non_bonded_energy() to better reflect the calculated quantity (kinetic, bonded, electrostatic and magnetostatic contributions are not part of this energy)
  • bugfix: Thole corrections are no longer part of the energy calculated by Analysis.particle_non_bonded_energy()
  • improve documentation of the per-particle non-bonded energy analysis function and of the Thole correction

Nikhil added 8 commits January 8, 2026 17:28
…ation

Introduce Analysis.particle_non_bonded_energy() as a clearer name for the
per-particle short-range non-bonded energy calculation.

The existing Analysis.particle_energy() function is retained as a deprecated
alias to maintain backward compatibility and now emits a DeprecationWarning.

Changes included:
- Added particle_non_bonded_energy() with clarified docstring
- Deprecated particle_energy() and redirected it to the new function
- Updated unit tests to check backward compatibility and warning emission
- Updated Sphinx documentation to reflect the clarified function semantics

The underlying energy computation in the core remains unchanged.
Comment thread src/python/espressomd/analyze.py Outdated
@jngrad jngrad self-assigned this Jan 9, 2026
@jngrad jngrad changed the title Rename particle_energy to particle_non_bonded_energy and clarify short-range electrostatics in docstring #5039 Rename and document Analysis.particle_energy() Jan 9, 2026
@jngrad jngrad added this to the ESPResSo 5.0 milestone Jan 9, 2026
Copy link
Copy Markdown
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@jngrad jngrad merged commit 81fe366 into espressomd:python Jan 9, 2026
11 checks passed
itischler pushed a commit to itischler/espresso that referenced this pull request Jan 19, 2026
Fixes espressomd#5039

Description of changes:
- API change: rename `Analysis.particle_energy()` to `Analysis.particle_non_bonded_energy()` to better reflect the calculated quantity (kinetic, bonded, electrostatic and magnetostatic contributions are not part of this energy)
- bugfix: Thole corrections are no longer part of the energy calculated by `Analysis.particle_non_bonded_energy()`
- improve documentation of the per-particle non-bonded energy analysis function and of the Thole correction

Co-authored-by: Jean-Noël Grad <jgrad@icp.uni-stuttgart.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

system.analysis.particle_energy() rename/clarify

2 participants