html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4285#issuecomment-1227114966,https://api.github.com/repos/pydata/xarray/issues/4285,1227114966,IC_kwDOAMm_X85JJEnW,4160723,2022-08-25T11:09:06Z,2022-08-25T11:09:06Z,MEMBER,"> Does anyone see any other potential use case? Similarly to @TomNicholas' oceanography observation data example, I was thinking about trajectories or more generally any collection of geospatial ""features"". An alternative approach to ""ragged"" arrays (i.e., arrays of lists as described by @SimonHeybrock) would be to have regular arrays with opaque objects as elements. For example, [pygeos](https://github.com/pygeos/pygeos) (now merged in [shapely](https://github.com/shapely/shapely) 2.0) provides vectorized operations (numpy ufuncs) for arrays of `Geometry` objects (points, polylines, polygon, etc.) and is used as a backend for spatial operations in geopandas data frames (side note: that would probably be useful in xarray too). This approach is more specific than ""ragged"" arrays (it heavily relies on the tools provided for dealing with the opaque objects) and in some cases it might not be ideal, e.g., when the data collected for the geospatial features is not ""geometry invariant"" (like for the trajectories of buoys floating and drifting in the oceans). But perhaps both approach may co-exist in a single xarray Dataset? (e.g., feature geometry as coordinates of shapely object arrays and feature data as ragged arrays, if necessary). > This seems hard. Xarray's whole model is built assuming that dims has type Mapping[Hashable, int]. It also breaks our normal concept of alignment, which we need to put coordinate variables in DataArrays alongside data variables. > Scipp's ragged data can be considered a ""partial sorting"", to build a sort of ""index"". Sounds like a good use case for Xarray explicit indexes to support some of Scipp's features. I can imagine a ""ragged"" array coordinate coupled with a custom Xarray index to perform data selection (slicing) and alignment along the ""regular"" dimension(s) of the ragged array. ","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,667864088