Skip to content

Commit

Permalink
Fix bug code dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 15, 2024
1 parent 1a658c1 commit 2f8d2f5
Show file tree
Hide file tree
Showing 132 changed files with 79 additions and 1,439 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
COV=pytest --cov --cov-config=pyproject.toml

develop:
pdm install
pdm sync --clean

black:
black -l 82 src _transonic_testing data_tests tests
Expand Down
2 changes: 1 addition & 1 deletion data_tests/saved__backend__/cython/block_fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# float64[][] diss2;
# float dt
# )
state_spect_n12[:] = (state_spect + ((dt / 2) * tendencies_n)) * diss2
state_spect_n12[:] = (state_spect + dt / 2 * tendencies_n) * diss2


arguments_blocks = {
Expand Down
3 changes: 1 addition & 2 deletions data_tests/saved__backend__/cython/blocks_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ def block0(a, b, n):
# int[:] a, b;
# float n
# )
result = ((a**2) + (b.mean() ** 3)) + n

result = a**2 + b.mean() ** 3 + n
return result


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from transonic_cl import cython

import numpy as np
from exterior_import_boost import func_import
from __ext__MyClass2__exterior_import_boost import func_import


def __for_method__MyClass2__myfunc(self_attr0, self_attr1, arg):
return ((self_attr1 + self_attr0) + np.abs(arg)) + func_import()
return self_attr1 + self_attr0 + np.abs(arg) + func_import()


__code_new_method__MyClass2__myfunc = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from transonic_cl import cython

import numpy as np
from exterior_import_boost import func_import
from __ext__func__exterior_import_boost import func_import


def func(a, b):
Expand Down
6 changes: 2 additions & 4 deletions data_tests/saved__backend__/cython/class_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def block0(a, b, n):
# foobar
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand All @@ -36,8 +35,7 @@ def block1(a, b, n):
# )
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand Down
12 changes: 7 additions & 5 deletions data_tests/saved__backend__/cython/class_rec_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@


def __for_method__Myclass__func(self_attr, self_attr2, arg):
if __for_method__Myclass__func(self_attr, self_attr2, (arg - 1)) < 1:
if __for_method__Myclass__func(self_attr, self_attr2, arg - 1) < 1:
return 1
else:
a = __for_method__Myclass__func(
self_attr, self_attr2, (arg - 1)
) * __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
self_attr, self_attr2, arg - 1
) * __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
return (
a + ((self_attr * self_attr2) * arg)
) + __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
a
+ self_attr * self_attr2 * arg
+ __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
)


__code_new_method__Myclass__func = """
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/cython/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


def __for_method__Transmitter____call__(self_arr, self_freq, inp):
"My docstring"
return ((inp * np.exp(((np.arange(len(inp)) * self_freq) * 1j))), self_arr)
"""My docstring"""
return (inp * np.exp(np.arange(len(inp)) * self_freq * 1j), self_arr)


__code_new_method__Transmitter____call__ = """
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/cython/row_sum_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ def row_sum(arr, columns):
def row_sum_loops(arr, columns):
# locals type annotations are used only for Cython
# arr.dtype not supported for memoryview
dtype = type(arr[(0, 0)])
dtype = type(arr[0, 0])
res = np.empty(arr.shape[0], dtype=dtype)
for i in range(arr.shape[0]):
sum_ = dtype(0)
for j in range(columns.shape[0]):
sum_ += arr[(i, columns[j])]
sum_ += arr[i, columns[j]]
res[i] = sum_
return res

Expand Down
2 changes: 1 addition & 1 deletion data_tests/saved__backend__/numba/block_fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# float64[][] diss2;
# float dt
# )
state_spect_n12[:] = (state_spect + ((dt / 2) * tendencies_n)) * diss2
state_spect_n12[:] = (state_spect + dt / 2 * tendencies_n) * diss2


