Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Nov 15, 2023
1 parent 4313011 commit aba7ba4
Show file tree
Hide file tree
Showing 16 changed files with 1,278 additions and 1,744 deletions.
5 changes: 4 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
style = "sciml"
pipe_to_function_call=false
always_for_in = false
separate_kwargs_with_semicolon = true
margin = 132
margin = 132
yas_style_nesting=true
ignore = [".git"]
47 changes: 19 additions & 28 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,58 +1,49 @@
using Documenter, ExtendableGrids, Literate, GridVisualize,Pluto
using Documenter, ExtendableGrids, Literate, GridVisualize, Pluto
using GridVisualize.FlippableLayout
import CairoMakie
CairoMakie.activate!(type="svg",visible=false)
CairoMakie.activate!(; type = "svg", visible = false)
using Test


plotting=joinpath(@__DIR__,"..","examples","plotting.jl")
plotting = joinpath(@__DIR__, "..", "examples", "plotting.jl")
include(plotting)



function rendernotebook(name)
ENV["PLUTO_PROJECT"]=@__DIR__
ENV["PLUTO_PROJECT"] = @__DIR__
println("rendernotebook($(name))")
input=joinpath(@__DIR__,"..","examples",name*".jl")
output=joinpath(@__DIR__,"src",name*".html")
session = Pluto.ServerSession();
notebook = Pluto.SessionActions.open(session, input; run_async=false)
input = joinpath(@__DIR__, "..", "examples", name * ".jl")
output = joinpath(@__DIR__, "src", name * ".html")
session = Pluto.ServerSession()
notebook = Pluto.SessionActions.open(session, input; run_async = false)
html_contents = Pluto.generate_html(notebook)
write(output, html_contents)
end


include("makeplots.jl")

example_md_dir = joinpath(@__DIR__,"src","examples")

example_md_dir = joinpath(@__DIR__, "src", "examples")

function mkdocs()

Literate.markdown(plotting, example_md_dir, documenter=false,info=false)
Literate.markdown(plotting, example_md_dir; documenter = false, info = false)

if true
rendernotebook("plutovista")
makeplots(example_md_dir, Plotter=CairoMakie, extension="svg")
makeplots(example_md_dir; Plotter = CairoMakie, extension = "svg")
end
generated_examples=joinpath.("examples",filter(x->endswith(x, ".md"),readdir(example_md_dir)))
makedocs(sitename="GridVisualize.jl",
generated_examples = joinpath.("examples", filter(x -> endswith(x, ".md"), readdir(example_md_dir)))
makedocs(; sitename = "GridVisualize.jl",
modules = [GridVisualize],
doctest = false,
clean = false,
authors = "J. Fuhrmann",
repo="https://github.com/j-fu/GridVisualize.jl",
pages=[
"Home"=>"index.md",
"Public API"=> "api.md",
"Private API"=> "privapi.md",
repo = "https://github.com/j-fu/GridVisualize.jl",
pages = [
"Home" => "index.md",
"Public API" => "api.md",
"Private API" => "privapi.md",
"Examples" => generated_examples,
])
end

mkdocs()

deploydocs(repo = "github.com/j-fu/GridVisualize.jl.git",devbranch = "main")



deploydocs(; repo = "github.com/j-fu/GridVisualize.jl.git", devbranch = "main")
32 changes: 14 additions & 18 deletions docs/makefigs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ import GLMakie
include("examples/plotting.jl")

function makefigs()
Plotter=PyPlot
scene=plotting_multiscene(Plotter=Plotter)
save("multiscene_pyplot.png",scene,Plotter=Plotter)


Plotter=Plots
scene=plotting_multiscene(Plotter=Plotter)
save("multiscene_plots.png",scene,Plotter=Plotter)

Plotter=GLMakie
scene=plotting_multiscene(Plotter=Plotter)
save("multiscene_glmakie.png",scene,Plotter=Plotter)


Plotter=VTKView
scene=plotting_multiscene(Plotter=Plotter)
save("multiscene_vtkview.png",scene,Plotter=Plotter)
Plotter = PyPlot
scene = plotting_multiscene(; Plotter = Plotter)
save("multiscene_pyplot.png", scene; Plotter = Plotter)

end
Plotter = Plots
scene = plotting_multiscene(; Plotter = Plotter)
save("multiscene_plots.png", scene; Plotter = Plotter)

Plotter = GLMakie
scene = plotting_multiscene(; Plotter = Plotter)
save("multiscene_glmakie.png", scene; Plotter = Plotter)

Plotter = VTKView
scene = plotting_multiscene(; Plotter = Plotter)
save("multiscene_vtkview.png", scene; Plotter = Plotter)
end
83 changes: 39 additions & 44 deletions docs/makeplots.jl
Original file line number Diff line number Diff line change
@@ -1,84 +1,79 @@
function makeplots(picdir; Plotter=GLMakie, extension="png")
function makeplots(picdir; Plotter = GLMakie, extension = "png")
p = plotting_multiscene(; Plotter = Plotter)

p=plotting_multiscene(Plotter=Plotter)

fname=joinpath(picdir,"plotting_multiscene."*extension)
save(fname,p,Plotter=Plotter)
fname = joinpath(picdir, "plotting_multiscene." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("multiscene")



p=plotting_func1d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_func1d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_func1d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_func1d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("func1d")

p=plotting_func2d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_func2d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_func2d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_func2d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("func2d")

p=plotting_func3d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_func3d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_func3d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_func3d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("func3d")


fname=joinpath(picdir,"plotting_jfunc1d."*"gif")
p=plotting_jfunc1d(Plotter=Plotter,filename=fname)
fname = joinpath(picdir, "plotting_jfunc1d." * "gif")
p = plotting_jfunc1d(; Plotter = Plotter, filename = fname)
@test isfile(fname)
println("jfunc1d")

p=plotting_jfunc2d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_jfunc2d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_jfunc2d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_jfunc2d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("jfunc2d")

p=plotting_jfunc3d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_jfunc3d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_jfunc3d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_jfunc3d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("jfunc3d")


p=plotting_vec2d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_vec2d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_vec2d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_vec2d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)

println("vec2d")

p=plotting_stream2d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_stream2d."*extension)
save(fname,p,Plotter=Plotter)
@test isfile(fname) || GridVisualize.plottername!="PyPlot"
p = plotting_stream2d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_stream2d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname) || GridVisualize.plottername != "PyPlot"
println("stream2d")

p=plotting_grid1d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_grid1d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_grid1d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_grid1d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("grid1d")

p=plotting_grid2d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_grid2d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_grid2d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_grid2d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("grid2d")

p=plotting_grid3d(Plotter=Plotter)
fname=joinpath(picdir,"plotting_grid3d."*extension)
save(fname,p,Plotter=Plotter)
p = plotting_grid3d(; Plotter = Plotter)
fname = joinpath(picdir, "plotting_grid3d." * extension)
save(fname, p; Plotter = Plotter)
@test isfile(fname)
println("grid3d")

fname=joinpath(picdir,"plotting_movie."*"gif")
p=plotting_movie(;filename=fname,Plotter=Plotter)
fname = joinpath(picdir, "plotting_movie." * "gif")
p = plotting_movie(; filename = fname, Plotter = Plotter)
@test isfile(fname)
println("plotting_movie")
true
Expand Down
Loading

2 comments on commit aba7ba4

@j-fu
Copy link
Member Author

@j-fu j-fu commented on aba7ba4 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95395

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.0 -m "<description of version>" aba7ba49c91d0ef616d51929340774b9d09fd729
git push origin v1.3.0

Please sign in to comment.