Skip to content
Snippets Groups Projects
Commit 740b3fa5 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

fix test_type_cast

parent 44b5a366
1 merge request!443Extended Support for Typing in the Symbolic Toolbox
Pipeline #72624 passed with stages
in 5 minutes and 57 seconds
...@@ -207,10 +207,11 @@ class BoolCast(TypeCast, Boolean): ...@@ -207,10 +207,11 @@ class BoolCast(TypeCast, Boolean):
tcast = TypeCast tcast = TypeCast
class CastFunc(sp.Function): class CastFunc(TypeCast):
def __new__(cls, *args, **kwargs): def __new__(cls, *args, **kwargs):
warn( warn(
"CastFunc is deprecated and will be removed in pystencils 2.1. " "CastFunc is deprecated and will be removed in pystencils 2.1. "
"Use `pystencils.tcast` instead.", "Use `pystencils.tcast` instead.",
FutureWarning FutureWarning
) )
return TypeCast.__new__(cls, *args, **kwargs)
...@@ -8,7 +8,7 @@ from pystencils import ( ...@@ -8,7 +8,7 @@ from pystencils import (
Assignment, Assignment,
Field, Field,
) )
from pystencils.sympyextensions.typed_sympy import CastFunc from pystencils.sympyextensions.typed_sympy import tcast
AVAIL_TARGETS_NO_SSE = [t for t in Target.available_targets() if Target._SSE not in t] AVAIL_TARGETS_NO_SSE = [t for t in Target.available_targets() if Target._SSE not in t]
...@@ -55,7 +55,7 @@ def test_type_cast(gen_config, xp, from_type, to_type): ...@@ -55,7 +55,7 @@ def test_type_cast(gen_config, xp, from_type, to_type):
inp_field = Field.create_from_numpy_array("inp", inp) inp_field = Field.create_from_numpy_array("inp", inp)
outp_field = Field.create_from_numpy_array("outp", outp) outp_field = Field.create_from_numpy_array("outp", outp)
asms = [Assignment(outp_field.center(), CastFunc(inp_field.center(), to_type))] asms = [Assignment(outp_field.center(), tcast(inp_field.center(), to_type))]
kernel = create_kernel(asms, gen_config) kernel = create_kernel(asms, gen_config)
kfunc = kernel.compile() kfunc = kernel.compile()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment