Skip to content

Commit

Permalink
Change site url in mkdocs.yml (#23)
Browse files Browse the repository at this point in the history
* Change site url in mkdocs.yml

* pre-commit auto-fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tomdemeyere and pre-commit-ci[bot] authored Jan 6, 2025
1 parent 4c77159 commit 77663f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nav:

repo_url: https://github.com/Atomic-Samplers/quansino/
edit_uri: blob/main/docs/
site_url: https://atomic-samplers.github.io/quansino/

theme:
favicon: images/water.png
Expand Down
21 changes: 14 additions & 7 deletions src/quansino/io/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
from quansino.utils.strings import get_auto_header_format

if TYPE_CHECKING:
from collections.abc import Callable
from pathlib import Path
from typing import IO, Any, Callable
from typing import IO, Any

from ase import Atoms
from ase.md.md import MolecularDynamics
Expand Down Expand Up @@ -113,8 +114,8 @@ def add_field(
)
```
"""
if isinstance(name, (list, tuple, np.ndarray)):
assert isinstance(str_format, (list, tuple, np.ndarray))
if isinstance(name, list | tuple | np.ndarray):
assert isinstance(str_format, list | tuple | np.ndarray)
assert len(name) == len(str_format)
self._is_field_list[function] = True
else:
Expand Down Expand Up @@ -142,7 +143,9 @@ def add_mc_fields(self, simulation: MonteCarlo) -> None:
functions = [lambda: simulation.nsteps, simulation.atoms.get_potential_energy]
str_formats = ["<12d", ">12.4f"]

for name, function, str_format in zip(names, functions, str_formats):
for name, function, str_format in zip(
names, functions, str_formats, strict=False
):
self.add_field(name, function, str_format)

def add_md_fields(self, dyn: MolecularDynamics) -> None:
Expand Down Expand Up @@ -171,7 +174,9 @@ def add_md_fields(self, dyn: MolecularDynamics) -> None:
]
str_formats = ["<12.4f"] + [">12.4f"] * 3 + [">10.2f"]

for name, function, str_format in zip(names, functions, str_formats):
for name, function, str_format in zip(
names, functions, str_formats, strict=False
):
self.add_field(name, function, str_format)

def add_opt_fields(self, optimizer: Optimizer) -> None:
Expand Down Expand Up @@ -200,7 +205,9 @@ def add_opt_fields(self, optimizer: Optimizer) -> None:
]
str_formats = ["<24s"] + [">4d"] + [">12s"] + [">12.4f"] * 2

for name, function, str_format in zip(names, functions, str_formats):
for name, function, str_format in zip(
names, functions, str_formats, strict=False
):
self.add_field(name, function, str_format)

def add_stress_fields(
Expand Down Expand Up @@ -295,7 +302,7 @@ def _create_header_format(self) -> str:
to_write.extend(
[
f"{n:{get_auto_header_format(fmt)}}"
for n, fmt in zip(name, str_format)
for n, fmt in zip(name, str_format, strict=False)
]
)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/quansino/mc/fbmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def masses_scaling_power(
indices = self.atoms.symbols == el
self._masses_scaling_power[indices, :] = value.get(el, 0.25)

elif isinstance(value, (float, np.floating)):
elif isinstance(value, float | np.floating):
self._masses_scaling_power = np.full(self._size, value)
elif isinstance(value, np.ndarray):
assert value.shape == self._size
Expand Down
2 changes: 1 addition & 1 deletion src/quansino/typing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module for type hints.
This module provides type hints for various data structures used throughout the quansino package.
These type hints help ensure type safety and improve code readability by clearly defining
These type hints help ensure type safety and improve code readability by clearly defining
the expected data types and structures.
Examples
Expand Down

0 comments on commit 77663f6

Please sign in to comment.