Skip to content

Conversation

@zaxtax
Copy link
Contributor

@zaxtax zaxtax commented Dec 16, 2025

This enables using recover_marginals in a model context. Just required making the model argument optional

Closes #610

@zaxtax zaxtax requested a review from ricardoV94 December 16, 2025 01:58
@zaxtax zaxtax force-pushed the recover_marginals_fix branch from 6d6cdbb to 0dfb495 Compare December 16, 2025 14:11
Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

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

Just some minor suggestions, let me know if too much of a drag

"""
if isinstance(idata, Model):
raise TypeError("The first argument of `recover_marginals` must be an idata")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
raise TypeError("The first argument of `recover_marginals` must be an idata")
raise TypeError("The order of arguments of `recover_marginals` changed. The first input must be an idata")

@zaxtax
Copy link
Contributor Author

zaxtax commented Dec 18, 2025 via email

@ricardoV94 ricardoV94 changed the title Enable recover_marginals to work with implicit models recover_marginals infers model from model context Dec 18, 2025
@ricardoV94
Copy link
Member

Need to ignore the arviz warning on project.toml and open an issue to address whatever it means.

@zaxtax
Copy link
Contributor Author

zaxtax commented Dec 18, 2025 via email

@ricardoV94
Copy link
Member

It's done here:

pymc-extras/pyproject.toml

Lines 102 to 112 in 10d6765

filterwarnings =[
"error",
# JAX issues an over-eager warning if os.fork() is called when the JAX module is loaded, even if JAX isn't being used
'ignore:os\.fork\(\) was called\.:RuntimeWarning',
# Preliz needs to update for pytensor > 2.35
'ignore:.*`pytensor\.graph\.basic\.ancestors`.*`pytensor\.graph\.traversal\.ancestors`.*:FutureWarning:^preliz(\.|$)',
# OpenMP library warning on windows CI
'ignore::RuntimeWarning:threadpoolctl'
]

@zaxtax
Copy link
Contributor Author

zaxtax commented Dec 18, 2025 via email

@ricardoV94
Copy link
Member

Not because of any changes you did, so mark the test as xfail and open an issue to track?

@zaxtax zaxtax force-pushed the recover_marginals_fix branch 2 times, most recently from 7a9d85e to aec4360 Compare December 19, 2025 14:03
@zaxtax zaxtax force-pushed the recover_marginals_fix branch from 7893941 to 126e31b Compare December 19, 2025 16:19
@ricardoV94
Copy link
Member

We have two RTD jobs? Anyway failure unlikely to be related

@ricardoV94 ricardoV94 merged commit f8772b1 into pymc-devs:main Dec 19, 2025
16 of 18 checks passed
@ricardoV94
Copy link
Member

Thanks @zaxtax

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.

recover_marginals doesn't work with implicit model from modelcontext

2 participants