Skip to content

Commit

Permalink
work on getting changes integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
philipc2 committed Aug 12, 2024
1 parent 6abd545 commit 81e3306
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions test/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion uxarray/grid/dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def construct_dual(grid):
)


@njit(cache=True)
# @njit(cache=True)
def construct_faces(
n_node,
n_edges,
Expand Down
3 changes: 3 additions & 0 deletions uxarray/grid/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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."""
Expand Down

0 comments on commit 81e3306

Please sign in to comment.