Add AGENTS.md: PyMC 6.0 and ArviZ 1.0 conventions for AI coding agents#8313
Add AGENTS.md: PyMC 6.0 and ArviZ 1.0 conventions for AI coding agents#8313twiecki wants to merge 1 commit into
Conversation
|
|
||
| ### Credible intervals | ||
|
|
||
| ArviZ 1.0 changed the default from **0.94 HDI** to **0.89 equal-tailed interval (ETI)**. When writing docs or examples, use `hdi_prob=0.94` explicitly if HDI is intended, or accept the new 0.89 ETI default. |
There was a problem hiding this comment.
It is not called hdi_prob=0.94, it is ci_kind="hdi" and ci_prob=0.94, this works both at the rcparams global level or per function call.
| # ESS_bulk > 100 * n_chains and ESS_tail > 100 * n_chains | ||
|
|
||
| # 3. Posterior predictive check | ||
| az.plot_ppc(idata, kind="cumulative") |
There was a problem hiding this comment.
| az.plot_ppc(idata, kind="cumulative") | |
| az.plot_ppc_dist(idata, kind="ecdf") |
| # R-hat < 1.01 for all parameters (not 1.05, not 1.1 — those thresholds are outdated) | ||
| # ESS_bulk > 100 * n_chains and ESS_tail > 100 * n_chains | ||
|
|
||
| # 3. Posterior predictive check |
There was a problem hiding this comment.
We may want to specify the following:
- plot_ppc_pava (binary response)
- plot_ppc_rootogram (count response)
- plot_ppc_censored (survival)
we could be even more granular...
|
This seems fairly human-readable, and also useful for humans. Wouldn't |
| alpha = pm.Normal("alpha", mu_alpha, sigma_alpha, dims="group") | ||
| ``` | ||
|
|
||
| ### Gaussian Processes — prefer HSGP |
There was a problem hiding this comment.
It would be good to say the user should always set m and c/L using this function, Since it doesn't make sense to have a default. That would save people a lot of time and bad fits.
What this adds
A root-level
AGENTS.mdfile — a machine-readable guide for AI coding agents (Claude Code, Codex, Cursor, Copilot, etc.) working in this repository.The file encodes PyMC 6.0 and ArviZ 1.0 best practices that agents won't apply unprompted, including the breaking API changes that trip up most AI-generated PyMC code today.
Why AGENTS.md
AGENTS.mdis an open standard adopted by 60k+ open-source projects for providing AI agents with project-specific operational guidance. It is read automatically by Claude Code, OpenAI Codex, GitHub Copilot, Cursor, Devin, and others.Adding it here means any contributor using an AI coding agent gets PyMC 6-correct suggestions out of the box — without having to install a separate skill or configure anything.
Key pitfalls it prevents
idata.extend(other)— breaks in ArviZ 1.0idata.update(other)orextend_inferencedata=Trueaz.plot_trace(idata)— renamed in ArviZ 1.0az.plot_trace_dist()/az.plot_rank_dist()log_likelihoodpm.compute_log_likelihood(idata)after samplingsample_vars/freeze_varsAPI not usedsample_posterior_predictivevolatility APIsamples=Ninsample_prior_predictivedraws=N(samplesremoved in v6)random_seed=42everywheresum(map(ord, "analysis-name"))np.medianon posterior predictive probsnp.mean(median violates probability coherence)What's covered
arviz_stats.diagnose(), R-hat < 1.01, ESS thresholdspm.do/pm.observeaz.assert_closePrior art
Synthesizes best practices from:
🤖 Generated with Claude Code