Skip to content

Commit

Permalink
Remove slowconv from defaults and make executable commands str ty…
Browse files Browse the repository at this point in the history
…pe (#1946)

## Summary of Changes

1. Remove `slowconv` from ORCA recipe defaults
2. Make the various executable commands `str` type instead of `Path`
type since apparently (?) there is the possibility for a weird
permission error if it's a `Path`. Not quite sure how, but alas...

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Andrew-S-Rosen and pre-commit-ci[bot] committed Mar 26, 2024
1 parent 72e24de commit 376945a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Changed

- Calculator executable commands are now `str` type instead of `Path`
- Removed `slowconv` from the default parameters of the ORCA recipes
- The Q-Chem calculator now uses the TaskDoc from emmet in its `results` attribute

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/quacc/recipes/onetep/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _prep_calculator(
pseudo_path=str(SETTINGS.ONETEP_PP_PATH) if SETTINGS.ONETEP_PP_PATH else ".",
parallel_info=SETTINGS.ONETEP_PARALLEL_CMD,
profile=OnetepProfile(
str(SETTINGS.ONETEP_CMD)
SETTINGS.ONETEP_CMD
), # TODO: If the ASE merge is successful, we need to change ONETEP_PARALLEL_CMD to a list[str] and remove parallel info.
# If we also have access to post_args we can point not to the binary but to the launcher which takes -t nthreads as a post_args
**calc_flags,
Expand Down
6 changes: 3 additions & 3 deletions src/quacc/recipes/orca/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def static_job(
See the type-hint for the data structure.
"""
nprocs = psutil.cpu_count(logical=False) if nprocs == "max" else nprocs
default_inputs = [xc, basis, "engrad", "normalprint", "slowconv"]
default_inputs = [xc, basis, "engrad", "normalprint"]
default_blocks = [f"%pal nprocs {nprocs} end"]

return run_and_summarize(
Expand Down Expand Up @@ -132,7 +132,7 @@ def relax_job(
"""
nprocs = psutil.cpu_count(logical=False) if nprocs == "max" else nprocs

default_inputs = [xc, basis, "normalprint", "opt", "slowconv"]
default_inputs = [xc, basis, "normalprint", "opt"]
if run_freq:
default_inputs.append("freq")

Expand Down Expand Up @@ -200,7 +200,7 @@ def ase_relax_job(
See the type-hint for the data structure.
"""
nprocs = psutil.cpu_count(logical=False) if nprocs == "max" else nprocs
default_inputs = [xc, basis, "engrad", "normalprint", "slowconv"]
default_inputs = [xc, basis, "engrad", "normalprint"]
default_blocks = [f"%pal nprocs {nprocs} end"]

return run_and_summarize_opt(
Expand Down
17 changes: 6 additions & 11 deletions src/quacc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class QuaccSettings(BaseSettings):
# ---------------------------
# ORCA Settings
# ---------------------------
ORCA_CMD: Path = Field(
Path(which("orca") or "orca"),
ORCA_CMD: str = Field(
which("orca") or "orca",
description=(
"""
Path to the ORCA executable. This must be the full, absolute path
Expand Down Expand Up @@ -195,15 +195,13 @@ class QuaccSettings(BaseSettings):
# ---------------------------
# Gaussian Settings
# ---------------------------
GAUSSIAN_CMD: Path = Field(
Path("g16"), description=("Path to the Gaussian executable.")
)
GAUSSIAN_CMD: str = Field("g16", description=("Path to the Gaussian executable."))

# ---------------------------
# ONETEP Settings
# ---------------------------
ONETEP_CMD: Optional[Path] = Field(
Path("onetep.arch"), description=("Path to the ONETEP executable.")
ONETEP_CMD: Optional[str] = Field(
"onetep.arch", description=("Path to the ONETEP executable.")
)
ONETEP_PARALLEL_CMD: Optional[dict] = Field(
None,
Expand All @@ -218,7 +216,7 @@ class QuaccSettings(BaseSettings):
# ---------------------------
# GULP Settings
# ---------------------------
GULP_CMD: Path = Field(Path("gulp"), description=("Path to the GULP executable."))
GULP_CMD: str = Field("gulp", description=("Path to the GULP executable."))
GULP_LIB: Optional[Path] = Field(
None,
description=(
Expand Down Expand Up @@ -425,10 +423,7 @@ class QuaccSettings(BaseSettings):
"SCRATCH_DIR",
"ESPRESSO_PRESET_DIR",
"ESPRESSO_PSEUDO",
"GAUSSIAN_CMD",
"GULP_CMD",
"GULP_LIB",
"ORCA_CMD",
"QCHEM_LOCAL_SCRATCH",
"NEWTONNET_MODEL_PATH",
"VASP_PRESET_DIR",
Expand Down
18 changes: 7 additions & 11 deletions tests/core/recipes/orca_recipes/test_orca_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_static_job(tmp_path, monkeypatch):
assert output["natoms"] == len(atoms)
assert (
output["parameters"]["orcasimpleinput"]
== "def2-tzvp engrad normalprint slowconv wb97x-d3bj xyzfile"
== "def2-tzvp engrad normalprint wb97x-d3bj xyzfile"
)
assert output["parameters"]["charge"] == 0
assert output["parameters"]["mult"] == 1
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_static_job_parallel(tmp_path, monkeypatch):
assert output["parameters"]["mult"] == 3
assert (
output["parameters"]["orcasimpleinput"]
== "def2-svp engrad normalprint slowconv wb97x-d3bj xyzfile"
== "def2-svp engrad normalprint wb97x-d3bj xyzfile"
)
assert "%scf maxiter 300 end" in output["parameters"]["orcablocks"]
assert output.get("attributes")
Expand All @@ -64,7 +64,7 @@ def test_relax_job(tmp_path, monkeypatch):
assert output["parameters"]["mult"] == 1
assert (
output["parameters"]["orcasimpleinput"]
== "def2-tzvp normalprint opt slowconv wb97x-d3bj xyzfile"
== "def2-tzvp normalprint opt wb97x-d3bj xyzfile"
)
assert output["trajectory"][0] != output["trajectory"][-1]

Expand All @@ -78,8 +78,7 @@ def test_relax_job(tmp_path, monkeypatch):
)
assert output["natoms"] == len(atoms)
assert (
output["parameters"]["orcasimpleinput"]
== "def2-svp hf normalprint opt slowconv xyzfile"
output["parameters"]["orcasimpleinput"] == "def2-svp hf normalprint opt xyzfile"
)
assert (
output["parameters"]["orcablocks"] == "%pal nprocs 2 end\n%scf maxiter 300 end"
Expand All @@ -102,16 +101,13 @@ def test_relax_freq_job(tmp_path, monkeypatch):
charge=0,
spin_multiplicity=1,
nprocs=2,
orcasimpleinput=["#slowconv"],
orcasimpleinput=["#normalprint"],
run_freq=True,
)
assert output["natoms"] == len(atoms)
assert output["parameters"]["charge"] == 0
assert output["parameters"]["mult"] == 1
assert (
output["parameters"]["orcasimpleinput"]
== "def2-svp freq hf normalprint opt xyzfile"
)
assert output["parameters"]["orcasimpleinput"] == "def2-svp freq hf opt xyzfile"
assert output["trajectory"][0] != output["trajectory"][-1]


Expand All @@ -126,7 +122,7 @@ def test_ase_relax_job(tmp_path, monkeypatch):
assert output["parameters"]["mult"] == 1
assert (
output["parameters"]["orcasimpleinput"]
== "def2-tzvp engrad normalprint slowconv wb97x-d3bj xyzfile"
== "def2-tzvp engrad normalprint wb97x-d3bj xyzfile"
)
assert output["fmax"] == 0.1
assert output.get("trajectory")
Expand Down

0 comments on commit 376945a

Please sign in to comment.