Description
The internal function pm.data.determine_coords is called when pm.Data(..., export_index_as_coords=True) is invoked.
Right now it can only infer coords from pd.Series, or pd.DataFrame, but it would be nice (and actually quite simple) to do the same for xarray.DataArray variables.
After all, the pm.Data variables become xarray.DataArray again, when they're stored in the InferenceData.
Deliverables
- Inferring
dims from named pandas indexes
- Inferring
dims from DataArrays
- Inferring
coords from DataArrays
- A unit test
- Possibly a (backwards compatible with deprecation warning) rename of the
export_index_as_coords to infer_dims_and_coords.