arguments_blocks = {
Expand Down
2 changes: 1 addition & 1 deletion data_tests/saved__backend__/numba/blocks_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def block0(a, b, n):
# int[:] a, b;
# float n
# )
result = ((a**2) + (b.mean() ** 3)) + n
result = a**2 + b.mean() ** 3 + n
return result


Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/numba/boosted_class_use_import.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# __protected__ from numba import njit
import numpy as np
from exterior_import_boost import func_import
from __ext__MyClass2__exterior_import_boost import func_import

# __protected__ @njit(cache=True, fastmath=True)


def __for_method__MyClass2__myfunc(self_attr0, self_attr1, arg):
return ((self_attr1 + self_attr0) + np.abs(arg)) + func_import()
return self_attr1 + self_attr0 + np.abs(arg) + func_import()


__code_new_method__MyClass2__myfunc = "\n\ndef new_method(self, arg):\n return backend_func(self.attr0, self.attr1, arg)\n\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# __protected__ from numba import njit
import numpy as np
from exterior_import_boost import func_import
from __ext__func__exterior_import_boost import func_import

# __protected__ @njit(cache=True, fastmath=True)

Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/numba/class_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def block0(a, b, n):
# foobar
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)
result += a**2 + b**3
return result


Expand All @@ -36,7 +36,7 @@ def block1(a, b, n):
# )
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)
result += a**2 + b**3
return result


Expand Down
12 changes: 7 additions & 5 deletions data_tests/saved__backend__/numba/class_rec_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@


def __for_method__Myclass__func(self_attr, self_attr2, arg):
if __for_method__Myclass__func(self_attr, self_attr2, (arg - 1)) < 1:
if __for_method__Myclass__func(self_attr, self_attr2, arg - 1) < 1:
return 1
else:
a = __for_method__Myclass__func(
self_attr, self_attr2, (arg - 1)
) * __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
self_attr, self_attr2, arg - 1
) * __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
return (
a + ((self_attr * self_attr2) * arg)
) + __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
a
+ self_attr * self_attr2 * arg
+ __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
)


__code_new_method__Myclass__func = "\n\ndef new_method(self, arg):\n return backend_func(self.attr, self.attr2, arg)\n\n"
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/numba/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


def __for_method__Transmitter____call__(self_arr, self_freq, inp):
"My docstring"
return ((inp * np.exp(((np.arange(len(inp)) * self_freq) * 1j))), self_arr)
"""My docstring"""
return (inp * np.exp(np.arange(len(inp)) * self_freq * 1j), self_arr)


__code_new_method__Transmitter____call__ = "\n\ndef new_method(self, inp):\n return backend_func(self.arr, self.freq, inp)\n\n"
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/numba/row_sum_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ def row_sum(arr, columns):
def row_sum_loops(arr, columns):
# locals type annotations are used only for Cython
# arr.dtype not supported for memoryview
dtype = type(arr[(0, 0)])
dtype = type(arr[0, 0])
res = np.empty(arr.shape[0], dtype=dtype)
for i in range(arr.shape[0]):
sum_ = dtype(0)
for j in range(columns.shape[0]):
sum_ += arr[(i, columns[j])]
sum_ += arr[i, columns[j]]
res[i] = sum_
return res

Expand Down
2 changes: 1 addition & 1 deletion data_tests/saved__backend__/python/block_fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# float64[][] diss2;
# float dt
# )
state_spect_n12[:] = (state_spect + ((dt / 2) * tendencies_n)) * diss2
state_spect_n12[:] = (state_spect + dt / 2 * tendencies_n) * diss2


