-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Graceful incompatible coords handling #7912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Graceful incompatible coords handling #7912
Conversation
adjust tests adjust tests
@jessegrabowski as requested, I’ve just opened this PR for ticket #7891 , it’s ready for review. Thanks! |
coords={"school": np.arange(eight_schools_params["J"])}, | ||
dims={"theta": ["school"], "eta": ["school"]}, | ||
) | ||
with pytest.warns(UserWarning, match="Incompatible coordinate length"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were the coords invalid? I don't think they are supposed to be in this test, so maybe the test was faulty?
idata = pm.sample(tune=5, draws=draws, chains=2, return_inferencedata=True) | ||
thinned_idata = idata.sel(draw=slice(None, None, thin_by)) | ||
idata.extend(pm.sample_posterior_predictive(thinned_idata)) | ||
with pytest.warns(UserWarning, match="Incompatible coordinate length"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only affect the draw dimension, which is not part of the model?
trace = sample(chains=1, random_seed=numpy_rng) | ||
|
||
ppc = sample_posterior_predictive(trace, model=model, random_seed=numpy_rng) | ||
with pytest.warns(UserWarning, match="Incompatible coordinate length"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the invalid coord here? We should fix the model if there's one
Description
This PR updates the internal conversion logic to use
dict_to_dataset_drop_incompatible_coords
across all relevant backends.Related Issue
dict_to_dataset_drop_incompatible_coords
everywhere #7908Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7912.org.readthedocs.build/en/7912/