-
Notifications
You must be signed in to change notification settings - Fork 0
Tests for plot recipes #37
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
a73df5e
7a9f079
66c43aa
377f276
a636ff1
85562cf
ce118f2
8812eb6
6ec0103
143bb86
a6bfc38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,16 +3,33 @@ using Unitful | |
| using Test | ||
|
|
||
| @testset "SDFResultViewer.jl" begin | ||
| λ = 800u"nm" | ||
| dir = pwd() | ||
| file = "0002.sdf" | ||
| times = get_times(dir, λ) | ||
| @test length(times) == 1 | ||
|
|
||
| m_Lx = mean_Lx(dir, λ) | ||
| @test length(m_Lx) == 1 | ||
|
|
||
| Lx, y, z = Lx_slice(joinpath(dir, file), λ, 0) | ||
| @test length(Lx) > 0 | ||
| @test length(Lx) == length(y) == length(z) | ||
| dir = "/mnt/storage/epoch/Wang-Arefiev2020mod/12mtt_0.8w0_l0_MDO" | ||
|
||
| sim = read_simulation(dir) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to add |
||
|
|
||
| test_plot1 = SDFResultViewer.photon_energy_spectrum(sim; mark_max = true) | ||
|
|
||
| test_plot21 = SDFResultViewer.photon_dens_integrated(sim; direction = :y) | ||
| test_plot22 = SDFResultViewer.photon_dens_integrated(sim; direction = :z) | ||
|
|
||
| test_plot31 = SDFResultViewer.photon_en_dens_integrated(sim; direction = :y, endens_scale = 10^3) | ||
| test_plot32 = SDFResultViewer.photon_en_dens_integrated(sim; direction = :z, endens_scale = 10^3) | ||
|
|
||
| test_plot4 = SDFResultViewer.energy_spectrum(sim) | ||
|
|
||
| test_plot5 = SDFResultViewer.photon_solid_angle_emission(sim; angle = pi/4) | ||
|
|
||
| @test typeof(test_plot1) == Plots.Plot{Plots.GRBackend} | ||
| @test typeof(test_plot21) == Plots.Plot{Plots.GRBackend} | ||
| @test typeof(test_plot22) == Plots.Plot{Plots.GRBackend} | ||
| @test typeof(test_plot32) == Plots.Plot{Plots.GRBackend} | ||
| @test typeof(test_plot31) == Plots.Plot{Plots.GRBackend} | ||
| @test typeof(test_plot4) == Plots.Plot{Plots.GRBackend} | ||
|
|
||
| @test typeof(test_plot5) == PyPlot.Figure | ||
|
|
||
| @test SDFResultViewer.powertostring(2, 2^BigInt(1345)) == "2¹³⁴⁵" | ||
| @test SDFResultViewer.powertostring(10, 1000) == "10³" | ||
|
|
||
| @test SDFResultViewer.cell_length(sim, :x) == 15u"μm"/450 | ||
|
|
||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.