diff --git a/CHANGELOG.md b/CHANGELOG.md index 353312e6c8..63fb5d4278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Changed +- Pydantic field type validation has been improved. - Moved `quacc.custodian` to `quacc.calculators.custodian` -- Renamed `quacc.thermo.ideal_gas` to `quacc.thermo.run_ideal_gas` +- Moved `quacc.utils.thermo.ideal_gas` to `quacc.builders.thermo.build_ideal_gas` - Renamed `quacc.schemas.ase.summarize_thermo` to `quacc.schemas.ase.summarize_igt_thermo` ## [0.3.0] diff --git a/src/quacc/_cli/__init__.py b/src/quacc/_cli/__init__.py index edb7cddd52..e5aa1804c9 100644 --- a/src/quacc/_cli/__init__.py +++ b/src/quacc/_cli/__init__.py @@ -1 +1 @@ -"""Command line interface""" +"""Command line interface for quacc.""" diff --git a/src/quacc/builders/__init__.py b/src/quacc/builders/__init__.py new file mode 100644 index 0000000000..6e1cccb7f2 --- /dev/null +++ b/src/quacc/builders/__init__.py @@ -0,0 +1,6 @@ +""" +Modules related to builders, which take in an output from at least one calculation and collate/analyze the data to +produce valuable derived properties. Builders do not call a compute-intensive (e.g. DFT) executable. Rather, +they are manipulations on pre-computed data. Most commonly, this is a many-to-one transformation, and the +builders can be run independently of the recipes if desired. +""" diff --git a/src/quacc/runners/thermo.py b/src/quacc/builders/thermo.py similarity index 99% rename from src/quacc/runners/thermo.py rename to src/quacc/builders/thermo.py index 81bcf7d8c2..f1b10da50a 100644 --- a/src/quacc/runners/thermo.py +++ b/src/quacc/builders/thermo.py @@ -15,7 +15,7 @@ from ase import Atoms -def run_ideal_gas( +def build_ideal_gas( atoms: Atoms, vib_freqs: list[float | complex], energy: float = 0.0, diff --git a/src/quacc/calculators/presets/__init__.py b/src/quacc/calculators/presets/__init__.py index e5cbc93fe3..4a9155d031 100644 --- a/src/quacc/calculators/presets/__init__.py +++ b/src/quacc/calculators/presets/__init__.py @@ -1 +1 @@ -"""Presets for various calculators""" +"""Preset parameters for select calculators""" diff --git a/src/quacc/recipes/lj/core.py b/src/quacc/recipes/lj/core.py index 3382c559d3..883a24e534 100644 --- a/src/quacc/recipes/lj/core.py +++ b/src/quacc/recipes/lj/core.py @@ -11,8 +11,8 @@ from ase.optimize import FIRE from quacc import job +from quacc.builders.thermo import build_ideal_gas from quacc.runners.calc import run_ase_opt, run_ase_vib, run_calc -from quacc.runners.thermo import run_ideal_gas from quacc.schemas import fetch_atoms from quacc.schemas.ase import ( summarize_igt_thermo, @@ -183,7 +183,7 @@ def freq_job( vibrations, additional_fields={"name": "LJ Frequency"} ) - igt = run_ideal_gas(atoms, vibrations.get_frequencies(), energy=energy) + igt = build_ideal_gas(atoms, vibrations.get_frequencies(), energy=energy) vib_summary["thermo"] = summarize_igt_thermo( igt, temperature=temperature, diff --git a/src/quacc/recipes/newtonnet/core.py b/src/quacc/recipes/newtonnet/core.py index 90d3bba0ef..759d099b86 100644 --- a/src/quacc/recipes/newtonnet/core.py +++ b/src/quacc/recipes/newtonnet/core.py @@ -10,8 +10,8 @@ from monty.dev import requires from quacc import SETTINGS, job +from quacc.builders.thermo import build_ideal_gas from quacc.runners.calc import run_ase_opt, run_calc -from quacc.runners.thermo import run_ideal_gas from quacc.schemas import fetch_atoms from quacc.schemas.ase import ( summarize_igt_thermo, @@ -225,7 +225,7 @@ def freq_job( vib, additional_fields={"name": "ASE Vibrations Analysis"} ) - igt = run_ideal_gas(final_atoms, vib.get_frequencies(), energy=energy) + igt = build_ideal_gas(final_atoms, vib.get_frequencies(), energy=energy) summary["thermo"] = summarize_igt_thermo( igt, temperature=temperature, diff --git a/src/quacc/recipes/tblite/core.py b/src/quacc/recipes/tblite/core.py index 72530c07a2..abe7e4fef4 100644 --- a/src/quacc/recipes/tblite/core.py +++ b/src/quacc/recipes/tblite/core.py @@ -7,8 +7,8 @@ from monty.dev import requires from quacc import job +from quacc.builders.thermo import build_ideal_gas from quacc.runners.calc import run_ase_opt, run_ase_vib, run_calc -from quacc.runners.thermo import run_ideal_gas from quacc.schemas import fetch_atoms from quacc.schemas.ase import ( summarize_igt_thermo, @@ -210,7 +210,7 @@ def freq_job( vibrations, additional_fields={"name": "TBLite Frequency"} ) - igt = run_ideal_gas(atoms, vibrations.get_frequencies(), energy=energy) + igt = build_ideal_gas(atoms, vibrations.get_frequencies(), energy=energy) vib_summary["thermo"] = summarize_igt_thermo( igt, temperature=temperature, diff --git a/src/quacc/runners/__init__.py b/src/quacc/runners/__init__.py index d79d60910d..81d0120b2f 100644 --- a/src/quacc/runners/__init__.py +++ b/src/quacc/runners/__init__.py @@ -1,3 +1 @@ -""" -Various utility functions for running ASE calculations. -""" +"""Utility functions for preparing and running recipes.""" diff --git a/src/quacc/schemas/__init__.py b/src/quacc/schemas/__init__.py index 1179395058..a6aaec45a0 100644 --- a/src/quacc/schemas/__init__.py +++ b/src/quacc/schemas/__init__.py @@ -1,4 +1,4 @@ -"""Schemas for storing data from recipes""" +"""Schemas for curating the output data from recipes""" from quacc.schemas.atoms import fetch_atoms diff --git a/src/quacc/utils/__init__.py b/src/quacc/utils/__init__.py index a1906f971f..c645add046 100644 --- a/src/quacc/utils/__init__.py +++ b/src/quacc/utils/__init__.py @@ -1,6 +1,5 @@ -""" -Various utility functions -""" +"""Miscellaneous utility functions""" + from quacc.utils.atoms import check_charge_and_spin __all__ = ["check_charge_and_spin"] diff --git a/src/quacc/wflow/__init__.py b/src/quacc/wflow/__init__.py index eae43ded1e..8801d37fb6 100644 --- a/src/quacc/wflow/__init__.py +++ b/src/quacc/wflow/__init__.py @@ -1,3 +1 @@ -""" -Various utility functions for workflow management -""" +"""Modules related to workflow management""" diff --git a/tests/runners/test_thermo.py b/tests/runners/test_thermo.py index b120e524e1..da471ee64c 100644 --- a/tests/runners/test_thermo.py +++ b/tests/runners/test_thermo.py @@ -3,24 +3,24 @@ from ase.calculators.emt import EMT from ase.units import invcm -from quacc.runners.thermo import run_ideal_gas +from quacc.builders.thermo import build_ideal_gas -def test_run_ideal_gas(): +def test_build_ideal_gas(): co2 = molecule("CO2") - igt = run_ideal_gas(co2, [526, 526, 1480, 2565], spin_multiplicity=2) + igt = build_ideal_gas(co2, [526, 526, 1480, 2565], spin_multiplicity=2) assert igt.geometry == "linear" assert igt.spin == 0.5 co2 = molecule("CO2") co2.calc = EMT() co2.calc.results["magmom"] = 1.0 - igt = run_ideal_gas(co2, [526, 526, 1480, 2565]) + igt = build_ideal_gas(co2, [526, 526, 1480, 2565]) assert igt.spin == 0.5 assert igt.get_ZPE_correction() == pytest.approx(2548.5 * invcm) co2 = molecule("CO2") co2.calc = EMT() co2.calc.results["magmom"] = 1.0 - igt = run_ideal_gas(co2, [-12, 526, 526, 1480, 2565]) + igt = build_ideal_gas(co2, [-12, 526, 526, 1480, 2565]) assert igt.get_ZPE_correction() == pytest.approx(2548.5 * invcm)