Skip to content

Using Particles{Bool,N} in a conditional #85

@millerjoey

Description

@millerjoey

Thanks for the great package that Chad Scherrer introduced me to!

Currently,

julia> Bernoulli(Particles(10, Uniform()))
ERROR: TypeError: non-boolean (Particles{Bool,10}) used in boolean context

is an error due to the check_args call. You can get around this with Bernoulli(Particles(10, Uniform()), check_args=false), but it would be nice if that weren't needed. Would it be dangerous/too special-cased if a Particles{Bool} with all 1s behaved like a true in a conditional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions