Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testvalue for Counting measures #128

Open
cscherrer opened this issue Aug 21, 2023 · 0 comments
Open

Fix testvalue for Counting measures #128

cscherrer opened this issue Aug 21, 2023 · 0 comments
Assignees

Comments

@cscherrer
Copy link
Collaborator

As of v0.14.7, we have

testvalue(::Type{T}, d::Counting) where {T} = testvalue(T, d.support)

But then we get

julia> testvalue(Counting(Float64))
ERROR: MethodError: no method matching rand(::FixedRNG, ::Type{Float64}, ::Counting{Type{Float64}})

Closest candidates are:
  rand(::FixedRNG, ::Type{Float64})
   @ MeasureBase ~/git/MeasureBase.jl/src/fixedrng.jl:15
  rand(::FixedRNG, ::Type{T}) where T<:Real
   @ MeasureBase ~/git/MeasureBase.jl/src/fixedrng.jl:8
  rand(::Random.AbstractRNG, ::Type{T}, ::StdLogistic) where T
   @ MeasureBase ~/git/MeasureBase.jl/src/standard/stdlogistic.jl:13
  ...

Stacktrace:
 [1] rand(rng::FixedRNG, d::Counting{Type{Float64}})
   @ MeasureBase ~/git/MeasureBase.jl/src/rand.jl:7
 [2] testvalue::Counting{Type{Float64}})
   @ MeasureBase ~/git/MeasureBase.jl/src/utils.jl:14
 [3] top-level scope
   @ REPL[8]:1

Currently this causes MeasureTheory tests to fail. So we should

  1. Decide what the value of rand(rng, T::Type, U::Type) should be
  2. Move tests like testinterface(Counting(Float64)) from MeasureTheory to MeasureBase
@cscherrer cscherrer self-assigned this Aug 21, 2023
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

No branches or pull requests

1 participant