Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
24fe42d
optimize bounds and face edge node construction
philipc2 Apr 9, 2025
4687b69
add parallel norms
philipc2 Apr 10, 2025
2447702
use xarray
philipc2 Apr 10, 2025
a5ccc44
update norm
philipc2 Apr 10, 2025
5adf5b6
parallel norm
philipc2 Apr 10, 2025
1f4c11d
coordinate optimization
philipc2 Apr 10, 2025
6c4af23
remove comment
philipc2 Apr 10, 2025
6398e02
Merge branch 'main' into bounds-optimization
philipc2 Apr 10, 2025
c1564e0
add array types to norm signature
philipc2 Apr 10, 2025
83e0974
Merge branch 'main' into bounds-optimization
philipc2 Apr 13, 2025
6aa9c2c
Use xarray ufuncs to normalize coordinates, set min xarray version
philipc2 Apr 14, 2025
926d4a7
correct pyproject.toml
philipc2 Apr 14, 2025
cd8fc28
docstring cleanup
philipc2 Apr 14, 2025
5e4c030
re-add numba cache check
philipc2 Apr 14, 2025
cdcb173
remove space after version pin
philipc2 Apr 14, 2025
907b8ec
Merge branch 'main' into bounds-optimization
philipc2 Apr 14, 2025
fb39036
merge main
philipc2 Apr 17, 2025
427e013
pre-commit
philipc2 Apr 17, 2025
6823f7b
update function names
philipc2 Apr 17, 2025
21b4cbf
Merge branch 'main' into bounds-optimization
philipc2 Apr 23, 2025
3f35af6
docstrings, update function names, unpin xarray
philipc2 Apr 23, 2025
849625f
Merge branch 'bounds-optimization' of https://github.com/UXARRAY/uxar…
philipc2 Apr 23, 2025
a608439
clean notebook, update util name
philipc2 Apr 23, 2025
9dc18c3
Merge branch 'main' into bounds-optimization
philipc2 Apr 23, 2025
1405f61
use regular abs, update numba cache check
philipc2 Apr 23, 2025
ebd0627
Merge branch 'bounds-optimization' of https://github.com/UXARRAY/uxar…
philipc2 Apr 23, 2025
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
64 changes: 20 additions & 44 deletions docs/examples/visualization/mpas_topology.ipynb

Large diffs are not rendered by default.

98 changes: 50 additions & 48 deletions test/test_geometry.py

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from uxarray.constants import INT_DTYPE, INT_FILL_VALUE
from uxarray.grid.coordinates import _lonlat_rad_to_xyz, _normalize_xyz, _xyz_to_lonlat_rad
from uxarray.grid.arcs import point_within_gca, _angle_of_2_vectors, in_between
from uxarray.grid.utils import _get_cartesian_face_edge_nodes, _get_lonlat_rad_face_edge_nodes
from uxarray.grid.utils import _get_cartesian_face_edge_nodes_array, _get_lonlat_rad_face_edge_nodes_array
from uxarray.grid.geometry import pole_point_inside_polygon, _pole_point_inside_polygon_cartesian

try:
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_get_cartesian_face_edge_nodes_pipeline():
node_y = grid.node_y.values
node_z = grid.node_z.values

face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes(
face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_x, node_y, node_z
)

Expand All @@ -298,7 +298,7 @@ def test_get_cartesian_face_edge_nodes_filled_value():
node_y = grid.node_y.values
node_z = grid.node_z.values

face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes(
face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_x, node_y, node_z
)

Expand Down Expand Up @@ -335,7 +335,7 @@ def test_get_cartesian_face_edge_nodes_filled_value2():
node_y = np.array([v0_cart[1],v1_cart[1],v2_cart[1],v3_cart[1],v4_cart[1]])
node_z = np.array([v0_cart[2],v1_cart[2],v2_cart[2],v3_cart[2],v4_cart[2]])

face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes(
face_edges_connectivity_cartesian = _get_cartesian_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_x, node_y, node_z
)

