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 ruff #392

Merged
merged 2 commits into from
Jan 30, 2025
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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.4
rev: v0.9.3
hooks:
# Run the linter.
- id: ruff
Expand Down
6 changes: 3 additions & 3 deletions janus_core/calculations/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ def write_bands(
labels = paths_info["labels"]
num_q_points = sum(len(q) for q in paths_info["paths"])
num_labels = len(labels)
assert (
num_q_points == num_labels
), "Number of labels is different to number of q-points specified"
assert num_q_points == num_labels, (
"Number of labels is different to number of q-points specified"
)

q_points, connections = get_band_qpoints_and_path_connections(
band_paths=paths_info["paths"], npoints=paths_info["npoints"]
Expand Down
3 changes: 1 addition & 2 deletions janus_core/helpers/mlip_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def choose_calculator(
# No default `model_path`
if model_path is None:
raise ValueError(
"Please specify `model_path`, as there is no "
f"default model for {arch}"
f"Please specify `model_path`, as there is no default model for {arch}"
)
# Default to float64 precision
kwargs.setdefault("default_dtype", "float64")
Expand Down
2 changes: 1 addition & 1 deletion janus_core/processing/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def components(self, components: list[str]):
"""
if any(components - self._allowed_components.keys()):
raise ValueError(
f"'{components-self._allowed_components.keys()}'"
f"'{components - self._allowed_components.keys()}'"
f" invalid, must be '{', '.join(self._allowed_components)}'"
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ docs = [

pre-commit = [
"pre-commit<4.0.0,>=3.6.0",
"ruff<1.0.0,>=0.7.4",
"ruff<1.0.0,>=0.9.3",
]

[build-system]
Expand Down