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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
938d53de
Commit
938d53de
authored
Oct 24, 2022
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Delete backward compatibility test
parent
30f0592f
No related branches found
No related tags found
1 merge request
!308
Remove depricated feature
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/config.py
+1
-1
1 addition, 1 deletion
pystencils/config.py
pystencils_tests/test_create_kernel_backwards_compability.py
+0
-38
0 additions, 38 deletions
pystencils_tests/test_create_kernel_backwards_compability.py
with
1 addition
and
39 deletions
pystencils/config.py
+
1
−
1
View file @
938d53de
This diff is collapsed.
Click to expand it.
pystencils_tests/test_create_kernel_backwards_compability.py
deleted
100644 → 0
+
0
−
38
View file @
30f0592f
import
pytest
import
pystencils
as
ps
import
numpy
as
np
# This test aims to trigger deprication warnings. Thus the warnings should not be displayed in the warning summary.
import
pystencils.config
def
test_create_kernel_backwards_compatibility
():
size
=
(
30
,
20
)
src_field_string
=
np
.
random
.
rand
(
*
size
)
src_field_enum
=
np
.
copy
(
src_field_string
)
src_field_config
=
np
.
copy
(
src_field_string
)
dst_field_string
=
np
.
zeros
(
size
)
dst_field_enum
=
np
.
zeros
(
size
)
dst_field_config
=
np
.
zeros
(
size
)
f
=
ps
.
Field
.
create_from_numpy_array
(
"
f
"
,
src_field_enum
)
d
=
ps
.
Field
.
create_from_numpy_array
(
"
d
"
,
dst_field_enum
)
jacobi
=
ps
.
Assignment
(
d
[
0
,
0
],
(
f
[
1
,
0
]
+
f
[
-
1
,
0
]
+
f
[
0
,
1
]
+
f
[
0
,
-
1
])
/
4
)
ast_enum
=
ps
.
create_kernel
(
jacobi
,
target
=
ps
.
Target
.
CPU
).
compile
()
with
pytest
.
warns
(
DeprecationWarning
):
ast_string
=
ps
.
create_kernel
(
jacobi
,
target
=
'
cpu
'
).
compile
()
# noinspection PyTypeChecker
with
pytest
.
warns
(
DeprecationWarning
):
ast_config
=
ps
.
create_kernel
(
jacobi
,
config
=
pystencils
.
config
.
CreateKernelConfig
(
target
=
'
cpu
'
)).
compile
()
ast_enum
(
f
=
src_field_enum
,
d
=
dst_field_enum
)
ast_string
(
f
=
src_field_string
,
d
=
dst_field_string
)
ast_config
(
f
=
src_field_config
,
d
=
dst_field_config
)
error
=
np
.
sum
(
np
.
abs
(
dst_field_enum
-
dst_field_string
))
np
.
testing
.
assert_almost_equal
(
error
,
0.0
)
error
=
np
.
sum
(
np
.
abs
(
dst_field_enum
-
dst_field_config
))
np
.
testing
.
assert_almost_equal
(
error
,
0.0
)
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
sign in
to comment