Skip to content

Conversation

@JasperMartins
Copy link
Contributor

@JasperMartins JasperMartins commented Dec 12, 2025

This PR addresses the issue described in the second item of #1026

To reiterate, issues arise if not all names associated with a JointPrior are sampled/requested for probability calculation or rescaling.
JointPrior and BaseJointPriorDist keep track of the names that have been requested internally. Once all names associated with a BaseJointPriorDist-instance have been requested, this internal storage is reset. This can lead to unexpected behavior if only a subset of the the names are requested. For instance, if one wants to sample a subset of the JointPrior-names repeatedly, the returned samples would never change (even if the requested size changes). The easiest solution would be to only consider ConditionalPriorDicts resolved if for any included JointPrior all names associated with JointPrior.dist are also included.

This PR fixes this.

Note: The solution does not solve a similar issue in PriorDict (which would also not necessarily rescale to the correct order). Since any individual JointPrior is essentially a conditional random variable, I'd suggest to limit joint priors to ConditionalPriorDict.

Copy link
Collaborator

@ColmTalbot ColmTalbot left a comment

Choose a reason for hiding this comment

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

Looks good to me

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.

2 participants