diff --git a/src/inputs/inputs.jl b/src/inputs/inputs.jl index bdffcded..03ad4b16 100644 --- a/src/inputs/inputs.jl +++ b/src/inputs/inputs.jl @@ -56,3 +56,5 @@ function sns_zero_point(inputs::AbstractVector{<:UQInput}) return sns end + +Base.broadcastable(i::T) where {T<:UQInput} = Ref(i) diff --git a/test/inputs/inputs.jl b/test/inputs/inputs.jl index af61c2eb..79a77d53 100644 --- a/test/inputs/inputs.jl +++ b/test/inputs/inputs.jl @@ -31,4 +31,10 @@ inputs = [pi, jd, z] @testset "count_rvs" begin @test count_rvs(inputs) == 3 end + + @testset "broadcasting" begin + x = RandomVariable(Normal(), :x) + u = rand(10) + @test pdf.(x.dist, u) == pdf.(x, u) + end end