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

[pre-commit.ci] pre-commit autoupdate #965

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
- id: check-yaml
exclude: devtools/conda.recipe/meta.yaml # doesn't play nice with jinja
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.21
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
Expand All @@ -29,7 +29,7 @@ repos:
- mdformat-config
# ----- Python formatting -----
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.4
hooks:
# Run ruff linter.
- id: ruff
Expand Down Expand Up @@ -63,7 +63,7 @@ repos:
- --remove-kernel-metadata
# ----- spellchecking -----
- repo: https://github.com/codespell-project/codespell/
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
exclude: doc/src/legal-notice.md
Expand Down
3 changes: 1 addition & 2 deletions doc/src/tutorials/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def hash_path(path):
sha256sum_actual = hash_path(out_file)
if sha256sum_actual != sha256sum:
raise RuntimeError(
f"hash mismatch:\n actual = \t{sha256sum_actual}\n"
f"desired = \t{sha256sum}"
f"hash mismatch:\n actual = \t{sha256sum_actual}\ndesired = \t{sha256sum}"
)
if print_status:
print("download successful.")
4 changes: 2 additions & 2 deletions weldx/asdf/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def resolve_schema(schema):
schema = get_schema_path(schema)
except ValueError as ve:
raise ValueError(
f"provided custom_schema '{schema}' " "does not exist."
f"provided custom_schema '{schema}' does not exist."
) from ve
return schema

Expand Down Expand Up @@ -427,7 +427,7 @@ def _handle_path(filename, mode) -> (IO, bool):
new_file_created = False
exists = pathlib.Path(filename).exists()
if not exists and mode == "r":
raise RuntimeError(f"file {filename} has be created," " but mode is 'r'.")
raise RuntimeError(f"file {filename} has be created, but mode is 'r'.")

if mode == "rw":
if not exists:
Expand Down
2 changes: 1 addition & 1 deletion weldx/asdf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def readline_replace_eol():
if isinstance(file, types_file_like.__args__):
if isinstance(file, TextIOBase):
raise ValueError(
"cannot read files opened in text mode. " "Please open in binary mode."
"cannot read files opened in text mode. Please open in binary mode."
)
if isinstance(file, SupportsFileReadWrite):
file.seek(0)
Expand Down
5 changes: 2 additions & 3 deletions weldx/asdf/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _validate_expected_list(list_expected):
if "..." in str(exp):
if "..." != exp:
raise WxSyntaxError(
f'"..." should not have additional properties:' f" {exp} was found."
f'"..." should not have additional properties: {exp} was found.'
)
validator = 2
elif "(" in str(exp):
Expand Down Expand Up @@ -417,8 +417,7 @@ def _validate_instance_shape(

if _dict_values is False:
raise ValidationError(
f"Shape {list_test[::-1]} does not match requirement "
f"{list_expected[::-1]}"
f"Shape {list_test[::-1]} does not match requirement {list_expected[::-1]}"
)

return _dict_values
Expand Down
2 changes: 1 addition & 1 deletion weldx/core/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __repr__(self):
representation += (
f"\nTime:\n\t{self.time}\n"
f"Values:\n\t{self.data.magnitude}\n"
f'Interpolation:\n\t{self._data.attrs["interpolation"]}\n'
f"Interpolation:\n\t{self._data.attrs['interpolation']}\n"
)
else:
representation += self.data.__repr__().replace(
Expand Down
4 changes: 2 additions & 2 deletions weldx/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def apply_translation(self, vector: pint.Quantity) -> DynamicShapeSegment:
p_idx = 0
p_name = f"translation_{p_idx}"
while p_name in params:
p_name = f"translation{(p_idx:= p_idx +1)}"
p_name = f"translation{(p_idx := p_idx + 1)}"

p = sympy.symbols(p_name)
params[p_name] = vector
Expand Down Expand Up @@ -2064,7 +2064,7 @@ def __init__(

if not len(interpolation_schemes) == len(profiles) - 1:
raise ValueError(
"Number of interpolations must be 1 less than number of " "profiles."
"Number of interpolations must be 1 less than number of profiles."
)

for i in range(len(profiles) - 1):
Expand Down
18 changes: 9 additions & 9 deletions weldx/tests/asdf_tests/test_asdf_groove.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ def test_asdf_groove(groove: IsoBaseGroove, expected_dtype):
tree = {k: groove}

with write_read_buffer_context(tree) as data:
assert isinstance(
data[k], expected_dtype
), f"Did not match expected type {expected_dtype} on item {data[k]}"
assert isinstance(data[k], expected_dtype), (
f"Did not match expected type {expected_dtype} on item {data[k]}"
)
# test content equality using dataclass built-in functions
assert (
groove == data[k]
), f"Could not correctly reconstruct groove of type {type(groove)}"
assert groove == data[k], (
f"Could not correctly reconstruct groove of type {type(groove)}"
)
# test to_profile
assert isinstance(
groove.to_profile(), Profile
), f"Error calling plot function of {type(groove)} "
assert isinstance(groove.to_profile(), Profile), (
f"Error calling plot function of {type(groove)} "
)

# call plot function
with _close_plot():
Expand Down
2 changes: 1 addition & 1 deletion weldx/tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2127,7 +2127,7 @@ def check_trace_segment_length(segment, tolerance=1e-9):
if math.isclose(relative_change, 1, abs_tol=tolerance / 10):
break
assert i < num_iterations - 1, (
"Segment length could not be " "determined numerically"
"Segment length could not be determined numerically"
)

assert math.isclose(length_numeric, segment.length.m, abs_tol=tolerance)
Expand Down
3 changes: 1 addition & 2 deletions weldx/tests/transformations/test_cs_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,7 @@ def test_comparison_data():


@pytest.mark.parametrize(
"csm_ref_time_day, lcs_times, lcs_ref_time_days, edges,"
"exp_time, exp_ref_time_day",
"csm_ref_time_day, lcs_times, lcs_ref_time_days, edges,exp_time, exp_ref_time_day",
[
# all systems are time dependent
("21", [[1, 5, 6], [3, 6, 9]], ["22", "21"], None, [2, 3, 6, 7, 9], "21"),
Expand Down
3 changes: 1 addition & 2 deletions weldx/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,7 @@ def _convert_other(time) -> pd.TimedeltaIndex | pd.DatetimeIndex:
continue

raise TypeError(
f"Could not convert {_input_type} "
f"to pd.DatetimeIndex or pd.TimedeltaIndex"
f"Could not convert {_input_type} to pd.DatetimeIndex or pd.TimedeltaIndex"
)

class _UnionDescriptor:
Expand Down
Loading