Skip to content

Commit fb7a387

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7b4078f commit fb7a387

File tree

10 files changed

+21
-25
lines changed

10 files changed

+21
-25
lines changed

doc/src/tutorials/util.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def hash_path(path):
3939
sha256sum_actual = hash_path(out_file)
4040
if sha256sum_actual != sha256sum:
4141
raise RuntimeError(
42-
f"hash mismatch:\n actual = \t{sha256sum_actual}\n"
43-
f"desired = \t{sha256sum}"
42+
f"hash mismatch:\n actual = \t{sha256sum_actual}\ndesired = \t{sha256sum}"
4443
)
4544
if print_status:
4645
print("download successful.")

weldx/asdf/file.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def resolve_schema(schema):
348348
schema = get_schema_path(schema)
349349
except ValueError as ve:
350350
raise ValueError(
351-
f"provided custom_schema '{schema}' " "does not exist."
351+
f"provided custom_schema '{schema}' does not exist."
352352
) from ve
353353
return schema
354354

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

432432
if mode == "rw":
433433
if not exists:

weldx/asdf/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def readline_replace_eol():
301301
if isinstance(file, types_file_like.__args__):
302302
if isinstance(file, TextIOBase):
303303
raise ValueError(
304-
"cannot read files opened in text mode. " "Please open in binary mode."
304+
"cannot read files opened in text mode. Please open in binary mode."
305305
)
306306
if isinstance(file, SupportsFileReadWrite):
307307
file.seek(0)

weldx/asdf/validators.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def _validate_expected_list(list_expected):
284284
if "..." in str(exp):
285285
if "..." != exp:
286286
raise WxSyntaxError(
287-
f'"..." should not have additional properties:' f" {exp} was found."
287+
f'"..." should not have additional properties: {exp} was found.'
288288
)
289289
validator = 2
290290
elif "(" in str(exp):
@@ -417,8 +417,7 @@ def _validate_instance_shape(
417417

418418
if _dict_values is False:
419419
raise ValidationError(
420-
f"Shape {list_test[::-1]} does not match requirement "
421-
f"{list_expected[::-1]}"
420+
f"Shape {list_test[::-1]} does not match requirement {list_expected[::-1]}"
422421
)
423422

424423
return _dict_values

weldx/core/time_series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __repr__(self):
116116
representation += (
117117
f"\nTime:\n\t{self.time}\n"
118118
f"Values:\n\t{self.data.magnitude}\n"
119-
f'Interpolation:\n\t{self._data.attrs["interpolation"]}\n'
119+
f"Interpolation:\n\t{self._data.attrs['interpolation']}\n"
120120
)
121121
else:
122122
representation += self.data.__repr__().replace(

weldx/geometry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def apply_translation(self, vector: pint.Quantity) -> DynamicShapeSegment:
322322
p_idx = 0
323323
p_name = f"translation_{p_idx}"
324324
while p_name in params:
325-
p_name = f"translation{(p_idx:= p_idx +1)}"
325+
p_name = f"translation{(p_idx := p_idx + 1)}"
326326

327327
p = sympy.symbols(p_name)
328328
params[p_name] = vector
@@ -2064,7 +2064,7 @@ def __init__(
20642064

20652065
if not len(interpolation_schemes) == len(profiles) - 1:
20662066
raise ValueError(
2067-
"Number of interpolations must be 1 less than number of " "profiles."
2067+
"Number of interpolations must be 1 less than number of profiles."
20682068
)
20692069

20702070
for i in range(len(profiles) - 1):

weldx/tests/asdf_tests/test_asdf_groove.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ def test_asdf_groove(groove: IsoBaseGroove, expected_dtype):
4848
tree = {k: groove}
4949

5050
with write_read_buffer_context(tree) as data:
51-
assert isinstance(
52-
data[k], expected_dtype
53-
), f"Did not match expected type {expected_dtype} on item {data[k]}"
51+
assert isinstance(data[k], expected_dtype), (
52+
f"Did not match expected type {expected_dtype} on item {data[k]}"
53+
)
5454
# test content equality using dataclass built-in functions
55-
assert (
56-
groove == data[k]
57-
), f"Could not correctly reconstruct groove of type {type(groove)}"
55+
assert groove == data[k], (
56+
f"Could not correctly reconstruct groove of type {type(groove)}"
57+
)
5858
# test to_profile
59-
assert isinstance(
60-
groove.to_profile(), Profile
61-
), f"Error calling plot function of {type(groove)} "
59+
assert isinstance(groove.to_profile(), Profile), (
60+
f"Error calling plot function of {type(groove)} "
61+
)
6262

6363
# call plot function
6464
with _close_plot():

weldx/tests/test_geometry.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ def check_trace_segment_length(segment, tolerance=1e-9):
21272127
if math.isclose(relative_change, 1, abs_tol=tolerance / 10):
21282128
break
21292129
assert i < num_iterations - 1, (
2130-
"Segment length could not be " "determined numerically"
2130+
"Segment length could not be determined numerically"
21312131
)
21322132

21332133
assert math.isclose(length_numeric, segment.length.m, abs_tol=tolerance)

weldx/tests/transformations/test_cs_manager.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,7 @@ def test_comparison_data():
760760

761761

762762
@pytest.mark.parametrize(
763-
"csm_ref_time_day, lcs_times, lcs_ref_time_days, edges,"
764-
"exp_time, exp_ref_time_day",
763+
"csm_ref_time_day, lcs_times, lcs_ref_time_days, edges,exp_time, exp_ref_time_day",
765764
[
766765
# all systems are time dependent
767766
("21", [[1, 5, 6], [3, 6, 9]], ["22", "21"], None, [2, 3, 6, 7, 9], "21"),

weldx/time.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,7 @@ def _convert_other(time) -> pd.TimedeltaIndex | pd.DatetimeIndex:
716716
continue
717717

718718
raise TypeError(
719-
f"Could not convert {_input_type} "
720-
f"to pd.DatetimeIndex or pd.TimedeltaIndex"
719+
f"Could not convert {_input_type} to pd.DatetimeIndex or pd.TimedeltaIndex"
721720
)
722721

723722
class _UnionDescriptor:

0 commit comments

Comments
 (0)