-
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
Open
DolineanuMircea
wants to merge
11
commits into
master
Choose a base branch
from
tests_photons/MD
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a73df5e
very rudimentary
DolineanuMircea 7a9f079
remove comented section
DolineanuMircea 66c43aa
Update ci
SebastianM-C 377f276
Use RegistrySpec
SebastianM-C a636ff1
fix
SebastianM-C 85562cf
Don't run ci twice
SebastianM-C ce118f2
Fix python
SebastianM-C 8812eb6
Add registry to docs
SebastianM-C 6ec0103
Use dir differently depending on CI
SebastianM-C 143bb86
Use julia as shell
SebastianM-C a6bfc38
Update test/runtests.jl
SebastianM-C File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,18 +1,40 @@ | ||
| using SDFResultViewer | ||
| using Unitful | ||
| using SDFResults | ||
| 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) | ||
| if isempty(ENV["CI"]) | ||
| dir = "/mnt/storage/epoch/Wang-Arefiev2020mod/12mtt_0.8w0_l0_MDO" | ||
| else | ||
| dir = pwd() | ||
| end | ||
| 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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.