Skip to content

Commit d586190

Browse files
Merge pull request #310 from emmanuel-ferdman/master
Display the invalid identifier name on error
2 parents 9f6a8fb + f6c17f3 commit d586190

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel_tuner/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def check_restriction(restrict, params: dict) -> bool:
284284
return restrict(**selected_params)
285285
# otherwise, raise an error
286286
else:
287-
raise ValueError(f"Unkown restriction type {type(restrict)} ({restrict})")
287+
raise ValueError(f"Unknown restriction type {type(restrict)} ({restrict})")
288288

289289

290290
def check_restrictions(restrictions, params: dict, verbose: bool) -> bool:
@@ -352,7 +352,7 @@ def f_restrict(p):
352352

353353
elif isinstance(restrict, (InSetConstraint, NotInSetConstraint, SomeInSetConstraint, SomeNotInSetConstraint)):
354354
raise NotImplementedError(
355-
f"Restriction of the type {type(restrict)} is explicitely not supported in backwards compatibility mode, because the behaviour is too complex. Please rewrite this constraint to a function to use it with this algorithm."
355+
f"Restriction of the type {type(restrict)} is explicitly not supported in backwards compatibility mode, because the behaviour is too complex. Please rewrite this constraint to a function to use it with this algorithm."
356356
)
357357
else:
358358
raise TypeError(f"Unrecognized restriction {restrict}")
@@ -572,7 +572,7 @@ def get_total_timings(results, env, overhead_time):
572572
total_verification_time += result["verification_time"]
573573
total_benchmark_time += result["benchmark_time"]
574574

575-
# add the seperate times to the environment dict
575+
# add the separate time values to the environment dict
576576
env["total_framework_time"] = total_framework_time
577577
env["total_strategy_time"] = total_strategy_time
578578
env["total_compile_time"] = total_compile_time
@@ -748,7 +748,7 @@ def prepare_kernel_string(kernel_name, kernel_string, params, grid, threads, blo
748748
v = replace_param_occurrences(v, params)
749749

750750
if not k.isidentifier():
751-
raise ValueError("name is not a valid identifier: {k}")
751+
raise ValueError(f"name is not a valid identifier: {k}")
752752

753753
# Escape newline characters
754754
v = str(v)

0 commit comments

Comments
 (0)