From eb40fcaf6c3a5f2e12b0e864c3e8b2c62a61127f Mon Sep 17 00:00:00 2001 From: alex-rakowski Date: Mon, 11 Dec 2023 22:55:55 -0800 Subject: [PATCH] fixing logic in cupy/cusignal_enabled --- pylops/utils/deps.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pylops/utils/deps.py b/pylops/utils/deps.py index ab1c5c2b..0e259177 100644 --- a/pylops/utils/deps.py +++ b/pylops/utils/deps.py @@ -255,14 +255,12 @@ def cusignal_import(message: Optional[str] = None): cupy_enabled = ( - True - if (cupy_import() is not None and int(os.getenv("CUPY_PYLOPS", 1)) == 1) - else False # noqa:F821,E501 + True if (cupy_import() is None and int(os.getenv("CUPY_PYLOPS", 1)) == 1) else False ) cusignal_enabled = ( True - if (cusignal_import() is not None and int(os.getenv("CUSIGNAL_PYLOPS", 1)) == 1) - else False # noqa:F821,E501 + if (cusignal_import() is None and int(os.getenv("CUSIGNAL_PYLOPS", 1)) == 1) + else False ) # cusignal_enabled = check_module_enabled("cusignal", "CUSIGNAL_PYLOPS") devito_enabled = util.find_spec("devito") is not None