Skip to content

Battery Electrolyte Benchmarks (Inter-Intra, Volume Scans) - #265

Open
PKourtis wants to merge 35 commits into
ddmms:mainfrom
PKourtis:LIB_electrolyte_multiparityplots
Open

Battery Electrolyte Benchmarks (Inter-Intra, Volume Scans)#265
PKourtis wants to merge 35 commits into
ddmms:mainfrom
PKourtis:LIB_electrolyte_multiparityplots

Conversation

@PKourtis

@PKourtis PKourtis commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Pre-review checklist for PR author

PR author must check the checkboxes below when creating the PR.

Summary

Inter-Intra: Evaluate model predictions of intra and inter molecular properties on a mix of LIB full electrolyte and neat solvent configs across a range of densities.

Co-authored-by: PKourtis panoskourtis12@gmail.com
Co-authored-by: imagdau i.b.magdau@gmail.com

Volume-Scans: Evaluate model energy predictions across a battery solvent and a battery electrolyte Volume Scan.

Linked issue

Battery Electrolyte Benchmarks (Inter-Intra, Volume Scans) --> Resolves #145

Progress

  • Calculations
  • Analysis
  • Application
  • Documentation

The tests require the package aseMolec for their analysis (https://github.com/imagdau/aseMolec.git)

One issue encountered is the Volume Scan structures are not visible when the scatter plot points are clicked. The structure visualiser is launched but the structures do not appear on it.

Testing

Tested on:

  • mace-mp-0a
  • mace-mp-0b3
  • mace-mpa-0
  • mace-omat-0
  • mace-matpes-r2scan
  • orb-v3-consv-inf-omat
  • pet-mad
  • uma-m-1p1-omat

New decorators/callbacks

Modified the plot_parity decorator function to plot a parity plot per model. More details are on #260

Comment thread ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py Outdated
Comment thread ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py Outdated
Comment thread ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py Outdated
Comment thread ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py Outdated
Comment thread ml_peg/analysis/battery_electrolyte/inter_intra/metrics.yml Outdated
Comment thread ml_peg/analysis/battery_electrolyte/inter_intra/metrics.yml Outdated
@ElliottKasoar ElliottKasoar added new benchmark Proposals and suggestions for new benchmarks lr labels Jan 27, 2026
@PKourtis
PKourtis force-pushed the LIB_electrolyte_multiparityplots branch 3 times, most recently from 0816155 to 1decc51 Compare January 28, 2026 16:35
@PKourtis

Copy link
Copy Markdown
Contributor Author

Added documentation as well.

Comment thread ml_peg/app/battery_electrolyte/volume_scans/app_volume_scans.py Outdated
@joehart2001

Copy link
Copy Markdown
Collaborator

does ase_ga need to be added as a dependency too?

No module named 'ase_ga'
...
E   ImportError: Cannot import ase_ga.utilities.
E   The ase.ga code has moved to a separate project, ase_ga:
E   https://github.com/dtu-energy/ase-ga .
E   Please install it using e.g. pip install ase-ga.

Comment thread ml_peg/calcs/battery_electrolyte/volume_scans/calc_volume_scans.py
Comment thread ml_peg/calcs/battery_electrolyte/volume_scans/calc_volume_scans.py Outdated
Comment thread ml_peg/analysis/battery_electrolyte/volume_scans/analyse_volume_scans.py Outdated
@joehart2001

Copy link
Copy Markdown
Collaborator

also for inter_intra your app file is app.inter instead of app_inter

@PKourtis

Copy link
Copy Markdown
Contributor Author

ase_ga is not needed for this application. No need to add it to the dependencies.

@PKourtis
PKourtis force-pushed the LIB_electrolyte_multiparityplots branch from 98005e4 to 8690552 Compare January 30, 2026 20:11
@PKourtis

Copy link
Copy Markdown
Contributor Author

Changed the inter_intra app file name to app_inter.

@joehart2001

Copy link
Copy Markdown
Collaborator

ase_ga is not needed for this application. No need to add it to the dependencies.

i get the import error out of the box when running the inter_intra test, when importing anaAtoms:

=============================================================================================== ERRORS ===============================================================================================
_________________________________________________________ ERROR collecting ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py __________________________________________________________
ImportError while importing test module '/Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.venv/lib/python3.12/site-packages/ase/ga/__init__.py:22: in __getattr__
    module = importlib.import_module(modulename)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1310: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1324: in _find_and_load_unlocked
    ???
E   ModuleNotFoundError: No module named 'ase_ga'

The above exception was the direct cause of the following exception:
.venv/lib/python3.12/site-packages/_pytest/python.py:498: in importtestmodule
    mod = import_path(
.venv/lib/python3.12/site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
/opt/homebrew/Cellar/python@3.12/3.12.9/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
ml_peg/calcs/battery_electrolyte/inter_intra/calc_inter_intra.py:10: in <module>
    from aseMolec import anaAtoms
.venv/lib/python3.12/site-packages/aseMolec/anaAtoms.py:8: in <module>
    from ase.ga.utilities import get_rdf
.venv/lib/python3.12/site-packages/ase/ga/__init__.py:24: in __getattr__
    raise ImportError(f'Cannot import {modulename}.\n{msg}') from err
E   ImportError: Cannot import ase_ga.utilities.
E   The ase.ga code has moved to a separate project, ase_ga:
E   https://github.com/dtu-energy/ase-ga .
E   Please install it using e.g. pip install ase-ga.
E   Please import from ase_ga what would previously be imported from ase.ga.
E   ase.ga placeholders will be removed in a future release.

@PKourtis

PKourtis commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the anaAtoms import erorr. aseMolec now has ase-ga as a dependency so it will be installed automatically with aseMolec. No need to add it as a dependency here.

@PKourtis
PKourtis force-pushed the LIB_electrolyte_multiparityplots branch from d3ca3e0 to 61eeed1 Compare February 5, 2026 11:36
@ElliottKasoar ElliottKasoar removed the lr label Feb 10, 2026
@joehart2001

Copy link
Copy Markdown
Collaborator

Hi have you pushed your latest version? did you add my code suggestions which fixes the visualisation?

@PKourtis
PKourtis force-pushed the LIB_electrolyte_multiparityplots branch from 61eeed1 to 90c3c07 Compare April 30, 2026 19:22
@joehart2001

Copy link
Copy Markdown
Collaborator

Hey @PKourtis is it ok to remove the data files now?

@PKourtis

PKourtis commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Hey @joehart2001 could you add the data files on S3 bucket? I can edit the code to download it directly from there

@ElliottKasoar

ElliottKasoar commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Hey @joehart2001 could you add the data files on S3 bucket? I can edit the code to download it directly from there

We will do shortly, but in the meantime, if you change the code, you can place the relevant data directory in ~/.cache/ml_peg, and the test should work as if you downloaded it, so you should be able to test it reasonably well.

@joehart2001

Copy link
Copy Markdown
Collaborator

hey @PKourtis i realised i had already uplaoded them. so unless anyting has changed, you can find them at:

    data_path = (
        download_s3_data(
            key="inputs/battery_electrolyte/inter_intra/inter_intra.zip",
            filename="inter_intra.zip",
        )
    )
    data_path = (
        download_s3_data(
            key="inputs/battery_electrolyte/volume_scans/volume_scans.zip",
            filename="volume_scans.zip",
        )
    )

@joehart2001

Copy link
Copy Markdown
Collaborator

@PKourtis @ElliottKasoar is this ready (minus the conflicts)?

Panos Kourtis (PGR) and others added 28 commits August 6, 2026 14:53
… battery_electrolyte - fully operational (no structures for volume scan scatters + multiple parity plot function)
… scripts, changed forces plots to density parity plots
…alysis, fixed where configs are saved for visualisation and fixed visualisation in the app
@ElliottKasoar
ElliottKasoar force-pushed the LIB_electrolyte_multiparityplots branch from e25740d to c3ad456 Compare August 6, 2026 17:11

@ElliottKasoar ElliottKasoar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @PKourtis, thanks again for this, and for the latest round of changes!

I've pushed a few minor fixes, and left a couple of quick questions.

I also had a couple more requests:

  • I updated the volume scans analysis to not fail when data is missing, but could you make sure the inter_intra analysis also runs with missing data?
  • Might it be possible to visualise the reference volume scans, as well as the predicted version? Currently, whichever line you click, it shows the predicted version
  • Can you add structure visualisation to the density plots? I think any other example you can find for density plots should have this

"""
model_name, model = mlip
calc = model.get_calculator(precision="low")
calc = model.get_calculator(precision="high")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this supposed to be high? We normally use lower precision for MD, and I thought for the paper it's what we used?

tooltip: "Weighted Root Mean Square Deviation of Inter-Forces"
level_of_theory: PBE
weight: 1
Inter-Energy:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it obvious why this doesn't include intra-energy?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apologies if we've discussed this, but how much have you considered the thresholds here and for the volume scans?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new benchmark Proposals and suggestions for new benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Li-Ion Battery Electrolyte Inter-Intra Properties Benchmark

3 participants