UXARRAY / uxarray

Xarray-styled package for reading and directly operating on unstructured grid datasets following UGRID conventions
https://uxarray.readthedocs.io/
Apache License 2.0
139 stars 30 forks source link

MPAS `face_face_connectivity` parsing #832

Closed aaronzedwick closed 6 days ago

aaronzedwick commented 1 week ago

Closes #830

Overview

Adds the ability to read in cellsOnCell from MPAS files and construct a grid with face_face_connectivity.

PR Checklist

General

github-actions[bot] commented 6 days ago

ASV Benchmarking

Benchmark Comparison Results Benchmarks that have improved: | Change | Before [07813fab] | After [66344cf6] | Ratio | Benchmark (Parameter) | |----------|----------------------|---------------------|---------|-------------------------------------------------| | - | 388M | 301M | 0.78 | mpas_ocean.Integrate.peakmem_integrate('480km') | Benchmarks that have stayed the same: | Change | Before [07813fab] | After [66344cf6] | Ratio | Benchmark (Parameter) | |----------|----------------------|---------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------| | | 239M | 240M | 1 | face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc')) | | | 300M | 300M | 1 | face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc')) | | | 317M | 305M | 0.96 | face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc')) | | | 315M | 301M | 0.95 | face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc')) | | | 13.8±0.04s | 14.1±0.07s | 1.03 | face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc')) | | | 2.07±0.01s | 2.08±0.02s | 1.01 | face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc')) | | | 19.5±0s | 19.7±0.1s | 1.01 | face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc')) | | | 73.0±0.7ms | 73.8±0.7ms | 1.01 | face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc')) | | | 1.63±0.01s | 1.65±0.02s | 1.01 | import.Imports.timeraw_import_uxarray | | | 5.74±0.03μs | 5.63±0.02μs | 0.98 | mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km') | | | 5.16±0.2μs | 5.34±0.02μs | 1.04 | mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km') | | | 366M | 370M | 1.01 | mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', False) | | | 345M | 349M | 1.01 | mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', True) | | | 320M | 320M | 1 | mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', False) | | | 319M | 319M | 1 | mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', True) | | | 1.19±0.01s | 1.21±0.01s | 1.01 | mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False) | | | 54.5±0.5ms | 54.4±0.4ms | 1 | mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True) | | | 93.6±2ms | 96.6±2ms | 1.03 | mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False) | | | 5.27±0.07ms | 5.22±0.1ms | 0.99 | mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True) | | | 253M | 256M | 1.01 | mpas_ocean.Gradient.peakmem_gradient('120km') | | | 233M | 233M | 1 | mpas_ocean.Gradient.peakmem_gradient('480km') | | | 2.67±0.03ms | 2.64±0.04ms | 0.99 | mpas_ocean.Gradient.time_gradient('120km') | | | 283±2μs | 282±7μs | 1 | mpas_ocean.Gradient.time_gradient('480km') | | | 320M | 320M | 1 | mpas_ocean.Integrate.peakmem_integrate('120km') | | | 174±1ms | 175±0.9ms | 1 | mpas_ocean.Integrate.time_integrate('120km') | | | 12.0±0.1ms | 11.9±0.04ms | 0.99 | mpas_ocean.Integrate.time_integrate('480km') | | | 231M | 229M | 0.99 | quad_hexagon.QuadHexagon.peakmem_open_dataset | | | 229M | 229M | 1 | quad_hexagon.QuadHexagon.peakmem_open_grid | | | 6.78±0.2ms | 6.58±0.01ms | 0.97 | quad_hexagon.QuadHexagon.time_open_dataset | | | 5.76±0.1ms | 5.64±0.08ms | 0.98 | quad_hexagon.QuadHexagon.time_open_grid |