Skip to content

Commit 73afd4c

Browse files
committed
tests: add test for breaking is_real
1 parent 5ad9283 commit 73afd4c

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/test_symbolics.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
INT, FieldFromComposite, IntDiv, Namespace, Rvalue,
1616
ReservedWord, ListInitializer, uxreplace, pow_to_mul,
1717
retrieve_derivatives, BaseCast, SizeOf)
18-
from devito.tools import as_tuple
18+
from devito.tools import as_tuple, CustomDtype
1919
from devito.types import (Array, Bundle, FIndexed, LocalObject, Object,
2020
ComponentAccess, StencilDimension, Symbol as dSymbol)
2121
from devito.types.basic import AbstractSymbol
@@ -912,3 +912,15 @@ def test_print_div():
912912
b = SizeOf(np.int64)
913913
cstr = ccode(a / b)
914914
assert cstr == 'sizeof(int)/sizeof(long)'
915+
916+
917+
def test_customdtype_complex():
918+
"""
919+
Test that `CustomDtype` doesn't brak is_imag
920+
"""
921+
grid = Grid(shape=(4, 4))
922+
923+
f = Function(name='f', grid=grid, dtype=CustomDtype('notnumpy'))
924+
925+
assert not f.is_imaginary
926+
assert f.is_real

0 commit comments

Comments
 (0)