Skip to content

Commit

Permalink
keep linter happy? (#1)
Browse files Browse the repository at this point in the history
* Add extended typing through janus_types module

* one

---------

Co-authored-by: Jacob Wilkins <jacob.wilkins@stfc.ac.uk>
Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 5, 2024
1 parent c5315e2 commit 1ff009c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
numpydoc_validation_exclude = {
r"\.__weakref__$",
r"\.__repr__$",
"janus_core\.janus_types\.",
r"janus_core\.janus_types",
}

intersphinx_mapping = {
Expand Down
25 changes: 8 additions & 17 deletions janus_core/janus_types.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
Module containing types used in Janus-Core
Module containing types used in Janus-Core.
"""

from collections.abc import Sequence
from pathlib import Path, PurePath
from typing import IO, Literal, Optional, Sequence, TypedDict, TypeVar, Union
from typing import IO, Literal, Optional, TypedDict, TypeVar, Union

from ase import Atoms
import numpy as np
Expand All @@ -21,9 +22,7 @@


class ASEReadArgs(TypedDict, total=False):
"""
Main arguments for ase.io.read.
"""
"""Main arguments for ase.io.read."""

filename: Union[str, PurePath, IO]
index: Union[int, slice, str]
Expand All @@ -33,9 +32,7 @@ class ASEReadArgs(TypedDict, total=False):


class ASEWriteArgs(TypedDict, total=False):
"""
Main arguments for ase.io.write.
"""
"""Main arguments for ase.io.write."""

filename: Union[str, PurePath, IO]
images: MaybeSequence[Atoms]
Expand All @@ -45,19 +42,15 @@ class ASEWriteArgs(TypedDict, total=False):


class ASEOptArgs(TypedDict, total=False):
"""
Main arugments for ase optimisers.
"""
"""Main arugments for ase optimisers."""

restart: Optional[bool]
logfile: Optional[PathLike]
trajectory: PathLike


class ASEOptRunArgs(TypedDict, total=False):
"""
Main arugments for running ase optimisers.
"""
"""Main arugments for running ase optimisers."""

fmax: float
steps: int
Expand All @@ -69,9 +62,7 @@ class ASEOptRunArgs(TypedDict, total=False):


class CalcResults(TypedDict, total=False):
"""
Return type from calculations.
"""
"""Return type from calculations."""

energy: MaybeList[float]
forces: MaybeList[NDArray[np.float64]]
Expand Down

0 comments on commit 1ff009c

Please sign in to comment.