Skip to content

fix: replace groupby with isel in posterior_alr_to_clr#103

Open
lucaspatel wants to merge 3 commits intobiocore:mainfrom
lucaspatel:fix/alr-to-clr-groupby
Open

fix: replace groupby with isel in posterior_alr_to_clr#103
lucaspatel wants to merge 3 commits intobiocore:mainfrom
lucaspatel:fix/alr-to-clr-groupby

Conversation

@lucaspatel
Copy link
Copy Markdown

Summary

  • Fixes custom model tutorial can't complete "posterior_alr_to_clr" function #101: posterior_alr_to_clr fails with newer xarray versions that no longer auto-squeeze the chain dimension in groupby(), producing a 4D array where 3D is expected.
  • Replaces groupby("chain") with isel(chain=i).values, which naturally drops the indexed dimension.
  • Adds regression tests for multi-chain, single-chain/single-covariate, and multi-param cases.

xarray removed automatic squeeze of the grouped dimension in groupby(),
causing _beta_alr_to_clr to receive a 4D array instead of 3D. Use
isel(chain=i).values which naturally drops the indexed dimension.
@lucaspatel lucaspatel force-pushed the fix/alr-to-clr-groupby branch from bb2903f to 2c02fd1 Compare February 10, 2026 23:54
@lucaspatel lucaspatel changed the title fix: replace groupby with isel in posterior_alr_to_clr (#101) fix: replace groupby with isel in posterior_alr_to_clr Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

custom model tutorial can't complete "posterior_alr_to_clr" function

1 participant