Expand Down Expand Up @@ -368,7 +368,7 @@ def test_get_lonlat_face_edge_nodes_pipeline():
node_lon = grid.node_lon.values
node_lat = grid.node_lat.values

face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes(
face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_lon, node_lat
)

Expand Down Expand Up @@ -398,7 +398,7 @@ def test_get_lonlat_face_edge_nodes_filled_value():
node_lon = grid.node_lon.values
node_lat = grid.node_lat.values

face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes(
face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_lon, node_lat
)

Expand Down Expand Up @@ -434,7 +434,7 @@ def test_get_lonlat_face_edge_nodes_filled_value2():
node_lon = np.array([v0_rad[0],v1_rad[0],v2_rad[0],v3_rad[0],v4_rad[0]])
node_lat = np.array([v0_rad[1],v1_rad[1],v2_rad[1],v3_rad[1],v4_rad[1]])

face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes(
face_edges_connectivity_lonlat = _get_lonlat_rad_face_edge_nodes_array(
face_node_conn, n_face, n_max_face_edges, node_lon, node_lat
)

Expand Down
4 changes: 2 additions & 2 deletions test/test_integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_get_faces_constLat_intersection_info, _zonal_face_weights, \
_zonal_face_weights_robust

from uxarray.grid.utils import _get_cartesian_face_edge_nodes
from uxarray.grid.utils import _get_cartesian_face_edge_nodes_array

current_path = Path(os.path.dirname(os.path.realpath(__file__)))

Expand Down Expand Up @@ -1037,7 +1037,7 @@ def test_compare_zonal_weights():
for gridfile in gridfiles:
uxgrid = ux.open_grid(gridfile)
n_nodes_per_face = uxgrid.n_nodes_per_face.values
face_edge_nodes_xyz = _get_cartesian_face_edge_nodes(
face_edge_nodes_xyz = _get_cartesian_face_edge_nodes_array(
uxgrid.face_node_connectivity.values,
uxgrid.n_face,
uxgrid.n_max_face_edges,
Expand Down
4 changes: 2 additions & 2 deletions test/test_intersections.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ def test_GCA_GCA_north_pole_angled():

def test_GCA_edge_intersection_count():

from uxarray.grid.utils import _get_cartesian_face_edge_nodes
from uxarray.grid.utils import _get_cartesian_face_edge_nodes_array

# Generate a normal face that is not crossing the antimeridian or the poles
vertices_lonlat = [[29.5, 11.0], [29.5, 10.0], [30.5, 10.0], [30.5, 11.0]]
vertices_lonlat = np.array(vertices_lonlat)

grid = ux.Grid.from_face_vertices(vertices_lonlat, latlon=True)
face_edge_nodes_cartesian = _get_cartesian_face_edge_nodes(
face_edge_nodes_cartesian = _get_cartesian_face_edge_nodes_array(
grid.face_node_connectivity.values,
grid.n_face,
grid.n_max_face_edges,
Expand Down
4 changes: 2 additions & 2 deletions uxarray/core/zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np

from uxarray.grid.integrate import _zonal_face_weights, _zonal_face_weights_robust
from uxarray.grid.utils import _get_cartesian_face_edge_nodes
from uxarray.grid.utils import _get_cartesian_face_edge_nodes_array


def _compute_non_conservative_zonal_mean(uxda, latitudes, use_robust_weights=False):
Expand All @@ -17,7 +17,7 @@ def _compute_non_conservative_zonal_mean(uxda, latitudes, use_robust_weights=Fal
# Create a NumPy array for storing results
result = np.zeros(shape, dtype=uxda.dtype)

faces_edge_nodes_xyz = _get_cartesian_face_edge_nodes(
faces_edge_nodes_xyz = _get_cartesian_face_edge_nodes_array(
uxgrid.face_node_connectivity.values,
uxgrid.n_face,
uxgrid.n_max_face_nodes,
Expand Down
Loading
Loading