Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename runners.calc to runners.ase #1149

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Renamed `[optimizers]` extras to `[sella]`
- Moved `quacc.utils.wflows` into `quacc.wflow.decorators` and `quacc.wflow.prefect`
- Moved `quacc.utils.db` into `quacc.wflow.db`
- Moved `quacc.utils.calc` to `quacc.runners.calc`
- Moved `quacc.utils.calc` to `quacc.runners.ase`
- Moved `quacc.presets` to `quacc.calculators.presets`

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/calculators/qchem/custodian.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def run_custodian(
-------
None
"""
# Adapted from atomate.qchem.firetasks.run_ase_calc
# Adapted from atomate.qchem.firetasks.run_calc
from custodian import Custodian
from custodian.qchem.handlers import QChemErrorHandler
from custodian.qchem.jobs import QCJob
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/dftb/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ase.calculators.dftb import Dftb

from quacc import SETTINGS, job
from quacc.runners.calc import run_ase_calc
from quacc.runners.ase import run_calc
from quacc.schemas.ase import summarize_run
from quacc.utils.dicts import merge_dicts
from quacc.utils.files import check_logfile
Expand Down Expand Up @@ -188,7 +188,7 @@
flags = merge_dicts(defaults, calc_swaps)

atoms.calc = Dftb(**flags)
final_atoms = run_ase_calc(atoms, geom_file=GEOM_FILE, copy_files=copy_files)
final_atoms = run_calc(atoms, geom_file=GEOM_FILE, copy_files=copy_files)

Check warning on line 191 in src/quacc/recipes/dftb/core.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/dftb/core.py#L191

Added line #L191 was not covered by tests

if SETTINGS.CHECK_CONVERGENCE:
if check_logfile(LOG_FILE, "SCC is NOT converged"):
Expand Down
8 changes: 4 additions & 4 deletions src/quacc/recipes/emt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ase.optimize import FIRE

from quacc import job
from quacc.runners.calc import run_ase_calc, run_ase_opt
from quacc.runners.ase import run_calc, run_opt
from quacc.schemas.ase import summarize_opt_run, summarize_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -57,7 +57,7 @@ def static_job(
calc_swaps = calc_swaps or {}

atoms.calc = EMT(**calc_swaps)
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

return summarize_run(
final_atoms,
Expand Down Expand Up @@ -96,7 +96,7 @@ def relax_job(
opt_swaps
Dictionary of custom kwargs for the optimization process. Set a value
to `None` to remove a pre-existing key entirely. For a list of available
keys, refer to [quacc.runners.calc.run_ase_opt][].
keys, refer to [quacc.runners.ase.run_opt][].

!!! Info "Optimizer defaults"

Expand All @@ -119,6 +119,6 @@ def relax_job(

atoms.calc = EMT(**calc_swaps)

dyn = run_ase_opt(atoms, relax_cell=relax_cell, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, relax_cell=relax_cell, copy_files=copy_files, **opt_flags)

return summarize_opt_run(dyn, additional_fields={"name": "EMT Relax"})
4 changes: 2 additions & 2 deletions src/quacc/recipes/gaussian/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ase.calculators.gaussian import Gaussian

from quacc import SETTINGS, job
from quacc.runners.calc import run_ase_calc
from quacc.runners.ase import run_calc
from quacc.schemas.cclib import cclib_summarize_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -230,6 +230,6 @@ def _base_job(
flags = merge_dicts(defaults, calc_swaps)

atoms.calc = Gaussian(command=GAUSSIAN_CMD, label=_LABEL, **flags)
atoms = run_ase_calc(atoms, geom_file=LOG_FILE, copy_files=copy_files)
atoms = run_calc(atoms, geom_file=LOG_FILE, copy_files=copy_files)

return cclib_summarize_run(atoms, LOG_FILE, additional_fields=additional_fields)
4 changes: 2 additions & 2 deletions src/quacc/recipes/gulp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ase.calculators.gulp import GULP

from quacc import SETTINGS, job
from quacc.runners.calc import run_ase_calc
from quacc.runners.ase import run_calc
from quacc.schemas.ase import summarize_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -246,7 +246,7 @@ def _base_job(
options=gulp_options,
library=library,
)
final_atoms = run_ase_calc(
final_atoms = run_calc(
atoms,
geom_file=GEOM_FILE_PBC if atoms.pbc.any() else GEOM_FILE_NOPBC,
copy_files=copy_files,
Expand Down
14 changes: 7 additions & 7 deletions src/quacc/recipes/lj/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from quacc import job
from quacc.builders.thermo import build_ideal_gas
from quacc.runners.calc import run_ase_calc, run_ase_opt, run_ase_vib
from quacc.runners.ase import run_calc, run_opt, run_vib
from quacc.schemas.ase import summarize_opt_run, summarize_run, summarize_vib_and_thermo
from quacc.utils.dicts import merge_dicts

Expand All @@ -21,7 +21,7 @@

from ase import Atoms

from quacc.runners.calc import VibKwargs
from quacc.runners.ase import VibKwargs
from quacc.schemas.ase import OptSchema, RunSchema, VibThermoSchema


Expand Down Expand Up @@ -59,7 +59,7 @@ def static_job(
calc_swaps = calc_swaps or {}

atoms.calc = LennardJones(**calc_swaps)
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

return summarize_run(
final_atoms, input_atoms=atoms, additional_fields={"name": "LJ Static"}
Expand Down Expand Up @@ -93,7 +93,7 @@ def relax_job(
opt_swaps
Dictionary of custom kwargs for the optimization process. Set a value
to `None` to remove a pre-existing key entirely. For a list of available
keys, refer to [quacc.runners.calc.run_ase_opt][].
keys, refer to [quacc.runners.ase.run_opt][].

!!! Info "Optimizer defaults"

Expand All @@ -114,7 +114,7 @@ def relax_job(
opt_flags = merge_dicts(opt_defaults, opt_swaps)

atoms.calc = LennardJones(**calc_swaps)
dyn = run_ase_opt(atoms, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)

return summarize_opt_run(dyn, additional_fields={"name": "LJ Relax"})

Expand Down Expand Up @@ -154,7 +154,7 @@ def freq_job(
```
vib_kwargs
Dictionary of custom kwargs for the vibration analysis. Refer to
[quacc.runners.calc.run_ase_vib][].
[quacc.runners.ase.run_vib][].
copy_files
Files to copy to the runtime directory.

Expand All @@ -167,7 +167,7 @@ def freq_job(
vib_kwargs = vib_kwargs or {}

atoms.calc = LennardJones(**calc_swaps)
vibrations = run_ase_vib(atoms, vib_kwargs=vib_kwargs, copy_files=copy_files)
vibrations = run_vib(atoms, vib_kwargs=vib_kwargs, copy_files=copy_files)
igt = build_ideal_gas(atoms, vibrations.get_frequencies(), energy=energy)

return summarize_vib_and_thermo(
Expand Down
12 changes: 6 additions & 6 deletions src/quacc/recipes/newtonnet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from quacc import SETTINGS, job
from quacc.builders.thermo import build_ideal_gas
from quacc.runners.calc import run_ase_calc, run_ase_opt
from quacc.runners.ase import run_calc, run_opt
from quacc.schemas.ase import (
summarize_ideal_gas_thermo,
summarize_opt_run,
Expand Down Expand Up @@ -83,7 +83,7 @@ def static_job(
flags = merge_dicts(defaults, calc_swaps)

atoms.calc = NewtonNet(**flags)
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

return summarize_run(
final_atoms,
Expand Down Expand Up @@ -123,7 +123,7 @@ def relax_job(
opt_swaps
Dictionary of custom kwargs for the optimization process. Set a value
to `None` to remove a pre-existing key entirely. For a list of available
keys, refer to [quacc.runners.calc.run_ase_opt][].
keys, refer to [quacc.runners.ase.run_opt][].

!!! Info "Optimizer defaults"

Expand All @@ -149,7 +149,7 @@ def relax_job(
opt_flags = merge_dicts(opt_defaults, opt_swaps)

atoms.calc = NewtonNet(**flags)
dyn = run_ase_opt(atoms, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)

return _add_stdev_and_hess(
summarize_opt_run(dyn, additional_fields={"name": "NewtonNet Relax"})
Expand Down Expand Up @@ -206,7 +206,7 @@ def freq_job(

ml_calculator = NewtonNet(**flags)
atoms.calc = ml_calculator
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

summary = summarize_run(
final_atoms,
Expand Down Expand Up @@ -261,7 +261,7 @@ def _add_stdev_and_hess(summary: dict[str, Any]) -> dict[str, Any]:
)
atoms = conf["atoms"]
atoms.calc = ml_calculator
results = run_ase_calc(atoms).calc.results
results = run_calc(atoms).calc.results
conf["hessian"] = results["hessian"]
conf["energy_std"] = results["energy_disagreement"]
conf["forces_std"] = results["forces_disagreement"]
Expand Down
10 changes: 5 additions & 5 deletions src/quacc/recipes/newtonnet/ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from quacc import SETTINGS, job
from quacc.recipes.newtonnet.core import _add_stdev_and_hess, freq_job, relax_job
from quacc.runners.calc import run_ase_opt
from quacc.runners.ase import run_opt
from quacc.schemas.ase import summarize_opt_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -82,7 +82,7 @@ def ts_job(
opt_swaps
Dictionary of custom kwargs for the optimization process. Set a value
to `None` to remove a pre-existing key entirely. For a list of available
keys, refer to [quacc.runners.calc.run_ase_opt][].
keys, refer to [quacc.runners.ase.run_opt][].

!!! Info "Optimizer defaults"

Expand Down Expand Up @@ -131,7 +131,7 @@ def ts_job(
atoms.calc = ml_calculator

# Run the TS optimization
dyn = run_ase_opt(atoms, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)
opt_ts_summary = _add_stdev_and_hess(
summarize_opt_run(dyn, additional_fields={"name": "NewtonNet TS"})
)
Expand Down Expand Up @@ -188,7 +188,7 @@ def irc_job(
opt_swaps
Dictionary of custom kwargs for the optimization process. Set a value
to `None` to remove a pre-existing key entirely. For a list of available
keys, refer to [quacc.runners.calc.run_ase_opt][].
keys, refer to [quacc.runners.ase.run_opt][].

!!! Info "Optimizer defaults"

Expand Down Expand Up @@ -246,7 +246,7 @@ def irc_job(

# Run IRC
SETTINGS.CHECK_CONVERGENCE = False
dyn = run_ase_opt(atoms, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)
opt_irc_summary = _add_stdev_and_hess(
summarize_opt_run(
dyn, additional_fields={"name": f"NewtonNet IRC: {direction}"}
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/orca/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from ase.calculators.orca import ORCA, OrcaProfile, OrcaTemplate

from quacc import SETTINGS, job
from quacc.runners.calc import run_ase_calc
from quacc.runners.ase import run_calc
from quacc.schemas.cclib import cclib_summarize_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -275,7 +275,7 @@ def _base_job(
orcasimpleinput=orcasimpleinput,
orcablocks=orcablocks,
)
atoms = run_ase_calc(atoms, geom_file=GEOM_FILE, copy_files=copy_files)
atoms = run_calc(atoms, geom_file=GEOM_FILE, copy_files=copy_files)

return cclib_summarize_run(
atoms,
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/psi4/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from monty.dev import requires

from quacc import job
from quacc.runners.calc import run_ase_calc
from quacc.runners.ase import run_calc
from quacc.schemas.ase import summarize_run
from quacc.utils.dicts import merge_dicts

Expand Down Expand Up @@ -136,7 +136,7 @@
flags = merge_dicts(defaults, calc_swaps)

atoms.calc = Psi4(**flags)
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

Check warning on line 139 in src/quacc/recipes/psi4/core.py

View check run for this annotation

Codecov / codecov/patch

src/quacc/recipes/psi4/core.py#L139

Added line #L139 was not covered by tests

return summarize_run(
final_atoms,
Expand Down
10 changes: 5 additions & 5 deletions src/quacc/recipes/qchem/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from quacc import SETTINGS, job
from quacc.calculators.qchem import QChem
from quacc.runners.calc import run_ase_calc, run_ase_opt
from quacc.runners.ase import run_calc, run_opt
from quacc.schemas.ase import summarize_opt_run, summarize_run
from quacc.utils.dicts import merge_dicts, remove_dict_nones

Expand Down Expand Up @@ -420,7 +420,7 @@ def relax_job(
default values set therein as well as set additional Q-Chem parameters.
See QChemDictSet documentation for more details.
opt_swaps
Dictionary of custom kwargs for [quacc.runners.calc.run_ase_opt][]
Dictionary of custom kwargs for [quacc.runners.ase.run_opt][]
copy_files
Files to copy to the runtime directory.

Expand Down Expand Up @@ -499,7 +499,7 @@ def _base_job(
qchem_flags = remove_dict_nones(defaults)

atoms.calc = QChem(atoms, **qchem_flags)
final_atoms = run_ase_calc(atoms, copy_files=copy_files)
final_atoms = run_calc(atoms, copy_files=copy_files)

return summarize_run(
final_atoms,
Expand Down Expand Up @@ -535,7 +535,7 @@ def _base_opt_job(
opt_defaults
Default arguments for the ASE optimizer.
opt_swaps
Dictionary of custom kwargs for [quacc.runners.calc.run_ase_opt][]
Dictionary of custom kwargs for [quacc.runners.ase.run_opt][]
copy_files
Files to copy to the runtime directory.

Expand All @@ -551,7 +551,7 @@ def _base_opt_job(
opt_flags = merge_dicts(opt_defaults, opt_swaps)

atoms.calc = QChem(atoms, **qchem_flags)
dyn = run_ase_opt(atoms, copy_files=copy_files, **opt_flags)
dyn = run_opt(atoms, copy_files=copy_files, **opt_flags)

return summarize_opt_run(
dyn,
Expand Down
4 changes: 2 additions & 2 deletions src/quacc/recipes/qchem/ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def ts_job(
default values set therein as well as set additional Q-Chem parameters.
See QChemDictSet documentation for more details.
opt_swaps
Dictionary of custom kwargs for [quacc.runners.calc.run_ase_opt][]
Dictionary of custom kwargs for [quacc.runners.ase.run_opt][]
copy_files
Files to copy to the runtime directory.

Expand Down Expand Up @@ -238,7 +238,7 @@ def irc_job(
default values set therein as well as set additional Q-Chem parameters.
See QChemDictSet documentation for more details.
opt_swaps
Dictionary of custom kwargs for [quacc.runners.calc.run_ase_opt][]
Dictionary of custom kwargs for [quacc.runners.ase.run_opt][]
copy_files
Files to copy to the runtime directory.

Expand Down
Loading