Skip to content

Improve error messages in uxarray/grid - #1705

Open
Sevans711 wants to merge 2 commits into
mainfrom
sevans/error-messages-grid
Open

Improve error messages in uxarray/grid#1705
Sevans711 wants to merge 2 commits into
mainfrom
sevans/error-messages-grid

Conversation

@Sevans711

Copy link
Copy Markdown
Collaborator

Closes #1704 (sub-issue of #1617)

Overview

Makes error messages clearer and more informative throughout uxarray/grid. As suggested by #1617 this is attempting to be an exhaustive fix for all desired error message improvements in uxarray/grid, while touching nothing outside of uxarray/grid. (Clarifying, this is for all files in uxarray/grid, not just files inside uxarray/grid/grid.)

Small expansion of scope: fixes confusing/misleading error types in a few places:

  1. Exception → AssertionError in insert_pt_in_latlonbox: "Logic error in longitude box width calculation". (Missed this while fixing Update uxarray error types for cases with misleading/confusing types #1622, which did mention this case but it actually appeared twice and the fix missed the second occurrence.)
  2. DataCenteringError → NotImplementedError in Grid.isel() messages like "Inverse indices are not yet supported for node selection, please use face centers". DataCenteringError was also misleading because these errors depended only on input kwargs, not the actual location of any data.
  3. ValueError → NotImplementedError in _slice_face_indices: "Exclusive slicing is not yet supported." (Missed this while fixing Update uxarray error types for cases with misleading/confusing types #1622 despite it being noted there explicitly.)

Misc. small expansions of PR scope:

  • Removes warning message when initializing a Grid with source_grid_spec None. The message text and comments imply that the intent here was to warn whenever grid_ds is not a minimum representable UGRID dataset, whenever source_grid_spec is None. But, that case is already being handled by the _validate_minimum_ugrid check which was directly above it (which will crash when invalid). I suspect that for a while only the warning existed, and then whatever PR added the check forgot to also remove the warning.
  • Improves docstring of Grid.from_face_vertices to clarify expected shape and content of face_vertices, and the meaning of latlon=False.
  • Tiny efficiency improvement in _compute_face_areas_and_jacobian: actually utilize min_jacobian (computed as np.min(self._face_jacobian)), by checking min_jacobian < 0, instead of computing it then ignoring it to instead check np.any(self._face_jacobian < 0). Additionally, do not compute max_jacobian anymore; previously it was always being computed despite only being used if raising an error, and now it is no longer included in the error message at all.

Aside from these small expansions of scope there should be no functionality changes; the only differences in this PR are the changes to error message contents.

Benchmarks: running benchmarks to make sure there isn't any performance hit. (Highly unlikely, but could happen if errors are used as part of control flow in a hot loop and any objects now placed into error message strings take non-negligible time to convert to string.)

PR Checklist

General

  • An issue is created and linked
  • Added appropriate labels (if your uxarray repo permissions allow it)
  • Filled out Overview and Expected Usage (if applicable) sections

Testing & Benchmarking

  • [N/A] Adequate tests are created if there is new functionality
  • Tests are not too basic (such as simply calling a function and nothing else)
  • [N/A] Tests cover all major paths in your new functions
  • If this PR could affect performance, ran ASV benchmarks and confirmed they show expected behavior (add a new benchmark if necessary)

AI Disclosure

AI Usage: GitHub Copilot's inline code suggestions, some small chats with Claude

  • I take responsibility for all AI-generated content in my PR.
  • I have tested all AI-generated content in my PR.

(numba complains when trying to provide helpful info in error messages, such as including the value which was actually received. So, make those error messages worse, so that numba will be happy again. Left inline comments to help clarify this.)
@Sevans711 Sevans711 added documentation Improvements or additions to documentation improvement Improvements on existing features or infrastructure run-benchmark Run ASV benchmark workflow developer experience Makes the codebase easier to read, debug, maintain, or extend. design Design of an API, feature, or user interface (not just implementation details) labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [644dd69] After [f7d25e9] Ratio Benchmark (Parameter)
- 28.1±0.7ms 23.5±0.4ms 0.84 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping

Benchmarks that have stayed the same:

Change Before [644dd69] After [f7d25e9] Ratio Benchmark (Parameter)
117±1ms 114±0.2ms 0.98 bench_connectivity.Connectivity.time_edge_face('120km')
7.07±0.01ms 7.13±0.04ms 1.01 bench_connectivity.Connectivity.time_edge_face('480km')
114±0.4ms 113±2ms 1.00 bench_connectivity.Connectivity.time_edge_node('120km')
6.51±0.03ms 6.94±0.4ms 1.07 bench_connectivity.Connectivity.time_edge_node('480km')
114±0.7ms 120±7ms 1.05 bench_connectivity.Connectivity.time_face_edge('120km')
6.97±0.3ms 6.76±0.3ms 0.97 bench_connectivity.Connectivity.time_face_edge('480km')
548±10ms 538±4ms 0.98 bench_connectivity.Connectivity.time_face_face('120km')
33.7±0.2ms 34.3±0.4ms 1.02 bench_connectivity.Connectivity.time_face_face('480km')
46.0±2μs 45.5±2μs 0.99 bench_connectivity.Connectivity.time_face_node('120km')
45.3±2μs 47.8±2μs 1.06 bench_connectivity.Connectivity.time_face_node('480km')
332±10μs 315±4μs 0.95 bench_connectivity.Connectivity.time_n_nodes_per_face('120km')
248±10μs 224±3μs ~0.91 bench_connectivity.Connectivity.time_n_nodes_per_face('480km')
116±1ms 113±0.5ms 0.98 bench_connectivity.Connectivity.time_node_edge('120km')
7.36±0.06ms 6.70±0.02ms 0.91 bench_connectivity.Connectivity.time_node_edge('480km')
45.3±1ms 43.3±0.6ms 0.96 bench_connectivity.Connectivity.time_node_face('120km')
3.11±0.08ms 2.98±0.03ms 0.96 bench_connectivity.Connectivity.time_node_face('480km')
5.86±0.02ms 6.26±0.3ms 1.07 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.75±0.01ms 2.00±0.1ms ~1.14 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
6.32±6s 8.12±9ms ~0.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
1.36±0.06ms 1.27±0.04ms 0.94 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
57.3k 57.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
12.3k 12.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
123k 123k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
128 128 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.27M 1.27M 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
50.1k 50.1k 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
1.48M 1.48M 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
712 712 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.93M 2.01M 1.04 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.93M 2.01M 1.04 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
2.09M 2.18M 1.04 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
404M 404M 1.00 face_bounds.FaceBoundsColdStartRss.peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
436M 436M 1.00 face_bounds.FaceBoundsColdStartRss.peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
406M 407M 1.00 face_bounds.FaceBoundsColdStartRss.peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
405M 405M 1.00 face_bounds.FaceBoundsColdStartRss.peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
909±50ns 802±30ns ~0.88 geometry_kernels.AccucrossKernels.time_accucross
1.81±0.07μs 1.80±0.05μs 0.99 geometry_kernels.AccucrossKernels.time_accucross_pair
348±20ns 301±20ns ~0.87 geometry_kernels.EFTPrimitives.time_acc_sqrt_re
286±50ns 357±40ns ~1.25 geometry_kernels.EFTPrimitives.time_diff_of_products
306±50ns 265±20ns ~0.87 geometry_kernels.EFTPrimitives.time_two_prod
271±20ns 299±20ns 1.10 geometry_kernels.EFTPrimitives.time_two_sum
1.06±0.07μs 1.01±0.04μs 0.95 geometry_kernels.GCAConstLatIntersection.time_accux_constlat_kernel
713±50ns 760±30ns 1.07 geometry_kernels.GCAConstLatIntersection.time_gca_const_lat_intersection
1.31±0.03μs 1.38±0.03μs 1.06 geometry_kernels.GCAConstLatIntersection.time_try_gca_const_lat_intersection
1.16±0.05μs 1.14±0.07μs 0.98 geometry_kernels.GCAGCAIntersection.time_accux_gca_kernel
992±30ns 977±20ns 0.98 geometry_kernels.GCAGCAIntersection.time_gca_gca_intersection
1.56±0.5μs 1.46±0.02μs 0.93 geometry_kernels.GCAGCAIntersection.time_try_gca_gca_intersection
36.2±0.5μs 35.7±4μs 0.99 geometry_kernels.OrientPredicates.time_on_minor_arc
747±30ns 850±70ns ~1.14 geometry_kernels.OrientPredicates.time_orient3d_on_sphere
1.98±0.1ms 1.79±0.02ms ~0.90 geometry_samebody.SameBodyConstLat.time_accux_dispatch
585±10μs 583±6μs 1.00 geometry_samebody.SameBodyConstLat.time_accux_kernel
1.20±0.03ms 1.20±0.02ms 1.00 geometry_samebody.SameBodyConstLat.time_fp64_dispatch
142±40μs 141±30μs 1.00 geometry_samebody.SameBodyConstLat.time_fp64_kernel
27.1±0.06ms 28.8±1ms 1.06 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_dispatch
7.32±0.09ms 6.39±0.01ms ~0.87 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_kernel
24.0±0.08ms 23.9±0.04ms 0.99 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_dispatch
3.90±0.09ms 3.81±0.04ms 0.98 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_kernel
6.83±0.04s 7.74±0.3s ~1.13 import.Imports.timeraw_import_uxarray
365M 362M 0.99 import.Imports.track_peakmem_import_uxarray
2.19±0.1ms 2.18±0.05ms 0.99 mpas_ocean.CheckNorm.time_check_norm('120km')
516±3ms 521±4ms 1.01 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
34.0±2ms 32.2±0.3ms 0.95 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
452±10μs 476±6μs 1.05 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
389±10μs 386±10μs 0.99 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
3.28±0.02ms 3.28±0.03ms 1.00 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('120km')
2.56±0.02ms 2.55±0.02ms 1.00 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('480km')
73.9±0.1ms 73.7±0.3ms 1.00 mpas_ocean.ConstructFaceLatLon.time_welzl('120km')
7.27±0.4ms 7.13±0.3ms 0.98 mpas_ocean.ConstructFaceLatLon.time_welzl('480km')
9.13±0.03ms 9.18±0.05ms 1.01 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')
619±20μs 620±20μs 1.00 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
6.83±0.02ms 6.79±0.04ms 0.99 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
461±8μs 494±20μs 1.07 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
383±2ms 395±10ms 1.03 mpas_ocean.CrossSections.time_const_lat('120km', 1)
196±9ms 197±2ms 1.01 mpas_ocean.CrossSections.time_const_lat('120km', 2)
100±2ms 97.8±1ms 0.98 mpas_ocean.CrossSections.time_const_lat('120km', 4)
336±1ms 337±10ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 1)
169±0.8ms 169±0.5ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 2)
87.1±0.6ms 87.0±0.6ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 4)
424M 425M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('120km', 1)
424M 425M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('120km', 2)
425M 425M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('120km', 4)
407M 408M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('480km', 1)
407M 408M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('480km', 2)
408M 408M 1.00 mpas_ocean.CrossSectionsPeakMem.peakmem_const_lat('480km', 4)
18.4±0.2ms 18.4±0.08ms 1.00 mpas_ocean.DualMesh.time_dual_mesh_construction('120km')
2.11±0.1ms 1.95±0.02ms 0.93 mpas_ocean.DualMesh.time_dual_mesh_construction('480km')
59.7±0.08ms 59.7±0.9ms 1.00 mpas_ocean.FaceAreas.time_face_areas('120km')
6.25±0.3ms 5.93±0.1ms 0.95 mpas_ocean.FaceAreas.time_face_areas('480km')
229k 229k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('120km')
14.3k 14.3k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('480km')
2.12M 2.12M 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('120km')
798k 799k 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('480km')
579±3ms 580±4ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
37.8±3ms 34.1±1ms ~0.90 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
50.7±0.4ms 49.5±0.5ms 0.98 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
3.70±0.05ms 3.71±0.1ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
166±0.8ms 167±0.6ms 1.00 mpas_ocean.Gradient.time_gradient('120km')
11.2±0.06ms 11.2±0.07ms 0.99 mpas_ocean.Gradient.time_gradient('480km')
457k 457k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('120km')
28.7k 28.7k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('480km')
5.08M 5.08M 1.00 mpas_ocean.Gradient.track_peakmem_gradient('120km')
328k 328k 1.00 mpas_ocean.Gradient.track_peakmem_gradient('480km')
421M 419M 0.99 mpas_ocean.GradientColdStartRss.peakmem_gradient('120km')
399M 398M 1.00 mpas_ocean.GradientColdStartRss.peakmem_gradient('480km')
337±10μs 310±20μs 0.92 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
140±4μs 152±9μs 1.09 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
410±9μs 398±10μs 0.97 mpas_ocean.Integrate.time_integrate('120km')
371±10μs 370±10μs 1.00 mpas_ocean.Integrate.time_integrate('480km')
18.4M 18.4M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('120km')
1.2M 1.2M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('480km')
111±5ms 112±2ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
111±2ms 109±2ms 0.98 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
111±1ms 113±3ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
8.54±0.08ms 8.48±0.07ms 0.99 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
8.52±0.1ms 8.90±0.2ms 1.04 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
8.78±0.2ms 8.73±0.6ms 0.99 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
112±0.5ms 111±0.7ms 0.99 mpas_ocean.NeighborhoodBuild.time_build('120km', 1.0)
694±4ms 701±4ms 1.01 mpas_ocean.NeighborhoodBuild.time_build('120km', 15.0)
248±1ms 248±3ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 5.0)
7.39±0.3ms 7.28±0.02ms 0.98 mpas_ocean.NeighborhoodBuild.time_build('480km', 1.0)
13.8±0.02ms 13.8±0.2ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('480km', 15.0)
9.57±0.7ms 9.12±0.04ms 0.95 mpas_ocean.NeighborhoodBuild.time_build('480km', 5.0)
110±2ms 108±0.6ms 0.98 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 1.0)
664±3ms 659±2ms 0.99 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 15.0)
241±0.8ms 240±2ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 5.0)
7.14±0.08ms 7.08±0.05ms 0.99 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 1.0)
13.5±0.3ms 13.7±1ms 1.02 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 15.0)
8.89±0.04ms 9.49±0.7ms 1.07 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 5.0)
1.19 1.19 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 1.0)
612.76 612.76 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 15.0)
74.17 74.17 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 5.0)
1.0 1.0 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 1.0)
37.29 37.29 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 15.0)
6.57 6.57 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 5.0)
728k 728k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 1.0)
141M 141M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 15.0)
17.4M 17.4M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 5.0)
43k 43k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 1.0)
563k 563k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 15.0)
123k 123k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 5.0)
5.72M 5.72M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 1.0)
145M 145M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 15.0)
21.5M 21.5M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 5.0)
362k 362k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 1.0)
824k 825k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 15.0)
384k 384k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 5.0)
33.2±1ms 33.8±0.9ms 1.02 mpas_ocean.NeighborhoodDask.time_mean('120km', 'grid_chunks')
14.1±0.2ms 14.3±0.1ms 1.01 mpas_ocean.NeighborhoodDask.time_mean('120km', 'numpy')
30.9±0.6ms 29.9±0.7ms 0.97 mpas_ocean.NeighborhoodDask.time_mean('120km', 'time_chunks')
10.6±0.4ms 10.1±0.1ms 0.95 mpas_ocean.NeighborhoodDask.time_mean('480km', 'grid_chunks')
346±5μs 344±8μs 0.99 mpas_ocean.NeighborhoodDask.time_mean('480km', 'numpy')
7.65±0.1ms 7.93±0.1ms 1.04 mpas_ocean.NeighborhoodDask.time_mean('480km', 'time_chunks')
5.76M 5.84M 1.01 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'grid_chunks')
2.75M 2.75M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'numpy')
5.69M 5.69M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'time_chunks')
676k 685k 1.01 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'grid_chunks')
177k 177k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'numpy')
543k 544k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'time_chunks')
7.52±0.02s 7.46±0.01s 0.99 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'mean')
8.02±0.02s 8.01±0.02s 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'median')
126±0.9ms 128±3ms 1.02 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'mean')
128±0.2ms 129±0.2ms 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'median')
740±6ms 770±40ms 1.04 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'mean')
877±10ms 871±10ms 0.99 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'median')
14.2±0.1ms 14.2±0.06ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'mean')
15.2±0.04ms 15.1±0.06ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'median')
39.6±2ms 36.8±0.8ms 0.93 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'mean')
185±2ms 176±1ms 0.95 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'median')
415±10μs 380±10μs 0.92 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'mean')
1.44±0.01ms 1.46±0.02ms 1.01 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'median')
239k 239k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'mean')
245k 245k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'median')
19.7k 19.7k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'mean')
20.2k 20.2k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'median')
251±7μs 247±8μs 0.98 mpas_ocean.PointInPolygon.time_face_search_lonlat('120km')
226±3μs 229±9μs 1.01 mpas_ocean.PointInPolygon.time_face_search_lonlat('480km')
228±8μs 235±10μs 1.03 mpas_ocean.PointInPolygon.time_face_search_xyz('120km')
206±9μs 204±3μs 0.99 mpas_ocean.PointInPolygon.time_face_search_xyz('480km')
138±0.3ms 132±0.5ms 0.96 mpas_ocean.RemapDownsample.time_bilinear_remapping
145±0.8ms 142±0.8ms 0.98 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
11.3±0.4ms 11.1±0.5ms 0.99 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
747±30ms 710±5ms 0.95 mpas_ocean.RemapUpsample.time_bilinear_remapping
9.20±0.3ms 9.19±0.4ms 1.00 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
5.92±0.6ms 5.38±0.03ms 0.91 mpas_ocean.ZonalAverage.time_zonal_average('120km')
2.76±0.09ms 2.67±0.03ms 0.97 mpas_ocean.ZonalAverage.time_zonal_average('480km')
426M 426M 1.00 mpas_ocean.ZonalAveragePeakMem.peakmem_zonal_average('120km')
408M 409M 1.00 mpas_ocean.ZonalAveragePeakMem.peakmem_zonal_average('480km')
4.66±0.03ms 4.72±0.09ms 1.01 quad_hexagon.QuadHexagon.time_open_dataset
3.96±0.02ms 4.11±0.2ms 1.04 quad_hexagon.QuadHexagon.time_open_grid
408 408 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_dataset
392 392 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_grid
73.7k 73.7k 1.00 quad_hexagon.QuadHexagon.track_peakmem_open_dataset
72.8k 72.8k 1.00 quad_hexagon.QuadHexagon.track_peakmem_open_grid

