Skip to content

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Feb 9, 2026

Add an xdist boolean flag to create pymc.dims variables instead.

This is a breaking change, existing custom classes will need to accept xdist flag in create_variable.

Local/odd imports are inplace until we remove experimental warnings from importing pymc.dims or pytensor.xtensor

@ricardoV94 ricardoV94 force-pushed the xprior branch 3 times, most recently from 0f03f4e to 5dc08d7 Compare February 9, 2026 16:59
@ricardoV94 ricardoV94 force-pushed the xprior branch 2 times, most recently from 0714a3a to 5284433 Compare February 9, 2026 17:10
@ricardoV94 ricardoV94 marked this pull request as ready for review February 9, 2026 17:10
@ricardoV94 ricardoV94 added enhancements New feature or request major labels Feb 9, 2026
Copy link

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

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

Great 🚀

if isinstance(value.type, pt.TensorType):
value = value.eval()

# Avoid XTensor import warnings, remove this when the warnings are gone

Choose a reason for hiding this comment

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

Do we wanna create an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah

Copy link
Collaborator

@williambdean williambdean left a comment

Choose a reason for hiding this comment

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

Overall looks pretty good.

if xdist:
import pytensor.xtensor as ptx

for module in (ptx.math, ptx.linalg, ptx.signal, ptx):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be causing some errors in the CI/CD

Copy link
Member Author

Choose a reason for hiding this comment

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

signal is not released yet I guess

prior = dist.sample_prior(coords=coords)
"""
# TODO: Why do we need a sample_prior function?
Copy link
Collaborator

Choose a reason for hiding this comment

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

sample_prior was to allow for VariableFactory instances to have sample_prior
functionality. User doesn't need to define a method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh I didn't mean to leave the comment, sorry


def test_custom_transform() -> None:
new_transform_name = "foo_bar"
dist = Prior("Normal", transform=new_transform_name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this raises later now?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could raise for tensor, it's unlikely it doesn't exist for that but it exists for xtensor. We also check for pymc distribution even though it may not be used at all

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

Labels

enhancements New feature or request major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants