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

Test examples #16

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
DemoCards = "0.5.1"
Documenter = "0.27"
Literate = "2"
17 changes: 3 additions & 14 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ using Documenter, DocumenterCitations, DemoCards
using Literate
using ParticleInCell2

@info "Generating tutorial materials from Literate script"
tutorial_path = joinpath(@__DIR__, "literate_src", "tutorial.jl")
tutorial_output_path = joinpath(@__DIR__, "src")
Literate.markdown(tutorial_path, tutorial_output_path, documenter = true)
Literate.notebook(tutorial_path, tutorial_output_path, documenter = true)
Literate.script(tutorial_path, tutorial_output_path, documenter = true)

@info "Generating examples using DemoCards"
examples_page, postprocess_democard_cb, demo_assets = makedemos("literate_src/examples")
examples_page, postprocess_democard_cb, demo_assets =
makedemos("../examples", filter_function = x -> !endswith(x.path, "_test.jl"))

@info "Gathering information from Project.toml"
PROJECT_TOML = Pkg.TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))
Expand All @@ -37,7 +31,7 @@ makedocs(
),
pages = [
"Introduction" => "index.md",
"Tutorial" => "tutorial.md",
"Tutorial" => "examples/tutorial/langmuir_oscillation.md",
examples_page,
"Plasma simulation theory" => [
"Introduction" => "theory/index.md",
Expand All @@ -52,10 +46,5 @@ makedocs(
@info "Postprocessing DemoCards"
postprocess_democard_cb()

@info "Clean up generated tutorial materials"
rm(joinpath(tutorial_output_path, "tutorial.md"))
rm(joinpath(tutorial_output_path, "tutorial.jl"))
rm(joinpath(tutorial_output_path, "tutorial.ipynb"))

@info "Deploying docs"
deploydocs(repo = "github.com/adamslc/ParticleInCell2.jl.git")
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ParticleInCell2
```

## Documentation sections
To get started, look at the [Tutorial](@ref), which includes step-by-step
To get started, look at the [Tutorial](@ref tutorial_langmuir), which includes step-by-step
instructions for running your first simulation using `ParticleInCell2`. After
that, you may want to browse the [Example Gallery](@ref), to see other problems
that this package can be used to solve. The [Plasma Simulation Theory](@ref)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"theme": "list",
"order": [
"tutorial",
"electrostatic",
"electromagnetic"
]
Expand Down
3 changes: 3 additions & 0 deletions examples/electromagnetic/electromagnetic_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@testitem "Beam heating example" tags = [:integration, :example] begin
include("beam_heating.jl")
end
15 changes: 15 additions & 0 deletions examples/electrostatic/electrostatic_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@testitem "Two-stream example" tags = [:integration, :example] begin
include("two_stream.jl")
end

@testitem "beam-plasma example" tags = [:integration, :example] begin
include("beam_plasma.jl")
end

@testitem "beam-cyclotron example" tags = [:integration, :example] begin
include("beam_cyclotron.jl")
end

@testitem "Landau damping example" tags = [:integration, :example] begin
include("landau_damping.jl")
end
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# # Tutorial
#md # !!! tip
#md # You can also view this tutorial as a
#md # [Jupyter notebook](@__NBVIEWER_ROOT_URL__/tutorial.ipynb) or you can
#md # download the plain Julia [script](tutorial.jl).
#
# ---
# title: "Tutorial: Langmuir oscillations"
# id: "tutorial_langmuir"
# ---
# This tutorial will get you up and running using `ParticleInCell2` by showing
# you how to model one of the simplest phenomena in plasma physics: an
# electrostatic (or Langmuir) oscillation.
Expand Down
3 changes: 3 additions & 0 deletions examples/tutorial/tutorial_test.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@testitem "LangmuirOscillationTest" tags = [:integration, :example, :tutorial] begin
include("langmuir_oscillation.jl")
end
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
100 changes: 0 additions & 100 deletions test/langmuir_oscillation_test.jl

This file was deleted.