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
94657080
Commit
94657080
authored
1 month ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
Add test cases
parent
dc9b711b
No related branches found
No related tags found
1 merge request
!460
Fix data types in boundary handling. Fix deprecation checks.
Pipeline
#77941
passed
1 month 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
tests/frontend/test_simplifications.py
+2
-0
2 additions, 0 deletions
tests/frontend/test_simplifications.py
tests/runtime/test_boundary.py
+6
-4
6 additions, 4 deletions
tests/runtime/test_boundary.py
with
8 additions
and
4 deletions
tests/frontend/test_simplifications.py
+
2
−
0
View file @
94657080
...
...
@@ -147,6 +147,8 @@ def test_add_subexpressions_for_field_reads():
assert
len
(
ac3
.
subexpressions
)
==
2
assert
isinstance
(
ac3
.
subexpressions
[
0
].
lhs
,
TypedSymbol
)
assert
ac3
.
subexpressions
[
0
].
lhs
.
dtype
==
create_type
(
"
float32
"
)
assert
isinstance
(
ac3
.
subexpressions
[
0
].
rhs
,
ps
.
tcast
)
assert
ac3
.
subexpressions
[
0
].
rhs
.
dtype
==
create_type
(
"
float32
"
)
# TODO: What does this test mean to accomplish?
...
...
This diff is collapsed.
Click to expand it.
tests/runtime/test_boundary.py
+
6
−
4
View file @
94657080
...
...
@@ -222,15 +222,17 @@ def test_boundary_data_setter():
assert
np
.
all
(
data_setter
.
link_positions
(
1
)
==
6.
)
@pytest.mark.parametrize
(
"
dtype
"
,
[
np
.
float32
,
np
.
float64
])
@pytest.mark.parametrize
(
'
with_indices
'
,
(
'
with_indices
'
,
False
))
def
test_dirichlet
(
with_indices
):
def
test_dirichlet
(
dtype
,
with_indices
):
value
=
(
1
,
20
,
3
)
if
with_indices
else
1
dh
=
SerialDataHandling
(
domain_size
=
(
7
,
7
))
src
=
dh
.
add_array
(
'
src
'
,
values_per_cell
=
3
if
with_indices
else
1
)
dh
.
cpu_arrays
.
src
[...]
=
np
.
random
.
rand
(
*
src
.
shape
)
src
=
dh
.
add_array
(
'
src
'
,
values_per_cell
=
3
if
with_indices
else
1
,
dtype
=
dtype
)
rng
=
np
.
random
.
default_rng
()
dh
.
cpu_arrays
.
src
[...]
=
rng
.
random
(
src
.
shape
,
dtype
=
dtype
)
boundary_stencil
=
[(
1
,
0
),
(
-
1
,
0
),
(
0
,
1
),
(
0
,
-
1
)]
boundary_handling
=
BoundaryHandling
(
dh
,
src
.
name
,
boundary_stencil
)
boundary_handling
=
BoundaryHandling
(
dh
,
src
.
name
,
boundary_stencil
,
default_dtype
=
dtype
)
dirichlet
=
Dirichlet
(
value
)
assert
dirichlet
.
name
==
'
Dirichlet
'
dirichlet
.
name
=
"
wall
"
...
...
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