Skip to content

Commit

Permalink
Make folder for builders (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen authored Sep 27, 2023
1 parent 81a5ea8 commit dd27e0d
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 25 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Command line interface"""
"""Command line interface for quacc."""
6 changes: 6 additions & 0 deletions src/quacc/builders/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/calculators/presets/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Presets for various calculators"""
"""Preset parameters for select calculators"""
4 changes: 2 additions & 2 deletions src/quacc/recipes/lj/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/newtonnet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/tblite/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions src/quacc/runners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""
Various utility functions for running ASE calculations.
"""
"""Utility functions for preparing and running recipes."""
2 changes: 1 addition & 1 deletion src/quacc/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions src/quacc/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""
Various utility functions
"""
"""Miscellaneous utility functions"""

from quacc.utils.atoms import check_charge_and_spin

__all__ = ["check_charge_and_spin"]
4 changes: 1 addition & 3 deletions src/quacc/wflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"""
Various utility functions for workflow management
"""
"""Modules related to workflow management"""
10 changes: 5 additions & 5 deletions tests/runners/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit dd27e0d

Please sign in to comment.