Skip to content

Implement shared XTensorVariables#1882

Merged
ricardoV94 merged 1 commit intopymc-devs:mainfrom
ricardoV94:xtensor_shared_variables
Feb 10, 2026
Merged

Implement shared XTensorVariables#1882
ricardoV94 merged 1 commit intopymc-devs:mainfrom
ricardoV94:xtensor_shared_variables

Conversation

@ricardoV94
Copy link
Member

I would love for us to move away from shared variables, but that's not on the table in the foreseeable future.

Therefore we should allow them to also be shared, so that we can use xtensor more seamless in the rest of the ecosystem.

Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nitpicks, apply if desired otherwise good to go

if not all(isinstance(dim, str) for dim in xarray_dims):
raise NotImplementedError(
"DataArray can only be converted to xtensor_constant if all dims are of string type"
"DataArray can only be converted to xtensor if all dims are of string type"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't auto-generate dim__0 dim__1 etc like arviz?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I opted to be more picky so you don't accidentally end up broadcasting things / misaligning variables

@ricardoV94 ricardoV94 force-pushed the xtensor_shared_variables branch from 9125e8e to 6586968 Compare February 10, 2026 14:09
@ricardoV94 ricardoV94 merged commit c647bb2 into pymc-devs:main Feb 10, 2026
64 checks passed
@ricardoV94 ricardoV94 deleted the xtensor_shared_variables branch February 10, 2026 14:18
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.

2 participants