Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Numba as a dependency #2841

Merged
merged 8 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Continue removing Numba
  • Loading branch information
namurphy committed Aug 28, 2024
commit 3e72fa54c61dcc2723e0c7be75cdf0befff9bde0
8 changes: 2 additions & 6 deletions src/plasmapy/utils/decorators/lite_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import inspect
from collections.abc import Callable

from numba.extending import is_jitted


class _LiteFuncDict(dict):
"""
Expand Down Expand Up @@ -95,9 +93,7 @@ def foo(x):
" the 'lite_func' argument."
)

if inspect.isbuiltin(lite_func) or not (
is_jitted(lite_func) or inspect.isfunction(lite_func)
):
if inspect.isbuiltin(lite_func) or not inspect.isfunction(lite_func):
raise ValueError("The given lite-function is not a user-defined function.")

def decorator(f):
Expand All @@ -110,7 +106,7 @@ def wrapper(*args, **kwargs):
attrs["lite"] = lite_func
for bound_name, attr in attrs.items():
# only allow functions or jitted functions
if not (inspect.isfunction(attr) or is_jitted(attr)):
if not inspect.isfunction(attr):
raise ValueError(
f"Can not bind obj '{attr}' to function '{wrapper.__name__}'."
f" Only functions are allowed to be bound. Skipping."
Expand Down
Loading