Skip to content

Commit

Permalink
Fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Feb 20, 2024
1 parent 9c4d3bd commit c58ebd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 13 additions & 15 deletions janus_core/geom_opt.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""Geometry optimisation."""

from __future__ import annotations

from pathlib import Path
from typing import Any
from typing import Any, Union

from ase import Atoms
from ase.io import write
Expand All @@ -19,13 +17,13 @@
def optimize(
atoms: Atoms,
fmax: float = 0.1,
dyn_kwargs: dict[str, Any] | None = None,
filter_func: callable | None = DefaultFilter,
filter_kwargs: dict[str, Any] | None = None,
dyn_kwargs: Union[dict[str, Any], None] = None,
filter_func: Union[callable, None] = DefaultFilter,
filter_kwargs: Union[dict[str, Any], None] = None,
optimizer: callable = LBFGS,
opt_kwargs: dict[str, Any] | None = None,
save_path: Path | str | None = None,
save_kwargs: dict[str, Any] | None = None,
opt_kwargs: Union[dict[str, Any], None] = None,
save_path: Union[Path, str, None] = None,
save_kwargs: Union[dict[str, Any], None] = None,
) -> Atoms:
"""Optimize geometry of input structure.
Expand All @@ -35,19 +33,19 @@ def optimize(
Atoms object to optimize geometry for.
fmax : float
Set force convergence criteria for optimizer in units eV/Å.
dyn_kwargs : dict[str, Any] | None
dyn_kwargs : Union[dict[str, Any], None]
kwargs to pass to dyn.run. Default is None.
filter_func : callable | None
filter_func : Union[callable, None]
Apply constraints to atoms through ASE filter function. Default is `FrechetCellFilter`.
filter_kwargs : dict[str, Any] | None
filter_kwargs : Union[dict[str, Any], None]
kwargs to pass to filter_func. Default is None.
optimzer : callable
ASE optimization function. Default is `LBFGS`.
opt_kwargs : dict[str, Any] | None
opt_kwargs : Union[dict[str, Any], None]
kwargs to pass to optimzer. Default is None.
save_path : Path | str | None
save_path : Union[Path, str, None]
Path to save optimised structure. Default is None.
save_kwargs : dict[str, Any] | None
save_kwargs : Union[dict[str, Any], None]
kwargs to pass to ase.io.write. Default is None.
Returns
Expand Down
2 changes: 1 addition & 1 deletion janus_core/single_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def run_single_point(
Returns
-------
results : Dict[str, Any]
results : dict[str, Any]
Dictionary of calculated results.
"""
results = {}
Expand Down

0 comments on commit c58ebd1

Please sign in to comment.