compile_pymc creates an 'obs_id' coord
jaharvey8 opened this issue · comments
I couldn't totally find where this happens but compile_pymc creates an "obs_id" coordinate automatically. If the user doesn't provide that coordinate it gets populated as None. This causes this line of code to throw an error
coords = {name: pd.Index(vals) for name, vals in model.coords.items()}
as pd.Index(vals) is expecting vals to be an array of some kind.
Should we auto-populate the obs_id coordinate as an array of the length of the number of observations?
I deleted my message above I didn't realize this was the nutpie repo
In PyMC we use this utility: https://github.com/pymc-devs/pymc/blob/904a0eaac216732bc358dd91680cd428d95704f0/pymc/backends/arviz.py#L103
Yeah I realized after posting this that probably what was happening is I specified the "dims" for a distribution as "obs_id" but didn't provide "obs_id" as a coordinate. Pymc automagically handles this behavior. Do we want nutpie to do the same? Or I should just stop doing silly things when specifying the model (in which case we can close this issue)?
It should either work or raise an informative error