Support shapefile / GeoJSON meshes via geopandas#59
Merged
Conversation
…DME router Adds GIS vector formats (.shp, .geojson) as first-class mesh inputs alongside the existing UGRID / MPAS / SCRIP / NetCDF / HEALPix paths. Loaders: - domain/mesh.py: new load_dataset() companion to load_grid(). Both branch on extension: .shp / .geojson go through ux.Grid.from_file(..., backend="geopandas"), HEALPix specs continue to use ux.Grid.from_healpix(), everything else falls through to ux.open_grid / ux.open_dataset. - domain/__init__.py: re-export load_dataset. Tools — route every local file open through the new loaders so the GIS path applies uniformly (no behaviour change for existing formats): - tools/inspection.py, tools/plotting.py, tools/capabilities.py, tools/advanced.py, tools/vector_calc.py: ux.open_dataset / ux.open_grid → load_dataset / load_grid. Remote — Globus Compute serializes each remote_* function body and ships it to the worker, so closures over a module-level helper aren't reliable across SDK versions. Each remote_* function inlines the same ~6 lines of extension dispatch. A NOTE at the top of remote/compute_functions.py explains why and warns "change one, change all". The earlier draft also contained unused _remote_load_grid / _remote_load_dataset helpers that have been removed to prevent a future maintainer from refactoring them in and breaking serialization. Extension list: dropped .shx / .dbf from the accepted-extension list — only .shp is a valid entry point (geopandas picks up the siblings automatically), and a user passing .shx or .dbf directly would have gotten a confusing geopandas error rather than the helpful fall-through. Tests: - tests/test_inspect_mesh.py: +test_inspect_shapefile_mesh, +test_inspect_geojson_mesh. - tests/test_plotting.py: 5 tests updated to patch load_dataset instead of the now-unused ux.open_dataset import path. - 295 / 295 pass locally. - Verified against real fixtures in ~/uxarray/test/meshfiles: outCSne30 ugrid (5400 faces), ne30pg2 scrip (21600 faces), chicago_neighborhoods.shp (101 faces), sample_chicago_buildings.geojson (10 faces). - Verified remote NetCDF path unchanged: inspect_mesh_remote + calculate_area_remote against the Polaris oi240lr240 base_mesh on chrysalis return identical results to prior runs (10302 faces, total_area = 4π unit sphere) with execution_venue=hpc:chrysalis. README: dropped "(5 min)", "(15 min)" suffixes from the four-row router for consistency; concrete times in step-by-step docs are kept.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Test plan