# PyMC-Marketing 1.0 API basis

Verified on 20 August 2026 against the stable **PyMC-Marketing 1.0.0** release.

## Release/runtime contract

PyMC-Marketing 1.0.0 was released on 7 August 2026. Its published package metadata requires:

- Python `>=3.12`
- PyMC `>=6.0.0,<6.1.0`
- PyMC-Extras `>=0.11.0,<0.13.0`
- ArviZ `>=1.2.0,<2`
- NumPy `>=2,<3`

This repository targets `pymc-marketing>=1.0.0,<2` and follows that 1.x dependency line.

## APIs used by this project

- `from pymc_marketing.mmm import MMM` is the supported MMM import.
- `MMM.save(...)` writes the model DataTree to NetCDF or Zarr.
- `MMM.load(...)` opens the DataTree and reconstructs the model.
- `MMM.posterior` returns the `/posterior` group as an `xarray.Dataset`.
- `MMM.predict_posterior(X, extend_idata=..., combined=...)` delegates prediction to PyMC-Marketing's posterior predictive machinery.
- PyMC-Marketing 1.0 model configuration uses native `Prior`/special-prior objects; `parse_model_config` raises on legacy dict-format prior specifications.
- `LogNormalPrior` and `LaplacePrior` remain supported special priors and serialise through their `to_dict()` methods with `special_prior`, `kwargs`, optional `dims`, and `centered`.
- ArviZ 1.2 uses the split `arviz-stats` numerical stack; the sweep's PSIS wrapper is written against that API.

## Public references

- https://pypi.org/project/pymc-marketing/1.0.0/
- https://www.pymc-marketing.io/en/1.0.0/api/generated/pymc_marketing.mmm.mmm.MMM.html
- https://www.pymc-marketing.io/en/1.0.0/api/generated/pymc_marketing.model_config.parse_model_config.html
- https://www.pymc-marketing.io/en/1.0.0/api/generated/pymc_marketing.special_priors.html
- https://github.com/pymc-labs/pymc-marketing/blob/1.0.0/pymc_marketing/model_builder.py
- https://github.com/pymc-labs/pymc-marketing/blob/1.0.0/pymc_marketing/special_priors.py
- https://pypi.org/project/arviz-stats/1.2.0/
