MMMIDataWrapper.compare_coords#

MMMIDataWrapper.compare_coords(mmm, variable='channel_data')[source]#

Find coordinate mismatches between idata and the model.

Compares the coordinate values for each custom dimension (i.e. not "date") of the specified variable between this wrapper’s idata and the fitted PyMC model.

Parameters:
mmmMMM

Fitted MMM model instance whose model attribute contains the PyMC model with coordinate metadata.

variablestr, default "channel_data"

Name of the model variable whose dimensions are checked.

Returns:
tuple of (dict[str, set[str]], dict[str, set[str]])

(in_model_not_idata, in_idata_not_model) where:

  • in_model_not_idata: mapping from dimension name to the set of coordinate values present in the model but absent from the idata. When a dimension is entirely missing from the idata (e.g. dropped by a scalar filter_dims call), all of the model’s coordinates for that dimension are included.

  • in_idata_not_model: mapping from dimension name to the set of coordinate values present in the idata but absent from the model (e.g. new labels introduced by aggregate_dims).

Only dimensions with at least one mismatched coordinate are included in each dict; empty dicts mean full compatibility.