Skip to content

Commit 1432f6d

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

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

src/fast_array_utils/numba.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,19 @@ def _loaded_relevant_parallel_runtime_probe_modules() -> tuple[str, ...]:
137137

138138
def _parallel_runtime_probe_code(modules: tuple[str, ...]) -> str:
139139
lines = [*(f"import {module}" for module in modules), "import numba", "import numpy as np", ""]
140-
lines.extend(
141-
[
142-
"@numba.njit(parallel=True, cache=False)",
143-
"def _probe(values):",
144-
" total = 0.0",
145-
" for i in numba.prange(values.shape[0]):",
146-
" total += values[i]",
147-
" return total",
148-
"",
149-
"values = np.arange(32, dtype=np.float64)",
150-
"assert _probe(values) == np.sum(values)",
151-
f"print({_PARALLEL_RUNTIME_PROBE_SENTINEL!r})",
152-
"",
153-
]
154-
)
140+
lines.extend([
141+
"@numba.njit(parallel=True, cache=False)",
142+
"def _probe(values):",
143+
" total = 0.0",
144+
" for i in numba.prange(values.shape[0]):",
145+
" total += values[i]",
146+
" return total",
147+
"",
148+
"values = np.arange(32, dtype=np.float64)",
149+
"assert _probe(values) == np.sum(values)",
150+
f"print({_PARALLEL_RUNTIME_PROBE_SENTINEL!r})",
151+
"",
152+
])
155153
return "\n".join(lines)
156154

157155

0 commit comments

Comments
 (0)