Skip to content

Commit

Permalink
Fix option names (stfc#117)
Browse files Browse the repository at this point in the history
* Update option names to match janus

* Rename missed input structure

---------

Co-authored-by: federica <[email protected]>
Co-authored-by: ElliottKasoar <[email protected]>
  • Loading branch information
3 people authored May 2, 2024
1 parent c4fac19 commit db8f892
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
22 changes: 10 additions & 12 deletions examples/calculations/submit_geomopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def geomopt(params: dict) -> None:
structure = load_structure(params["struct"])

# Select model to use
model = load_model(params["model"], params["architecture"])
model = load_model(params["model"], params["arch"])

# Select calculation to use
geomoptCalculation = CalculationFactory("janus.opt")
Expand All @@ -36,12 +36,12 @@ def geomopt(params: dict) -> None:
inputs = {
"metadata": {"options": {"resources": {"num_machines": 1}}},
"code": params["code"],
"architecture": Str(params["architecture"]),
"structure": structure,
"arch": Str(params["arch"]),
"struct": structure,
"model": model,
"precision": Str(params["precision"]),
"device": Str(params["device"]),
"max_force": Float(params["max_force"]),
"fmax": Float(params["fmax"]),
"vectors_only": Bool(params["vectors_only"]),
"fully_opt": Bool(params["fully_opt"]),
"opt_kwargs": Dict({"restart": "rest.pkl"}),
Expand Down Expand Up @@ -70,7 +70,7 @@ def geomopt(params: dict) -> None:
help="Specify path or url of the model to use",
)
@click.option(
"--architecture",
"--arch",
default="mace_mp",
type=str,
help="MLIP architecture to use for calculations.",
Expand All @@ -81,9 +81,7 @@ def geomopt(params: dict) -> None:
@click.option(
"--precision", default="float64", type=str, help="Chosen level of precision."
)
@click.option(
"--max_force", default=0.1, type=float, help="Maximum force for convergence."
)
@click.option("--fmax", default=0.1, type=float, help="Maximum force for convergence.")
@click.option(
"--vectors_only",
default=False,
Expand All @@ -103,10 +101,10 @@ def cli(
codelabel,
struct,
model,
architecture,
arch,
device,
precision,
max_force,
fmax,
vectors_only,
fully_opt,
steps,
Expand All @@ -123,10 +121,10 @@ def cli(
"code": code,
"struct": struct,
"model": model,
"architecture": architecture,
"arch": arch,
"device": device,
"precision": precision,
"max_force": max_force,
"fmax": fmax,
"vectors_only": vectors_only,
"fully_opt": fully_opt,
"steps": steps,
Expand Down
10 changes: 5 additions & 5 deletions examples/calculations/submit_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def MD(params: dict) -> None:
structure = load_structure(params["struct"])

# Select model to use
model = load_model(params["model"], params["architecture"])
model = load_model(params["model"], params["arch"])

# Select calculation to use
MDCalculation = CalculationFactory("janus.md")
Expand All @@ -38,7 +38,7 @@ def MD(params: dict) -> None:
inputs = {
"metadata": {"options": {"resources": {"num_machines": 1}}},
"code": params["code"],
"arch": Str(params["architecture"]),
"arch": Str(params["arch"]),
"struct": structure,
"model": model,
"precision": Str(params["precision"]),
Expand Down Expand Up @@ -69,7 +69,7 @@ def MD(params: dict) -> None:
help="Specify path or url of the model to use",
)
@click.option(
"--architecture",
"--arch",
default="mace_mp",
type=str,
help="MLIP architecture to use for calculations.",
Expand All @@ -90,7 +90,7 @@ def MD(params: dict) -> None:
help="String containing a dictionary with other md parameters",
)
def cli(
codelabel, struct, model, architecture, device, precision, ensemble, md_dict_str
codelabel, struct, model, arch, device, precision, ensemble, md_dict_str
) -> None:
"""Click interface."""
# pylint: disable=too-many-arguments
Expand All @@ -105,7 +105,7 @@ def cli(
"code": code,
"struct": struct,
"model": model,
"architecture": architecture,
"arch": arch,
"device": device,
"precision": precision,
"ensemble": ensemble,
Expand Down
12 changes: 6 additions & 6 deletions examples/calculations/submit_singlepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def singlepoint(params: dict) -> None:
structure = load_structure(params["struct"])

# Select model to use
model = load_model(params["model"], params["architecture"])
model = load_model(params["model"], params["arch"])

# Select calculation to use
singlePointCalculation = CalculationFactory("janus.sp")
Expand All @@ -36,8 +36,8 @@ def singlepoint(params: dict) -> None:
inputs = {
"metadata": {"options": {"resources": {"num_machines": 1}}},
"code": params["code"],
"architecture": Str(params["architecture"]),
"structure": structure,
"arch": Str(params["arch"]),
"struct": structure,
"model": model,
"precision": Str(params["precision"]),
"device": Str(params["device"]),
Expand Down Expand Up @@ -65,7 +65,7 @@ def singlepoint(params: dict) -> None:
help="Specify path or url of the model to use",
)
@click.option(
"--architecture",
"--arch",
default="mace_mp",
type=str,
help="MLIP architecture to use for calculations.",
Expand All @@ -76,7 +76,7 @@ def singlepoint(params: dict) -> None:
@click.option(
"--precision", default="float64", type=str, help="Chosen level of precision."
)
def cli(codelabel, struct, model, architecture, device, precision) -> None:
def cli(codelabel, struct, model, arch, device, precision) -> None:
# pylint: disable=too-many-arguments
"""Click interface."""
try:
Expand All @@ -89,7 +89,7 @@ def cli(codelabel, struct, model, architecture, device, precision) -> None:
"code": code,
"struct": struct,
"model": model,
"architecture": architecture,
"arch": arch,
"device": device,
"precision": precision,
}
Expand Down

0 comments on commit db8f892

Please sign in to comment.