Why are my coords creating an error after sampling is complete?

pm.sample doesn’t actually check that the coords you provide match the dimensions of the outputs until after sampling is complete (I’ve wasted a lot of time this way). The best way I’ve found to do a pre-check is to always run pm.sample_prior_predictive before you sample.

As for why the coords are the wrong shape, i suspect the culprit is this line:

trend = pm.Deterministic('trend', growth * t_ + offset, dims = 'location')

This looks like it should have a shape like time, not like locations. Is the number 943 the number of time steps or observations? This number is a hint to what is going wrong.