-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow passing missing data to generalized ufuncs.
- Loading branch information
1 parent
9bfa30c
commit 8f870a4
Showing
5 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Infrastructure for testing Numba. | ||
Numba releases often lag for a few months after Python releases, so we don't | ||
want Numba to be a blocker for Python 3.X support. So this minimally emulates | ||
the Numba module, while allowing for the fact that Numba may not be installed. | ||
""" | ||
|
||
import pytest | ||
|
||
try: | ||
from numba import float64, guvectorize # type: ignore[import-untyped] | ||
except ImportError: | ||
float64 = [] | ||
|
||
def guvectorize(_a, _b): # type: ignore[no-untyped-def] | ||
"""When Numba is unavailable, skip tests using the decorated function.""" | ||
|
||
def decorator(_): # type: ignore[no-untyped-def] | ||
def skip(*_args, **_kwargs): # type: ignore[no-untyped-def] | ||
pytest.skip("Numba not available") | ||
|
||
return skip | ||
|
||
return decorator | ||
|
||
|
||
__all__ = ["guvectorize", "float64"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters