Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin_tehrengruber/icdl_lazy_eval' int…
Browse files Browse the repository at this point in the history
…o icdl_lazy_eval
  • Loading branch information
tehrengruber committed Feb 21, 2025
2 parents b964bd7 + 204e4c8 commit 4d781e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gt4py/cartesian/gtc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def isbool(self):
return self == self.BOOL

def isinteger(self):
return self in (self.INT8, self.INT32, self.INT64)
return self in (self.INT8, self.INT16, self.INT32, self.INT64)

def isfloat(self):
return self in (self.FLOAT32, self.FLOAT64)
Expand Down
18 changes: 18 additions & 0 deletions tests/cartesian_tests/unit_tests/test_gtc/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@
# - For testing non-leave nodes, introduce builders with defaults (for leave nodes as well)


def test_data_type_methods():
for type in DataType:
if type == DataType.BOOL:
assert type.isbool()
else:
assert not type.isbool()

if type in (DataType.INT8, DataType.INT16, DataType.INT32, DataType.INT64):
assert type.isinteger()
else:
assert not type.isinteger()

if type in (DataType.FLOAT32, DataType.FLOAT64):
assert type.isfloat()
else:
assert not type.isfloat()


class DummyExpr(Expr):
"""Fake expression for cases where a concrete expression is not needed."""

Expand Down

0 comments on commit 4d781e7

Please sign in to comment.