-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Before
type(xr_data["a"]) # DataArray
coords = {"x": xr_data.coords["x"].values, ...}
with pm.Model(coords = coords) as m:
a = pmd.Data(
"a", xr_data["a"], dims = ['x']
)
After
type(xr_data["a"]) # DataArray
with pm.Model() as m:
a = pmd.Data(
"a", xr_data["a"]
)
Context for the issue:
If the data is supplied as DataArray it already contains all information about dimensions and coordinates. The new functionality:
- infers the necessary dimensions for the Data object from the supplied data array
- automatically adds coordinates from the DataArray to the model.