diff --git a/src/pystencils/backend/ast/expressions.py b/src/pystencils/backend/ast/expressions.py index 51807d96a1f3468074d6f8ff9f8917c87da014fa..151f86c6e3db4e5c4f7914d7da9e94240412cdb2 100644 --- a/src/pystencils/backend/ast/expressions.py +++ b/src/pystencils/backend/ast/expressions.py @@ -818,7 +818,7 @@ class PsArrayInitList(PsExpression): self._items = np.array(items, dtype=np.object_) @property - def items_matrix(self) -> NDArray[np.object_]: + def items_grid(self) -> NDArray[np.object_]: return self._items @property diff --git a/src/pystencils/backend/emission.py b/src/pystencils/backend/emission.py index c7969fa50962bd3c8e6acafe3a9a0bf2dc46f63b..579d4764835729bb98e17a085898b8b7f1612f27 100644 --- a/src/pystencils/backend/emission.py +++ b/src/pystencils/backend/emission.py @@ -377,7 +377,7 @@ class CAstPrinter: return "{ " + entries + " }" pc.push_op(Ops.Weakest, LR.Middle) - arr_str = print_arr(node.items_matrix) + arr_str = print_arr(node.items_grid) pc.pop_op() return arr_str diff --git a/src/pystencils/backend/kernelcreation/freeze.py b/src/pystencils/backend/kernelcreation/freeze.py index 8509712caccb5d0e7d3cbbf883360f37a9506ed0..0ae5a0d1be80ee7a02c667372c30620aef6e77fd 100644 --- a/src/pystencils/backend/kernelcreation/freeze.py +++ b/src/pystencils/backend/kernelcreation/freeze.py @@ -296,7 +296,7 @@ class FreezeExpressions: f"Cannot translate nested arrays of non-uniform shape: {expr}" ) - return PsArrayInitList([s.items_matrix for s in subarrays]) # type: ignore + return PsArrayInitList([s.items_grid for s in subarrays]) # type: ignore else: # base case: no nested arrays return PsArrayInitList(items) diff --git a/src/pystencils/backend/kernelcreation/typification.py b/src/pystencils/backend/kernelcreation/typification.py index da05fdf4b175b664e8aa1a01112e54c03c5dc271..819d4a12b5446dd7a330d69cee6248ab204d4a64 100644 --- a/src/pystencils/backend/kernelcreation/typification.py +++ b/src/pystencils/backend/kernelcreation/typification.py @@ -220,9 +220,7 @@ class TypeContext: def _compatible(self, dtype: PsType): """Checks whether the given data type is compatible with the context's target type. - - If the target type is ``const``, they must be equal up to const qualification; - if the target type is not ``const``, `dtype` must match it exactly. + The two must match except for constness. """ assert self._target_type is not None return deconstify(dtype) == self._target_type @@ -267,11 +265,7 @@ class Typifier: **Typing of symbol expressions** - Some expressions (`PsSymbolExpr`, `PsArrayAccess`) encapsulate symbols and inherit their data types, but - not necessarily their const-qualification. - A symbol with non-``const`` type may occur in a `PsSymbolExpr` with ``const`` type, - and an array base pointer with non-``const`` base type may be nested in a ``const`` `PsArrayAccess`, - but not vice versa. + Some expressions (`PsSymbolExpr`, `PsArrayAccess`) encapsulate symbols and inherit their data types. """ def __init__(self, ctx: KernelCreationContext):