From 7de92e1b50ce88285bbd27a4498442fd87d5b233 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Tue, 14 Feb 2023 19:21:59 +0200 Subject: [PATCH] silence new flake8-bugbear B028 error --- sumpy/tools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sumpy/tools.py b/sumpy/tools.py index 5dd536c9..f9abe6b7 100644 --- a/sumpy/tools.py +++ b/sumpy/tools.py @@ -1194,12 +1194,13 @@ def _get_fft_backend(queue) -> FFTBackend: try: import pyvkfft.opencl # noqa: F401 except ImportError: - warnings.warn("VkFFT not found. FFT runs will be slower.") + warnings.warn("VkFFT not found. FFT runs will be slower.", stacklevel=3) return FFTBackend.loopy if queue.properties & cl.command_queue_properties.OUT_OF_ORDER_EXEC_MODE_ENABLE: - warnings.warn("VkFFT does not support out of order queues yet. " - "Falling back to slower implementation.") + warnings.warn( + "VkFFT does not support out of order queues yet. " + "Falling back to slower implementation.", stacklevel=3) return FFTBackend.loopy import platform @@ -1207,9 +1208,10 @@ def _get_fft_backend(queue) -> FFTBackend: and platform.machine() == "x86_64" and queue.context.devices[0].platform.name == "Portable Computing Language"): - warnings.warn("Pocl miscompiles some VkFFT kernels. " + warnings.warn( + "PoCL miscompiles some VkFFT kernels. " "See https://github.com/inducer/sumpy/issues/129. " - "Falling back to slower implementation.") + "Falling back to slower implementation.", stacklevel=3) return FFTBackend.loopy return FFTBackend.pyvkfft -- GitLab