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

Update docs #340

Merged
merged 2 commits into from
Oct 31, 2024
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 docs/source/developer_guide/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Rules enforced by ruff are currently set up to be comparable to:
- `isort <https://pycqa.github.io/isort/>`_ (import sorter)
- `flake8-bugbear <https://pypi.org/project/flake8-bugbear/>`_ (bug finder)

The full set of `ruff rules <https://docs.astral.sh/ruff/rules/>`_ are specified by the ``[tool.ruff]]`` sections of `pyproject.toml <https://github.com/stfc/janus-core/blob/main/pyproject.toml>`
The full set of `ruff rules <https://docs.astral.sh/ruff/rules/>`_ are specified by the ``[tool.ruff]`` sections of `pyproject.toml <https://github.com/stfc/janus-core/blob/main/pyproject.toml>`_.


Building the documentation
Expand Down
6 changes: 3 additions & 3 deletions janus_core/calculations/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def __init__(

self._parse_correlations()

def _set_info(self):
def _set_info(self) -> None:
"""Set time in fs, current dynamics step, and density to info."""
time = (self.offset * self.timestep + self.dyn.get_time()) / units.fs
step = self.offset + self.dyn.nsteps
Expand Down Expand Up @@ -631,7 +631,7 @@ def _optimize_structure(self) -> None:
optimizer = GeomOpt(self.struct, **self.minimize_kwargs)
optimizer.run()

def _set_param_prefix(self, file_prefix: Optional[PathLike] = None):
def _set_param_prefix(self, file_prefix: Optional[PathLike] = None) -> str:
"""
Set ensemble parameters for output files.

Expand Down Expand Up @@ -1205,7 +1205,7 @@ def __init__(
**ensemble_kwargs,
)

def _set_param_prefix(self, file_prefix: Optional[PathLike] = None):
def _set_param_prefix(self, file_prefix: Optional[PathLike] = None) -> str:
"""
Set ensemble parameters for output files.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def descriptors(
write_kwargs: WriteKwargs = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Calculate MLIP descriptors for the given structure(s).

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def eos(
] = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Calculate equation of state and write out results.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/geomopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def geomopt(
write_kwargs: WriteKwargs = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Perform geometry optimization and save optimized structure to file.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def md(
] = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Run molecular dynamics simulation, and save trajectory and statistics.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def phonons(
] = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Perform phonon calculations and write out results.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/singlepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def singlepoint(
write_kwargs: WriteKwargs = None,
log: LogPath = None,
summary: Summary = None,
):
) -> None:
"""
Perform single point calculations and save to file.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/cli/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def train(
)
),
] = Path("train-summary.yml"),
):
) -> None:
"""
Run training for MLIP by passing a configuration file to the MLIP's CLI.

Expand Down
4 changes: 2 additions & 2 deletions janus_core/cli/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TyperDict:
Value of string representing a dictionary.
"""

def __init__(self, value: str):
def __init__(self, value: str) -> None:
"""
Initialise class.

Expand All @@ -52,7 +52,7 @@ def __init__(self, value: str):
"""
self.value = value

def __str__(self):
def __str__(self) -> str:
"""
Return string representation of class.

Expand Down
10 changes: 5 additions & 5 deletions janus_core/helpers/correlator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Correlator:
Averaging window per block level.
"""

def __init__(self, *, blocks: int, points: int, averaging: int):
def __init__(self, *, blocks: int, points: int, averaging: int) -> None:
"""
Initialise an empty Correlator.

Expand All @@ -50,7 +50,7 @@ def __init__(self, *, blocks: int, points: int, averaging: int):
self._correlation = np.zeros((self._blocks, self._points))
self._count_correlated = np.zeros((self._blocks, self._points), dtype=int)

def update(self, a: float, b: float):
def update(self, a: float, b: float) -> None:
"""
Update the correlation, <ab>, with new values a and b.

Expand All @@ -63,7 +63,7 @@ def update(self, a: float, b: float):
"""
self._propagate(a, b, 0)

def _propagate(self, a: float, b: float, block: int):
def _propagate(self, a: float, b: float, block: int) -> None:
"""
Propagate update down block hierarchy.

Expand Down Expand Up @@ -203,7 +203,7 @@ def __init__(
points: int,
averaging: int,
update_frequency: int,
):
) -> None:
"""
Initialise a correlation.

Expand Down Expand Up @@ -252,7 +252,7 @@ def update_frequency(self) -> int:
"""
return self._update_frequency

def update(self, atoms: Atoms):
def update(self, atoms: Atoms) -> None:
"""
Update a correlation.

Expand Down
2 changes: 1 addition & 1 deletion janus_core/helpers/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Stress:
Calculate with the ideal gas contribution.
"""

def __init__(self, component: str, *, include_ideal_gas: bool = True):
def __init__(self, component: str, *, include_ideal_gas: bool = True) -> None:
"""
Initialise the observables from a symbolic str component.

Expand Down
6 changes: 3 additions & 3 deletions janus_core/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(
struct_path: Optional[PathLike],
file_prefix: Optional[PathLike],
*additional,
):
) -> None:
"""
Provide mixin functions for standard filename handling.

Expand Down Expand Up @@ -643,7 +643,7 @@ def _dump_ascii(
header: list[str],
columns: dict[str, Sequence[Any]],
formats: Sequence[str],
):
) -> None:
"""
Dump data as an ASCII style table.

Expand Down Expand Up @@ -675,7 +675,7 @@ def _dump_csv(
header: list[str],
columns: dict[str, Sequence[Any]],
formats: Sequence[str],
):
) -> None:
"""
Dump data as a csv style table.

Expand Down