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

Cm/docs canon #193

Merged
merged 12 commits into from
Feb 27, 2024
Merged

Cm/docs canon #193

merged 12 commits into from
Feb 27, 2024

Conversation

quffaro
Copy link
Member

@quffaro quffaro commented Jan 31, 2024

Docs broken.

  1. src/canon/docs_test.jl may have a working macro defined but it should be moved to src/canon.jl and applied to the other examples.
  2. Literate is commented out in docs/make.jl because of rogue formatting obstacles in the examples.

@quffaro quffaro requested a review from jpfairbanks January 31, 2024 14:55

macro create_pode(modelname,source,variable,pode)
quote
local v1 = $(esc(modelname))
Copy link
Member

Choose a reason for hiding this comment

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

I think you don’t need the local on this.


$v3

"""
Copy link
Member

Choose a reason for hiding this comment

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

After the “”” you want to have const $modelname = @decapode begin $pode end

end

for (modelname,link,variable,pode) ∈ db
@eval @create_pode $modelname $link $variable $pode
Copy link
Member

Choose a reason for hiding this comment

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

If you replace @create_pode with a function create_pode then the line here can be

eval(create_pode(modelname, link, variable, pode))

,("Oscillator", "https://www.archlinux.org", "oscillator", quote y="BBBB" end)]

macro create_pode(modelname,source,variable,pode)
quote
Copy link
Member

Choose a reason for hiding this comment

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

For auto docs, you will need to add export @modelname to the expr that you are generating.

@quffaro quffaro mentioned this pull request Feb 2, 2024

$desc

### Model
Copy link
Member

Choose a reason for hiding this comment

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

promote to ## Model

" end, "\n")

docstring = "
## $modelname
Copy link
Member

Choose a reason for hiding this comment

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

Promote to # $modelname


### Model

$modeldef
Copy link
Member

Choose a reason for hiding this comment

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

$modeldef 

@jpfairbanks
Copy link
Member

I think we should use the Markdown stdlib to get the formatting right.

https://github.com/JuliaLang/julia/blob/master/stdlib/Markdown/src/Markdown.jl

a="a"; using Markdown; Markdown.catdoc(md"# h1", md"$a", md"$a", md"paragraph")
works for me.

Copy link
Member

@jpfairbanks jpfairbanks left a comment

Choose a reason for hiding this comment

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

This is almost there. We have 3 changes in 1 PR, which we should try to avoid, but I don't want to delay by starting over here. See inline comments

# check if we are in a valid git repository
REPO=`git rev-parse --show-toplevel`
if [[ ! $REPO ]]; then
echo "badness"
Copy link
Member

Choose a reason for hiding this comment

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

echo "We are not in a valid git repo $(pwd)"

@@ -0,0 +1,6 @@
srun --cpus-per-task=32 \
--mem=8G \
Copy link
Member

Choose a reason for hiding this comment

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

16G by default might be safer.

using Decapodes
using MultiScaleArrays
using MLStyle
using OrdinaryDiffEq
using LinearAlgebra
using GLMakie
using CairoMakie
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should use

using CairoMakie
import CairoMakie: wireframe [all the other methods we use]

and then we won't have to use the CairoMakie namespace in the code. Then if we switch back to GL, we can just change it at the top of the file.

end
)

# @docapode(:OutgoingLongwaveRadiation
Copy link
Member

Choose a reason for hiding this comment

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

why commented out?




# Diffusion = @decapode DiffusionQuantities begin
Copy link
Member

Choose a reason for hiding this comment

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

why commented out?

@jpfairbanks
Copy link
Member

Also squash all this history into 1-3 commits before merging.

@quffaro quffaro force-pushed the cm/docs-canon branch 2 times, most recently from ac6bd73 to fcc53d1 Compare February 14, 2024 15:08
@@ -32,7 +33,6 @@ Catlab = "0.15, 0.16"
CombinatorialSpaces = "0.5, 0.6"
ComponentArrays = "0.15"
DataStructures = "0.18.13"
DiagrammaticEquations = "0.1.2"
Copy link
Member

Choose a reason for hiding this comment

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

This seems important. Why delete?

Brusselator = @decapode begin
# Values living on vertices.
Copy link
Member

Choose a reason for hiding this comment

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

Can these comments get the ## coment treatment that we discovered in the literate docs?

@jpfairbanks
Copy link
Member

the commit that got lost in being bad at git

diff --git a/examples/chemistry/brusselator_bounded.jl b/examples/chemistry/brusselator_bounded.jl
index b2cf391..4b72fb0 100644
--- a/examples/chemistry/brusselator_bounded.jl
+++ b/examples/chemistry/brusselator_bounded.jl
@@ -65,7 +65,7 @@ resolve_overloads!(Brusselator)
 to_graphviz(Brusselator)

 # TODO: Create square domain of approximately 32x32 vertices.
-s = loadmesh(Rectangle_30x10())
+s = triangulated_grid(30,10,2,2)
 scaling_mat = Diagonal([1/maximum(x->x[1], s[:point]),
                         1/maximum(x->x[2], s[:point]),
                         1.0])
@@ -230,7 +230,7 @@ constants_and_parameters = (
   R = R,
   F = t -> t ≥ 1.1 ? F₂ : F₁)

-tₑ = 21.5e4
+tₑ = 21.5e2

 @info("Precompiling Solver")
 prob = ODEProblem(fₘ, u₀, (0, 1e-4), constants_and_parameters)

@jpfairbanks jpfairbanks merged commit 0c37b8b into main Feb 27, 2024
7 of 8 checks passed
@jpfairbanks jpfairbanks deleted the cm/docs-canon branch February 27, 2024 17:49
@lukem12345 lukem12345 mentioned this pull request Mar 3, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants