-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d5de22
commit b91af05
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[deps] | ||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
include("metrics.jl") | ||
include("plots.jl") | ||
|
||
function test_analysis() | ||
test_metrics() | ||
test_plots() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function test_plots() | ||
@testset "■ Plots ■" verbose = true begin | ||
test_sampleset_plot() | ||
end | ||
end | ||
|
||
function test_sampleset_plot() | ||
@testset "SampleSet" begin | ||
ω = SampleSet([ | ||
Sample([0, 0], 1.0, 1), | ||
Sample([0, 1], 2.0, 2), | ||
Sample([1, 0], 3.0, 3), | ||
Sample([1, 1], 4.0, 4), | ||
]) | ||
|
||
let r = RecipesBase.apply_recipe(Dict{Symbol,Any}(), ω) | ||
@test length(r) == 1 | ||
@test length(r[].args) == 2 | ||
|
||
x, y = r[].args | ||
attr = r[].plotattributes | ||
|
||
@test x == [1.0, 2.0, 3.0, 4.0] | ||
@test y == [1, 2, 3, 4] | ||
|
||
@test attr[:ylabel] == "Frequency" | ||
@test attr[:xlabel] == "Energy" | ||
end | ||
end | ||
end |