If you have only a single observation, you can’t then do any KDE or histogram plot, but you should still be able to use kind="scatter" and check that the observation is in a high probability region of the posterior predictive.
The difference between the “mean” and “not mean” lines is only that the histogram or kde is either generated with the samples from a single draw and chain or combining all available draws and chains. Differences between the two lines are a clear signal that something is going wrong. In this case, there is only an observation, so the non mean lines (blue ones) are histograms of a single value which doesn’t really make any sense. ArviZ has a hard rule on histograms of discrete data that the bin width can never be smaller than 1. It looks like the lines above are single bin histograms that don’t even have contibuous bins for the vertical bin edges to be shown. As I said above, the scatter kind would be more indicated in this case.
This is not exactly a posterior predictive check. First it is plotting a latent variable, so it can’t be compared to any observation, second it is comparing the “mean” type line with a histogram of all the samples from all draws and chains to random subsets of multiple samples from multiple chains and draws, not all of them but multiple. The base idea of a posterior predictive check is comparing the observed data to in sample posterior predictive samples. If the model is correct, one should not be able to distinguish the observed data from the posterior predictive samples. By in sample posterior predictive samples I mean posterior predictive samples that correspond to predictions on the exact same data that was used to fit the model (i.e. in a regression, use the same x instead of changing it to generate actual predictions/out of sample posterior predictive samples).
Just as a note, N is a latent/posterior variable that is sampled in pm.sample. Adding that here is only copying the samples already stored in trace (that go to data_ppc.posterior) to the ppc dictionary (that goes to data_ppc.posterior_predictive). At best it will be confusing to ArviZ because there will be variables in the posterior predictive group without corresponding variable in observed data group, so some of the automatation won’t work. At worst it will be confusing for you and people reading the code at a conceptual level. Only deterministics need to be explicitly added there sometimes even when they are not posterior predictive variables when generating predictions.
The futurewarning I’d recommend taking care of it as it is probably to prepare you for an easy transition to v4. The effective sample size warning doesn’t necessarly mean anything. In this case, as the sampler is MH and not NUTS, low efficiency is expected. As @jessegrabowski said, you need to check that the effective sample size (ess) is high enough, and for that you’ll need many more actual samples that what you’d need with NUTS and a model with continuous variables. In fact, this warning has been removed in v4 as it is more confusing than helpful, especially when not using NUTS as sampler. It is not related to having 1, 10 or 200 observations.
One of the main pain points of PyMC 3.x is shape handling. It is often inconsistent between scalars and length 1 vectors which I suspect is the root of this issue. There is probably a decoy dimension likelihood_dim_0 in the posterior_predictive that is not in the observed data or viceversa. Assuming it is in the posterior_predictive and taking into account comments from other answers, I’d recommend something like (note that I haven’t run any of the code though, some tweaks might be needed):
[...]
trace = pm.sample(10000, tune=2000, return_inferencedata=False)
pp_dict = pm.sample_posterior_predictive(trace)
idata = az.from_pymc3(trace=trace, posterior_predictive=pp_dict)
idata.posterior_predictive = idata.posterior_predictive.squeeze()
az.plot_ppc(idata, kind="scatter", figsize=(12, 6))
Or updating to the beta release of v4 already and following the pattern in https://docs.pymc.io/en/latest/learn/examples/posterior_predictive.html