Skip to content

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Sep 22, 2025

Closes #7891

The example in that issue:

import pymc as pm

with pm.Model(coords={'dim_1': ['a', 'b', 'c'], 'other': [1, 2, 3, 4]}) as m:
    x = pm.Normal('x', mu=0, sigma=1, dims=['dim_1'])
    mu = pm.Deterministic('mu', 1 + x, dims=['other'])
    sigma = pm.HalfNormal('sigma', 1)

    y = pm.Normal('y', mu=mu, sigma=sigma, dims=['dim_1'])
    idata = pm.sample()
    

Outputs

UserWarning: Incompatible coordinate length of 4 for dimension 'other' of variable 'mu'.
The original coordinates for this dim will not be included in the returned dataset for any of the variables. Instead they will default to `np.arange`, possibly right-padded with nan.
To make this warning into an error set `pymc.backends.arviz.RAISE_ON_INCOMPATIBLE_COORD_LENGTHS` to `True`

📚 Documentation preview 📚: https://pymc--7908.org.readthedocs.build/en/7908/

@ricardoV94
Copy link
Member Author

Some tests failing, meaning the plumbing needs to be tweaked. Anybody interested feel free to take over

@jessegrabowski
Copy link
Member

@SelimSBE if you wanted to work on this you can get the tests passing in this PR

@SelimSBE
Copy link

@SelimSBE if you wanted to work on this you can get the tests passing in this PR

Sure thing, working on it

@SelimSBE
Copy link

@jessegrabowski Quick question: would it be better to publish the fixes I'm working on as part of this PR, or open a separate one?

@jessegrabowski
Copy link
Member

Are you able to just push straight into this PR? If we have permissions set up to allow that it's easiest. Otherwise you will have to fork this PR branch and open a new one.

@SelimSBE
Copy link

Are you able to just push straight into this PR? If we have permissions set up to allow that it's easiest. Otherwise you will have to fork this PR branch and open a new one.

@jessegrabowski Hi, I don’t have push access to this PR branch, so I’ll open a new PR with the additional changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check idata dims/coords for consistency before sampling begins
3 participants