pymc-devs / nutpie

Python wrapper for nuts-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

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