Skip to content

Add energy-diff and dissipation columns to gather_results - #271

Merged
srmnitc merged 1 commit into
ICAMS:mainfrom
prabhath-c:gather_results
Jul 28, 2026
Merged

Add energy-diff and dissipation columns to gather_results#271
srmnitc merged 1 commit into
ICAMS:mainfrom
prabhath-c:gather_results

Conversation

@prabhath-c

Copy link
Copy Markdown
Contributor

This pull request enhances the gather_results function in calphy.postprocessing by adding new quality metrics and diagnostics to its output DataFrame, and introduces comprehensive tests for these additions. The main improvements include support for free energy error, dissipation, and detailed per-replica diagnostics, as well as robust handling of missing files and calculation modes.

Enhancements to result metrics:

  • The DataFrame returned by gather_results now includes new columns: free_energy_error, dissipation, ts_dissipation, forward_energy_diff, backward_energy_diff, forward_lambda, and backward_lambda, with clear documentation for each.
  • These columns are initialized and set to appropriate defaults (e.g., np.nan or None) to ensure consistent output even when data is missing. [1] [2]

Parsing and diagnostics improvements:

  • For temperature sweep (ts) mode, the function now parses the statistical error from temperature_sweep.dat and extracts per-replica forward/backward energy differentials and lambda arrays from ts.forward_i.dat/ts.backward_i.dat files, providing detailed diagnostics for phase transitions.
  • For other calculation modes, relevant metrics are set to fixed or default values as appropriate.

Testing:

  • A new test suite in tests/test_postprocessing.py builds minimal calculation folders and validates the new metrics and fallback behaviors for different calculation modes and missing files.

Surfaces free_energy_error, dissipation/ts_dissipation, and the raw
forward/backward switching energy-diff (+ lambda) arrays so phase
transitions during a ts/tscale sweep can be diagnosed straight from the
gathered DataFrame instead of re-parsing each folder by hand.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@prabhath-c
prabhath-c marked this pull request as draft July 28, 2026 11:57
@prabhath-c

Copy link
Copy Markdown
Contributor Author

@srmnitc, please let me know if you would like any more features for this function

@srmnitc
srmnitc marked this pull request as ready for review July 28, 2026 13:28
@srmnitc

srmnitc commented Jul 28, 2026

Copy link
Copy Markdown
Member

@prabhath-c looks good to me, shall I merge it?

@srmnitc
srmnitc merged commit a2c24dd into ICAMS:main Jul 28, 2026
6 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.

2 participants