From 33d78c7f35a4745ca425b4b8a4aceda273a5bcc5 Mon Sep 17 00:00:00 2001 From: Orjan Ameye Date: Mon, 16 Sep 2024 09:27:20 +0200 Subject: [PATCH] remove gitmodule examples (#239) --- .gitignore | 2 ++ .gitmodules | 4 ---- docs/make_md_examples.jl | 5 +++-- examples | 1 - examples/Project.toml | 14 ++++++++++++++ examples/README.md | 9 +++++++++ examples/make_nb_examples.jl | 16 ++++++++++++++++ .../parametric_via_three_wave_mixing.jl | 0 {docs/src/examples => examples}/parametron.jl | 0 {docs/src/examples => examples}/wave_mixing.jl | 0 10 files changed, 44 insertions(+), 7 deletions(-) delete mode 100644 .gitmodules delete mode 160000 examples create mode 100644 examples/Project.toml create mode 100644 examples/README.md create mode 100644 examples/make_nb_examples.jl rename {docs/src/examples => examples}/parametric_via_three_wave_mixing.jl (100%) rename {docs/src/examples => examples}/parametron.jl (100%) rename {docs/src/examples => examples}/wave_mixing.jl (100%) diff --git a/.gitignore b/.gitignore index d6a101df..0de345cf 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ docs/build/** examples/jdp.mplstyle docs/node_modules/** docs/package-lock.json +*.ipynb +examples/parametron_result.jld2 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 619ae83c..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "examples"] - path = examples - url = https://github.com/NonlinearOscillations/HarmonicBalance_examples.git - branch = master diff --git a/docs/make_md_examples.jl b/docs/make_md_examples.jl index 3e8716bc..7e7b2b3b 100644 --- a/docs/make_md_examples.jl +++ b/docs/make_md_examples.jl @@ -2,10 +2,11 @@ using Literate ### Process examples # Always rerun examples -const EXAMPLES_IN = joinpath(@__DIR__, "src", "examples") -const OUTPUT_MD_DIR = joinpath(@__DIR__, "src/examples") +const EXAMPLES_IN = joinpath(@__DIR__, "..", "examples") +const OUTPUT_MD_DIR = joinpath(@__DIR__, "src", "examples") examples = filter!(file -> file[(end - 2):end] == ".jl", readdir(EXAMPLES_IN; join=true)) +filter!(file -> !contains(file, "make_nb_examples"), examples) if isempty(get(ENV, "CI", "")) # only needed when building docs locally; set automatically when built under CI diff --git a/examples b/examples deleted file mode 160000 index adccfa21..00000000 --- a/examples +++ /dev/null @@ -1 +0,0 @@ -Subproject commit adccfa215676923f51a8a4ce1243b8e20f3e4ae0 diff --git a/examples/Project.toml b/examples/Project.toml new file mode 100644 index 00000000..3912bfc0 --- /dev/null +++ b/examples/Project.toml @@ -0,0 +1,14 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" +DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365" +HarmonicBalance = "e13b9ff6-59c3-11ec-14b1-f3d2cc6c135e" +Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" +ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" + +[compat] +Documenter = "1" +julia = "1.9" diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 00000000..adc26feb --- /dev/null +++ b/examples/README.md @@ -0,0 +1,9 @@ +# HarmonicBalance notebooks + +This repo contains a collection of example Jupyter notebooks using [HarmonicBalance.jl](https://github.com/NonlinearOscillations/HarmonicBalance.jl) + +A detailed description of each example can be found at the [documentation](https://nonlinearoscillations.github.io/HarmonicBalance.jl/). + +If you would like to contribute your favourite system, feel free to get in touch, or simply open a pull request to this repo and the documentation. Also, if you use HarmonicBalance.jl in your project, we kindly ask you to cite [this paper](https://scipost.org/SciPostPhysCodeb.6) + + diff --git a/examples/make_nb_examples.jl b/examples/make_nb_examples.jl new file mode 100644 index 00000000..74eaef5f --- /dev/null +++ b/examples/make_nb_examples.jl @@ -0,0 +1,16 @@ +using Literate + +using HarmonicBalance, Plots +default(; fmt=:png) + +### Process examples +# Always rerun examples +const EXAMPLES_IN = @__DIR__ +const OUTPUT_NB_DIR = @__DIR__ + +examples = filter!(file -> file[(end - 2):end] == ".jl", readdir(EXAMPLES_IN; join=true)) +filter!(file -> !contains(file, "make_nb_examples"), examples) + +for example in examples + Literate.notebook(example, OUTPUT_NB_DIR; documenter=false, execute=true) +end diff --git a/docs/src/examples/parametric_via_three_wave_mixing.jl b/examples/parametric_via_three_wave_mixing.jl similarity index 100% rename from docs/src/examples/parametric_via_three_wave_mixing.jl rename to examples/parametric_via_three_wave_mixing.jl diff --git a/docs/src/examples/parametron.jl b/examples/parametron.jl similarity index 100% rename from docs/src/examples/parametron.jl rename to examples/parametron.jl diff --git a/docs/src/examples/wave_mixing.jl b/examples/wave_mixing.jl similarity index 100% rename from docs/src/examples/wave_mixing.jl rename to examples/wave_mixing.jl