Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
SF-N committed Dec 31, 2024
1 parent 827a4d3 commit 0a5ac37
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
4 changes: 0 additions & 4 deletions src/gt4py/next/iterator/pretty_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
AXIS_LITERAL: CNAME ("ᵥ" | "ₕ")
_literal: INT_LITERAL | FLOAT_LITERAL | OFFSET_LITERAL | AXIS_LITERAL
ID_NAME: CNAME
<<<<<<< HEAD
AXIS_NAME: CNAME ("ᵥ" | "ₕ")
=======
>>>>>>> main
?prec0: prec1
| "λ(" ( SYM "," )* SYM? ")" "→" prec0 -> lam
Expand Down
26 changes: 0 additions & 26 deletions src/gt4py/next/program_processors/codegens/gtfn/itir_to_gtfn_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,32 +307,6 @@ def _gen_constituent_expr(el_type: ts.ScalarType | ts.FieldType, path: tuple[int
return result


class _CannonicalizeUnstructuredDomain(eve.NodeTranslator):
def visit_FunCall(self, node: itir.FunCall) -> itir.FunCall:
if node.fun == itir.SymRef(id="unstructured_domain"):
# for no good reason, the domain arguments for unstructured need to be in order (horizontal, vertical)
assert isinstance(node.args[0], itir.FunCall)
first_axis_literal = node.args[0].args[0]
assert isinstance(first_axis_literal, itir.AxisLiteral)
if first_axis_literal.kind == itir.DimensionKind.VERTICAL:
assert len(node.args) == 2
assert isinstance(node.args[1], itir.FunCall)
assert isinstance(node.args[1].args[0], itir.AxisLiteral)
assert node.args[1].args[0].kind == itir.DimensionKind.HORIZONTAL
return itir.FunCall(fun=node.fun, args=[node.args[1], node.args[0]])
return node

@classmethod
def apply(
cls,
node: itir.Program,
) -> itir.Program:
if not isinstance(node, itir.Program):
raise TypeError(f"Expected a 'Program', got '{type(node).__name__}'.")

return cls().visit(node)


@dataclasses.dataclass(frozen=True)
class GTFN_lowering(eve.NodeTranslator, eve.VisitorWithSymbolTableTrait):
_binary_op_map: ClassVar[dict[str, str]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause


import numpy as np
import pytest

Expand Down
5 changes: 2 additions & 3 deletions tests/next_tests/unit_tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause


import pytest

from gt4py.next import utils
Expand Down Expand Up @@ -43,10 +42,10 @@ def test_tree_map_default():
expected_result = ((2, 3), 4)

@utils.tree_map
def testee1(x):
def testee(x):
return x + 1

assert testee1(((1, 2), 3)) == expected_result
assert testee(((1, 2), 3)) == expected_result
assert utils.tree_map(lambda x: x + 1)(((1, 2), 3)) == expected_result
assert utils.tree_map(lambda x: x + 1, ((1, 2), 3)) == expected_result

Expand Down

0 comments on commit 0a5ac37

Please sign in to comment.