ReactiveBayes / ReactiveBayes/ExponentialFamilyProjection.jl
[MINOR] Supplementary-conditioner check uses identity (`!==`) instead of equality (`!=`)
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 11
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
[MINOR] Supplementary-conditioner check uses identity (!==) instead of equality (!=)
Summary
src/projected_to.jl:291:
if getconditioner(supplementary_ef) !== get_projected_to_conditioner(prj)
error(...)
end
!== is identity comparison. It works for scalar (immutable, value-equal) conditioners, but for array/tuple-valued conditioners, two equal-but-distinct objects ([1.0] !== [1.0]) will spuriously trip the error even though the conditioners are equal.
Evidence (Julia 1.12.6)
[1.0] !== [1.0] -> true, whereas 2.0 !== 2.0 -> false. So a Laplace-style family with a vector conditioner supplied again as a supplementary distribution would be wrongly rejected.
Suggested fix
Use != (equality) instead of !==, or compare via a conditioner-specific equality that respects value semantics.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/projected_to.jl:291 and trace the supplementary-conditioner validation. Reproduce the reported case with equal but distinct array or tuple conditioners, then verify that valid value-equal conditioners no longer trigger the error while scalar behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100