arguments_blocks = {
Expand Down
3 changes: 1 addition & 2 deletions data_tests/saved__backend__/python/blocks_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ def block0(a, b, n):
# int[:] a, b;
# float n
# )
result = ((a**2) + (b.mean() ** 3)) + n

result = a**2 + b.mean() ** 3 + n
return result


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
from exterior_import_boost import func_import
from __ext__MyClass2__exterior_import_boost import func_import


def __for_method__MyClass2__myfunc(self_attr0, self_attr1, arg):
return ((self_attr1 + self_attr0) + np.abs(arg)) + func_import()
return self_attr1 + self_attr0 + np.abs(arg) + func_import()


__code_new_method__MyClass2__myfunc = """
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from exterior_import_boost import func_import
from __ext__func__exterior_import_boost import func_import


def func(a, b):
Expand Down
6 changes: 2 additions & 4 deletions data_tests/saved__backend__/python/class_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def block0(a, b, n):
# foobar
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand All @@ -31,8 +30,7 @@ def block1(a, b, n):
# )
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand Down
12 changes: 7 additions & 5 deletions data_tests/saved__backend__/python/class_rec_calls.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
def __for_method__Myclass__func(self_attr, self_attr2, arg):
if __for_method__Myclass__func(self_attr, self_attr2, (arg - 1)) < 1:
if __for_method__Myclass__func(self_attr, self_attr2, arg - 1) < 1:
return 1
else:
a = __for_method__Myclass__func(
self_attr, self_attr2, (arg - 1)
) * __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
self_attr, self_attr2, arg - 1
) * __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
return (
a + ((self_attr * self_attr2) * arg)
) + __for_method__Myclass__func(self_attr, self_attr2, (arg - 1))
a
+ self_attr * self_attr2 * arg
+ __for_method__Myclass__func(self_attr, self_attr2, arg - 1)
)


__code_new_method__Myclass__func = """
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/python/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


def __for_method__Transmitter____call__(self_arr, self_freq, inp):
"My docstring"
return ((inp * np.exp(((np.arange(len(inp)) * self_freq) * 1j))), self_arr)
"""My docstring"""
return (inp * np.exp(np.arange(len(inp)) * self_freq * 1j), self_arr)


__code_new_method__Transmitter____call__ = """
Expand Down
4 changes: 2 additions & 2 deletions data_tests/saved__backend__/python/row_sum_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ def row_sum(arr, columns):
def row_sum_loops(arr, columns):
# locals type annotations are used only for Cython
# arr.dtype not supported for memoryview
dtype = type(arr[(0, 0)])
dtype = type(arr[0, 0])
res = np.empty(arr.shape[0], dtype=dtype)
for i in range(arr.shape[0]):
sum_ = dtype(0)
for j in range(columns.shape[0]):
sum_ += arr[(i, columns[j])]
sum_ += arr[i, columns[j]]
res[i] = sum_
return res

Expand Down
2 changes: 1 addition & 1 deletion data_tests/saved__backend__/pythran/block_fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# float64[][] diss2;
# float dt
# )
state_spect_n12[:] = (state_spect + ((dt / 2) * tendencies_n)) * diss2
state_spect_n12[:] = (state_spect + dt / 2 * tendencies_n) * diss2


arguments_blocks = {
Expand Down
3 changes: 1 addition & 2 deletions data_tests/saved__backend__/pythran/blocks_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ def block0(a, b, n):
# int[:] a, b;
# float n
# )
result = ((a**2) + (b.mean() ** 3)) + n

result = a**2 + b.mean() ** 3 + n
return result


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def __for_method__MyClass2__myfunc(self_attr0, self_attr1, arg):
return ((self_attr1 + self_attr0) + np.abs(arg)) + func_import()
return self_attr1 + self_attr0 + np.abs(arg) + func_import()


__code_new_method__MyClass2__myfunc = """
Expand Down
6 changes: 2 additions & 4 deletions data_tests/saved__backend__/pythran/class_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def block0(a, b, n):
# foobar
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand All @@ -31,8 +30,7 @@ def block1(a, b, n):
# )
result = np.zeros_like(a)
for _ in range(n):
result += (a**2) + (b**3)

result += a**2 + b**3
return result


Expand Down
Loading

0 comments on commit 2f8d2f5

Please sign in to comment.