Benchmarks that have got worse:

Change Before [644dd69] After [f7d25e9] Ratio Benchmark (Parameter)
+ 38.3k 52.4k 1.37 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
+ 1.45±0.01ms 1.66±0.06ms 1.15 mpas_ocean.CheckNorm.time_check_norm('480km')

@Sevans711 Sevans711 removed the run-benchmark Run ASV benchmark workflow label Aug 25, 2026
@Sevans711

Copy link
Copy Markdown
Collaborator Author

@cmdupuis3 Do you have any guesses about whether the increased peakmem values for face_bounds are likely to be real performance hits, or just an artifact of how the benchmarks were run? Similar question for the slowdown of mpas_ocean.ZonalAverage.time_zonal_average('480km').

I don't see any obvious routes in the codebase where these changes would have any significant impact on memory usage. (I would only really expect that to occur if the error message is being generated as part of the standard control flow, something like try: if_it_works_we_are_in_case_A(); except Exception: handle_case_B(), but it doesn't look like that is occurring here? It's hard to know for sure though, which is the main reason I ran benchmarks.)

Less relevant to this PR, but also, do you have any guesses about why the bot edited the message 5 times after posting it? (Is there any change it is related to the benchmarking suite taking roughly 6 times longer than it took a few weeks/days(?) ago?)

@cmdupuis3

Copy link
Copy Markdown
Collaborator

@Sevans711 I've been seeing some odd behaviors from the FaceBounds benchmarks lately. I'm rerunning it to see if we get the same 38k -> 50k behavior in a second round

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design of an API, feature, or user interface (not just implementation details) developer experience Makes the codebase easier to read, debug, maintain, or extend. documentation Improvements or additions to documentation improvement Improvements on existing features or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error messages improvements in uxarray/grid

2 participants