Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up SimpleGridData e2c2v field #408

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 12 additions & 44 deletions model/common/src/icon4py/model/common/grid/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,26 @@ class SimpleGridData:
[1, 5, 2, 4], # 4
[1, 4, 5, 0], # 5
[2, 0, 3, 8], # 6
[2, 3, 5, 0], # 7
[2, 3, 0, 5], # 7
[2, 5, 1, 3], # 8
[3, 4, 0, 7], # 9
[3, 7, 4, 6], # 10
[3, 6, 7, 5], # 11
[4, 5, 8, 1], # 12
[4, 8, 7, 5], # 13
[3, 6, 5, 7], # 11
[4, 5, 1, 8], # 12
[4, 8, 5, 7], # 13
[4, 7, 3, 8], # 14
[5, 3, 6, 2], # 15
[6, 5, 3, 8], # 16
[8, 5, 6, 4], # 17
[5, 3, 2, 6], # 15
[5, 6, 3, 8], # 16
[5, 8, 4, 6], # 17
[6, 7, 3, 1], # 18
[6, 1, 7, 0], # 19
[6, 0, 1, 8], # 20
[7, 8, 2, 4], # 21
[7, 8, 4, 2], # 21
[7, 2, 8, 1], # 22
[7, 1, 2, 6], # 23
[8, 6, 0, 5], # 24
[7, 1, 6, 2], # 23
[8, 6, 5, 0], # 24
[8, 0, 6, 2], # 25
[8, 2, 0, 6], # 26
[8, 2, 7, 0], # 26
]
)

Expand Down Expand Up @@ -299,38 +299,6 @@ class SimpleGridData:
]
)

diamond_table = np.asarray(
[
[0, 1, 4, 6], # 0
[0, 4, 1, 3],
[0, 3, 4, 2],
[1, 2, 5, 7], # 3
[1, 5, 2, 4],
[1, 4, 5, 0],
[2, 0, 3, 8], # 6
[2, 3, 0, 5],
[2, 5, 1, 3],
[3, 4, 0, 7], # 9
[3, 7, 4, 6],
[3, 6, 5, 7],
[4, 5, 1, 8], # 12
[4, 8, 5, 7],
[4, 7, 3, 8],
[5, 3, 2, 6], # 15
[5, 6, 3, 8],
[5, 8, 4, 6],
[6, 7, 3, 1], # 18
[6, 1, 7, 0],
[6, 0, 1, 8],
[7, 8, 4, 2], # 21
[7, 2, 8, 1],
[7, 1, 6, 2],
[8, 6, 5, 0], # 24
[8, 0, 6, 2],
[8, 2, 7, 0],
]
)

c2e2cO_table = np.asarray(
[
[15, 4, 3, 0],
Expand Down Expand Up @@ -449,7 +417,7 @@ def num_edges(self) -> int:

@property
def diamond_table(self) -> int:
return SimpleGridData.diamond_table
return SimpleGridData.e2c2v_table

@property
def num_levels(self) -> int:
Expand Down
7 changes: 4 additions & 3 deletions tools/tests/py2fgen/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def run_fortran_executable(function: str):
return subprocess.run([f"./{function}"], capture_output=True, text=True, check=True)


@pytest.mark.parametrize("backend", ("CPU", "ROUNDTRIP"))
# All tests of this module will be parametrized based on "backend"
pytestmark = pytest.mark.parametrize("backend", ("CPU", "ROUNDTRIP"))


def test_py2fgen_compilation_and_execution_square(
cli_runner, backend, samples_path, wrapper_module
):
Expand All @@ -94,7 +97,6 @@ def test_py2fgen_compilation_and_execution_square(
)


@pytest.mark.parametrize("backend", ("CPU", "ROUNDTRIP"))
def test_py2fgen_compilation_and_execution_square_from_function(
cli_runner, backend, samples_path, wrapper_module
):
Expand All @@ -109,7 +111,6 @@ def test_py2fgen_compilation_and_execution_square_from_function(
)


@pytest.mark.parametrize("backend", ("CPU", "ROUNDTRIP"))
def test_py2fgen_compilation_and_execution_multi_return(
cli_runner, backend, samples_path, wrapper_module
):
Expand Down
Loading