forked from pygae/clifford
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup the @generated_jit leftovers (pygae#430)
The test_function_cache is rewritten to use @njit, which may not make much sense for particular test.
- Loading branch information
Showing
3 changed files
with
5 additions
and
48 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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
import numpy as np | ||
from clifford._numba_utils import generated_jit | ||
from clifford._numba_utils import njit | ||
import pytest | ||
|
||
|
||
@generated_jit(cache=True) | ||
def foo(x): | ||
from clifford.g3 import e3 | ||
|
||
def impl(x): | ||
return (x * e3).value | ||
return impl | ||
@njit(cache=True) | ||
def foo(x, y): | ||
return (x * y).value | ||
|
||
|
||
# Make the test fail on a failed cache warning | ||
@pytest.mark.filterwarnings("error") | ||
def test_function_cache(): | ||
from clifford.g3 import e3 | ||
np.testing.assert_array_equal((1.0*e3).value, foo(1.0)) | ||
np.testing.assert_array_equal((1.0*e3).value, foo(1.0, e3)) |