align_posterior_dim#
- pymc_marketing.pytensor_utils.align_posterior_dim(name, posterior_da, dim, bound)[source]#
Check
dim’s labels againstboundand reorder the axis to them.A dimension labeled on one side only cannot be checked, and a duplicated layout label could not be realigned by
sel– it would silently pick one column twice – so both are refused. An unlabeled dimension, or one whose labels already match, keeps its labels in the bound order.- Parameters:
- Return type:
xr.DataArray- Returns:
posterior_dawithdimin the order ofbound, or unchanged whendimis unlabeled on both sides.- Raises:
ValueError – If
dimis labeled on one side only,boundholds a duplicated label, or the two label sets differ in length or content.