ReactiveBayes / ReactiveBayes/ExponentialFamilyProjection.jl

[MINOR] Supplementary-conditioner check uses identity (`!==`) instead of equality (`!=`)

Open Beginner friendly
#103 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.