Skip to content
Snippets Groups Projects
Commit 0e31ad58 authored by Markus Holzer's avatar Markus Holzer
Browse files

Fix doc test

parent 50079b19
Branches
No related tags found
No related merge requests found
...@@ -88,6 +88,9 @@ def create_domain_kernel(assignments: NodeCollection, *, config: CreateKernelCon ...@@ -88,6 +88,9 @@ def create_domain_kernel(assignments: NodeCollection, *, config: CreateKernelCon
""" """
Creates abstract syntax tree (AST) of kernel, using a list of update equations. Creates abstract syntax tree (AST) of kernel, using a list of update equations.
Note that `create_domain_kernel` is a lower level function which shoul be accessed by not providing `index_fields`
to create_kernel
Args: Args:
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection` assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
config: CreateKernelConfig which includes the needed configuration config: CreateKernelConfig which includes the needed configuration
...@@ -181,6 +184,9 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo ...@@ -181,6 +184,9 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
'coordinate_names' parameter. The struct can have also other fields that can be read and written in the kernel, for 'coordinate_names' parameter. The struct can have also other fields that can be read and written in the kernel, for
example boundary parameters. example boundary parameters.
Note that `create_indexed_kernel` is a lower level function which shoul be accessed by providing `index_fields`
to create_kernel
Args: Args:
assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection` assignments: can be a single assignment, sequence of assignments or an `AssignmentCollection`
config: CreateKernelConfig which includes the needed configuration config: CreateKernelConfig which includes the needed configuration
...@@ -209,11 +215,12 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo ...@@ -209,11 +215,12 @@ def create_indexed_kernel(assignments: NodeCollection, *, config: CreateKernelCo
>>> d_arr = np.zeros([5, 5]) >>> d_arr = np.zeros([5, 5])
>>> kernel(s=np.ones([5, 5]), d=d_arr, idx=index_arr) >>> kernel(s=np.ones([5, 5]), d=d_arr, idx=index_arr)
>>> d_arr >>> d_arr
array([[0., 0., 0., 0., 0.], array([[0. , 0. , 0. , 0. , 0. ],
[0., 4.1, 0., 0., 0.], [0. , 4.1, 0. , 0. , 0. ],
[0., 0., 4.2, 0., 0.], [0. , 0. , 4.2, 0. , 0. ],
[0., 0., 0., 4.3, 0.], [0. , 0. , 0. , 4.3, 0. ],
[0., 0., 0., 0., 0.]]) [0. , 0. , 0. , 0. , 0. ]])
""" """
# --- eval # --- eval
assignments.evaluate_terms() assignments.evaluate_terms()
......
from pystencils.typing.cast_functions import (CastFunc, BooleanCastFunc, VectorMemoryAccess, ReinterpretCastFunc, from pystencils.typing.cast_functions import (CastFunc, BooleanCastFunc, VectorMemoryAccess, ReinterpretCastFunc,
PointerArithmeticFunc) PointerArithmeticFunc)
from pystencils.typing.types import (is_supported_type, numpy_name_to_c, AbstractType, BasicType, VectorType, from pystencils.typing.types import (is_supported_type, numpy_name_to_c, AbstractType, BasicType, VectorType,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment