From 81e33063f908ad1c531249c1600530435f5a58c3 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec Date: Mon, 12 Aug 2024 16:14:55 -0500 Subject: [PATCH] work on getting changes integrated --- test/test_grid.py | 9 +++++++++ uxarray/grid/dual.py | 2 +- uxarray/grid/validation.py | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/test_grid.py b/test/test_grid.py index 65b572e50..74c02e584 100644 --- a/test/test_grid.py +++ b/test/test_grid.py @@ -983,3 +983,12 @@ def test_dual_mesh_mpas(self): # Assert the faces are the same nt.assert_equal(dual.face_node_connectivity.values, mpas_dual.face_node_connectivity.values) + + + def test_duplicate(self): + uxgrid = ux.open_grid(gridfile_geos) + uxgrid.merge_duplicate_node_indices() + + uxgrid.compute_dual() + + pass diff --git a/uxarray/grid/dual.py b/uxarray/grid/dual.py index 673ad6628..5a4076b68 100644 --- a/uxarray/grid/dual.py +++ b/uxarray/grid/dual.py @@ -34,7 +34,7 @@ def construct_dual(grid): ) -@njit(cache=True) +# @njit(cache=True) def construct_faces( n_node, n_edges, diff --git a/uxarray/grid/validation.py b/uxarray/grid/validation.py index c98e1569e..18eb7abf7 100644 --- a/uxarray/grid/validation.py +++ b/uxarray/grid/validation.py @@ -80,6 +80,7 @@ def _check_area(grid): def _find_duplicate_nodes(grid): """Creates a dictionary mapping which node indices reference duplicates.""" + # list of tuple indices lonlat_t = [ (lon, lat) for lon, lat in zip(grid.node_lon.values, grid.node_lat.values) @@ -103,6 +104,8 @@ def _find_duplicate_nodes(grid): for duplicate_idx in indices[1:]: duplicate_dict[duplicate_idx] = source_idx + return duplicate_dict + def _merge_duplicate_node_indices_on_connectivity(conn, duplicate_dict): """Replaces duplicate node indices that occur in a given connectivity."""