Skip to content

select md ensemble and thermostat explicitly - #438

Merged
Atilaac merged 3 commits into
mainfrom
refactor-select-md-ensemble-explicitly
Oct 5, 2026
Merged

Atilaac merged 3 commits into
mainfrom
refactor-select-md-ensemble-explicitly

Conversation

@Atilaac

@Atilaac Atilaac commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Addresses review feedback: the ensemble was partly inferred (pressure=None is NVT, langevin=True is Langevin thermostat) and partly specified (nve=True). It is now always explicit, and arguments that only apply to one ensemble carry its name as a prefix.

The changes:

  • md_simulation / _run_lammps_md: required ensemble ("nve", "nvt", "npt", "nvt_langevin", "npt_langevin"). pressure / pressure_end to npt_pressure / npt_pressure_end. The nve and langevin flags are removed.
  • melt_quench_simulation, diffusion_simulation, viscosity_simulation, viscosity_ensemble: langevin: bool is required thermostat ("nose_hoover" | "langevin"). Each protocol still decides NVT/NPT per stage.
  • elastic_simulation: required ensemble + npt_pressure; "nve" is rejected.
  • cte_from_fluctuations_simulation, temperature_scan_simulation: pressure → npt_pressure.
  • Arguments that don't fit the chosen ensemble raise a ValueError before LAMMPS starts.
  • API: the config schema is unchanged. pipeline.py turns the elastic config's pressure=None into an explicit ensemble.
  • Docs, docstring examples and tutorials are updated.

Some of these changes are breaking

  • The parameters above are renamed or removed, and ensemble / thermostat are required.
  • md_simulation's temperature_sim now defaults to None (was 5000 K).

Addresses review feedback: the ensemble was partly inferred (`pressure=None` is NVT, `langevin=True` is Langevin thermostat) and partly specified (`nve=True`). It is now always explicit, and arguments that only apply to one ensemble carry its name as a prefix.

The changes:

- `md_simulation` / `_run_lammps_md`: required `ensemble` (`"nve"`, `"nvt"`, `"npt"`, `"nvt_langevin"`, `"npt_langevin"`). `pressure` / `pressure_end` to `npt_pressure` / `npt_pressure_end`. The `nve` and `langevin` flags are removed.
- `melt_quench_simulation`, `diffusion_simulation`, `viscosity_simulation`, `viscosity_ensemble`: `langevin: bool` is required `thermostat` (`"nose_hoover"` | `"langevin"`). Each protocol still decides NVT/NPT per stage.
- `elastic_simulation`: required `ensemble` + `npt_pressure`; `"nve"` is rejected.
- `cte_from_fluctuations_simulation`, `temperature_scan_simulation`: `pressure` → `npt_pressure`.
- Arguments that don't fit the chosen ensemble raise a `ValueError` before LAMMPS starts.
- API: the config schema is unchanged. `pipeline.py` turns the elastic config's `pressure=None` into an explicit `ensemble`.
- Docs, docstring examples and tutorials are updated.

Some of these changes are breaking
- The parameters above are renamed or removed, and `ensemble` / `thermostat` are required.
- `md_simulation`'s `temperature_sim` now defaults to `None` (was 5000 K).
@Atilaac Atilaac added the type: refactor Changelog: code refactor or style cleanup (Maintenance) label Oct 5, 2026
@Atilaac Atilaac added the integration Tag a PR with this to run integration tests label Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Atilaac
Atilaac requested a review from ltalirz October 5, 2026 10:54
@Atilaac
Atilaac merged commit 9f3a43a into main Oct 5, 2026
11 checks passed
@Atilaac
Atilaac deleted the refactor-select-md-ensemble-explicitly branch October 5, 2026 19:52
@ltalirz

ltalirz commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Great, thanks for following up on this @Atilaac !

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

Labels

integration Tag a PR with this to run integration tests type: refactor Changelog: code refactor or style cleanup (Maintenance)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants