Skip to content

Commit

Permalink
remove redundant plot recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelius-G committed Nov 3, 2023
1 parent 06c3cfa commit 4de9ffa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
13 changes: 0 additions & 13 deletions src/plotting/plot_measurements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,6 @@ end
end
end

# plot recipe for plotting a particular BinnedMeasurement from a NamedTuple
@recipe function f(
measurements::NamedTuple{<:Any, <:Tuple{Vararg{AbstractMeasurement}}},
name::Symbol;
uncertainties = true
)
@series begin
label --> string(name)
uncertainties --> uncertainties
measurements[name]
end
end


function total_uncertainty(
measurement::Union{Measurement, BinnedMeasurement},
Expand Down
8 changes: 6 additions & 2 deletions test/new/test_modelunc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ measurements = (
meas1 = Measurement(testfunc1, 111.1,
uncertainties = (unc1=10.1, unc2=12.2, unc3=13.3), active=true),

meas2 = Measurement(Observable(testfunc1, min=0, max=1000), 222.2,
meas2 = Measurement(Observable(testfunc1, min=0, max=200000), 222.2,
uncertainties = (unc1=20.1, unc2=20.2, unc3=23.3), active=false),

meas3 = Measurement(Observable(testfunc1, min=0, max=1000), 333.3,
meas3 = Measurement(Observable(testfunc1, min=0, max=200000), 333.3,
uncertainties = (unc1=30.1, unc2=30.2, unc3=30.3), active=true),

meas4 = BinnedMeasurement(Function[testfunc1, testfunc1, testfunc1],
Expand Down Expand Up @@ -68,6 +68,10 @@ logp(v)


t = @benchmark logp(v)
#TODO: why did this increase so much?
@test t.allocs == 15
@test t.memory == 720
@test minimum(t.times) 226 atol=5


# add tests that values with model uncertainties are correct
9 changes: 6 additions & 3 deletions test/new/test_nuisance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,18 @@ logp(rand(posterior.prior))
@test logp(v) -5.213494198124699e9


t = @benchmark logp(v)
t = @benchmark logp(v)
#TODO: why did this increase so much?
@test t.allocs == 15
@test t.memory == 720
@test minimum(t.times) 226 atol=5
@test minimum(t.times) 226 atol=5

myf = function(f, x)
for i in 1:10000
f(x)
end
end

@profview myf(logp, v)
@profview myf(logp, v)

# add tests that values with nuisances are correct

0 comments on commit 4de9ffa

Please sign in to comment.