Skip to content

Commit

Permalink
Modify saved files for Python backend
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Aug 22, 2024
1 parent 1bd0c36 commit 6e97a30
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 25 deletions.
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/add_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ def use_add(n=10000):
return tmp


__transonic__ = ("0.3.2",)
def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/assign_func_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ def func(x):
return x**2


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"
17 changes: 13 additions & 4 deletions data_tests/saved__backend__/python/block_fluidsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
state_spect_n12[:] = (state_spect + dt / 2 * tendencies_n) * diss2


arguments_blocks = {
"rk2_step0": ["state_spect_n12", "state_spect", "tendencies_n", "diss2", "dt"]
}
def arguments_blocks():
return {
"rk2_step0": [
"state_spect_n12",
"state_spect",
"tendencies_n",
"diss2",
"dt",
]
}

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
7 changes: 5 additions & 2 deletions data_tests/saved__backend__/python/blocks_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ def block0(a, b, n):
return result


arguments_blocks = {"block0": ["a", "b", "n"]}
def arguments_blocks():
return {"block0": ["a", "b", "n"]}

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ def __for_method__MyClass2__myfunc(self_attr0, self_attr1, arg):
return self_attr1 + self_attr0 + np.abs(arg) + func_import()


__code_new_method__MyClass2__myfunc = """
def __code_new_method__MyClass2__myfunc():
return """
def new_method(self, arg):
return backend_func(self.attr0, self.attr1, arg)
"""

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ def func(a, b):
return (a * np.log(b)).max() + func_import()


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"
7 changes: 5 additions & 2 deletions data_tests/saved__backend__/python/class_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def block1(a, b, n):
return result


arguments_blocks = {"block0": ["a", "b", "n"], "block1": ["a", "b", "n"]}
def arguments_blocks():
return {"block0": ["a", "b", "n"], "block1": ["a", "b", "n"]}

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
7 changes: 5 additions & 2 deletions data_tests/saved__backend__/python/class_rec_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ def __for_method__Myclass__func(self_attr, self_attr2, arg):
)


__code_new_method__Myclass__func = """
def __code_new_method__Myclass__func():
return """
def new_method(self, arg):
return backend_func(self.attr, self.attr2, arg)
"""

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ def func(a, b):
return (a * np.log(b)).max()


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/default_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ def func(a=1, b=None, c=1.0):
return a + c


__transonic__ = ("0.4.0",)
def __transonic__():
return "0.7.1"
7 changes: 5 additions & 2 deletions data_tests/saved__backend__/python/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ def __for_method__Transmitter____call__(self_arr, self_freq, inp):
return (inp * np.exp(np.arange(len(inp)) * self_freq * 1j), self_arr)


__code_new_method__Transmitter____call__ = """
def __code_new_method__Transmitter____call__():
return """
def new_method(self, inp):
return backend_func(self.arr, self.freq, inp)
"""

__transonic__ = ("0.3.0.post0",)

def __transonic__():
return "0.7.1"
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ def func1(a, b):
return a * np.cos(b)


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/no_arg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ def func2():
return 1


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/row_sum_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ def row_sum_loops(arr, columns):
return res


__transonic__ = ("0.3.3.post0",)
def __transonic__():
return "0.7.1"
5 changes: 3 additions & 2 deletions data_tests/saved__backend__/python/subpackages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_np_fft(u):


def test_np_linalg_random(u):
(nx, ny) = u.shape
nx, ny = u.shape
u[:] = randn(nx, ny)
u2 = u.T * u
u4 = matrix_power(u2, 2)
Expand All @@ -21,4 +21,5 @@ def test_sp_special(v, x):
return jv(v, x)


__transonic__ = ("0.4.2",)
def __transonic__():
return "0.7.1"
3 changes: 2 additions & 1 deletion data_tests/saved__backend__/python/type_hint_notemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ def compute(a, b, c, d, e):
return tmp


__transonic__ = ("0.3.0.post0",)
def __transonic__():
return "0.7.1"

0 comments on commit 6e97a30

Please sign in to comment.