diff --git a/constraints.txt b/constraints.txt index 9488949c5d..fe4f777a1e 100644 --- a/constraints.txt +++ b/constraints.txt @@ -103,7 +103,7 @@ mypy==1.9.0 # via -r requirements-dev.in mypy-extensions==1.0.0 # via black, mypy nanobind==1.9.2 # via gt4py (pyproject.toml) nbclient==0.6.8 # via nbmake -nbformat==5.10.3 # via jupytext, nbclient, nbmake +nbformat==5.10.4 # via jupytext, nbclient, nbmake nbmake==1.5.3 # via -r requirements-dev.in nest-asyncio==1.6.0 # via ipykernel, nbclient networkx==3.1 # via dace diff --git a/min-extra-requirements-test.txt b/min-extra-requirements-test.txt index d3871db2be..d6689803b3 100644 --- a/min-extra-requirements-test.txt +++ b/min-extra-requirements-test.txt @@ -113,6 +113,6 @@ tabulate==0.8.10 tomli==2.0.1; python_version < "3.11" tox==3.2.0 types-all==1.0.0 -typing-extensions==4.6.0 +typing-extensions==4.10.0 xxhash==1.4.4 ##[[[end]]] diff --git a/min-requirements-test.txt b/min-requirements-test.txt index e985b08aa7..eeb633dd67 100644 --- a/min-requirements-test.txt +++ b/min-requirements-test.txt @@ -106,6 +106,6 @@ tabulate==0.8.10 tomli==2.0.1; python_version < "3.11" tox==3.2.0 types-all==1.0.0 -typing-extensions==4.6.0 +typing-extensions==4.10.0 xxhash==1.4.4 ##[[[end]]] diff --git a/requirements-dev.txt b/requirements-dev.txt index df79f905d3..71a4152553 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -103,7 +103,7 @@ mypy==1.9.0 # via -c constraints.txt, -r requirements-dev.in mypy-extensions==1.0.0 # via -c constraints.txt, black, mypy nanobind==1.9.2 # via -c constraints.txt, gt4py (pyproject.toml) nbclient==0.6.8 # via -c constraints.txt, nbmake -nbformat==5.10.3 # via -c constraints.txt, jupytext, nbclient, nbmake +nbformat==5.10.4 # via -c constraints.txt, jupytext, nbclient, nbmake nbmake==1.5.3 # via -c constraints.txt, -r requirements-dev.in nest-asyncio==1.6.0 # via -c constraints.txt, ipykernel, nbclient networkx==3.1 # via -c constraints.txt, dace diff --git a/src/gt4py/next/ffront/decorator.py b/src/gt4py/next/ffront/decorator.py index f55e829715..4f1eafebbd 100644 --- a/src/gt4py/next/ffront/decorator.py +++ b/src/gt4py/next/ffront/decorator.py @@ -208,7 +208,7 @@ def itir(self) -> itir.FencilDefinition: kwargs={}, ) if self.backend is not None and self.backend.transformer is not None: - return self.backend.transformer.past_to_itir(no_args_past) + return self.backend.transformer.past_to_itir(no_args_past).program return past_to_itir.PastToItirFactory()(no_args_past).program def __call__(self, *args, offset_provider: dict[str, Dimension], **kwargs: Any) -> None: diff --git a/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_decorator.py b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_decorator.py new file mode 100644 index 0000000000..a6d00ab7d0 --- /dev/null +++ b/tests/next_tests/integration_tests/feature_tests/ffront_tests/test_decorator.py @@ -0,0 +1,35 @@ +# GT4Py - GridTools Framework +# +# Copyright (c) 2014-2023, ETH Zurich +# All rights reserved. +# +# This file is part of the GT4Py project and the GridTools framework. +# GT4Py is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or any later +# version. See the LICENSE.txt file at the top-level directory of this +# distribution for a copy of the license or check . +# +# SPDX-License-Identifier: GPL-3.0-or-later +# TODO(dropd): Remove as soon as `gt4py.next.ffront.decorator` is type checked. +from gt4py import next as gtx +from gt4py.next.iterator import ir as itir + +from next_tests.integration_tests import cases +from next_tests.integration_tests.cases import cartesian_case +from next_tests.integration_tests.feature_tests.ffront_tests.ffront_test_utils import ( + exec_alloc_descriptor, +) + + +def test_program_itir_regression(cartesian_case): + @gtx.field_operator(backend=None) + def testee_op(a: cases.IField) -> cases.IField: + return a + + @gtx.program(backend=None) + def testee(a: cases.IField, out: cases.IField): + testee_op(a, out=out) + + assert isinstance(testee.itir, itir.FencilDefinition) + assert isinstance(testee.with_backend(cartesian_case.executor).itir, itir.FencilDefinition)