Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
740b3fa5
Commit
740b3fa5
authored
3 months ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
fix test_type_cast
parent
44b5a366
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!443
Extended Support for Typing in the Symbolic Toolbox
Pipeline
#72624
passed
3 months ago
Stage: Code Quality
Stage: Unit Tests
Stage: legacy_test
Stage: docs
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pystencils/sympyextensions/typed_sympy.py
+2
-1
2 additions, 1 deletion
src/pystencils/sympyextensions/typed_sympy.py
tests/kernelcreation/test_type_cast.py
+2
-2
2 additions, 2 deletions
tests/kernelcreation/test_type_cast.py
with
4 additions
and
3 deletions
src/pystencils/sympyextensions/typed_sympy.py
+
2
−
1
View file @
740b3fa5
...
...
@@ -207,10 +207,11 @@ class BoolCast(TypeCast, Boolean):
tcast
=
TypeCast
class
CastFunc
(
sp
.
Function
):
class
CastFunc
(
TypeCast
):
def
__new__
(
cls
,
*
args
,
**
kwargs
):
warn
(
"
CastFunc is deprecated and will be removed in pystencils 2.1.
"
"
Use `pystencils.tcast` instead.
"
,
FutureWarning
)
return
TypeCast
.
__new__
(
cls
,
*
args
,
**
kwargs
)
This diff is collapsed.
Click to expand it.
tests/kernelcreation/test_type_cast.py
+
2
−
2
View file @
740b3fa5
...
...
@@ -8,7 +8,7 @@ from pystencils import (
Assignment
,
Field
,
)
from
pystencils.sympyextensions.typed_sympy
import
C
ast
Func
from
pystencils.sympyextensions.typed_sympy
import
tc
ast
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):
inp_field
=
Field
.
create_from_numpy_array
(
"
inp
"
,
inp
)
outp_field
=
Field
.
create_from_numpy_array
(
"
outp
"
,
outp
)
asms
=
[
Assignment
(
outp_field
.
center
(),
C
ast
Func
(
inp_field
.
center
(),
to_type
))]
asms
=
[
Assignment
(
outp_field
.
center
(),
tc
ast
(
inp_field
.
center
(),
to_type
))]
kernel
=
create_kernel
(
asms
,
gen_config
)
kfunc
=
kernel
.
compile
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment