-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,538 additions
and
37 deletions.
There are no files selected for viewing
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" | ||
PML = "6d0293b8-e749-48b5-896f-0ef93cd51027" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" |
This file contains 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using Documenter | ||
|
||
if haskey(ENV, "GITHUB_ACTIONS") | ||
ENV["JULIA_DEBUG"] = "Documenter" | ||
end | ||
|
||
deployconfig = Documenter.auto_detect_deploy_system() | ||
Documenter.post_status(deployconfig; type="pending", repo="github.com/gee-hydro/PML.jl.git") | ||
using Literate | ||
using Plots # to not capture precompilation output | ||
|
||
# generate examples | ||
EXAMPLE = joinpath(@__DIR__, "..", "examples", "ex-calib_IGBP.jl") | ||
OUTPUT = joinpath(@__DIR__, "src/generated") | ||
|
||
function preprocess(str) | ||
str = replace(str, "x = 123" => "y = 321"; count=1) | ||
return str | ||
end | ||
|
||
Literate.markdown(EXAMPLE, OUTPUT, preprocess=preprocess) | ||
Literate.notebook(EXAMPLE, OUTPUT, preprocess=preprocess) | ||
Literate.script(EXAMPLE, OUTPUT, preprocess=preprocess) | ||
|
||
# generate the example notebook for the documentation, keep in sync with outputformats.md | ||
Literate.markdown(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT; credit=false, name="name") | ||
Literate.notebook(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT; name="notebook") | ||
Literate.script(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT; credit=false) | ||
|
||
# Replace the link in outputformats.md | ||
# since that page is not "literated" | ||
if haskey(ENV, "GITHUB_ACTIONS") | ||
folder = Base.CoreLogging.with_logger(Base.CoreLogging.NullLogger()) do | ||
Documenter.deploy_folder( | ||
deployconfig; | ||
repo="github.com/gee-hydro/PML.jl.git", | ||
devbranch="master", | ||
push_preview=true, | ||
devurl="dev", | ||
).subfolder | ||
end | ||
url = "https://nbviewer.jupyter.org/github/gee-hydro/PML.jl/blob/gh-pages/$(folder)/" | ||
str = read(joinpath(@__DIR__, "src/outputformats.md"), String) | ||
str = replace(str, "[notebook.ipynb](generated/notebook.ipynb)." => "[notebook.ipynb]($(url)generated/notebook.ipynb).") | ||
write(joinpath(@__DIR__, "src/outputformats.md"), str) | ||
end | ||
|
||
# # Generate changelog | ||
# using Changelog | ||
# clog = joinpath(@__DIR__, "src", "changelog.md") | ||
# Changelog.generate( | ||
# Changelog.Documenter(), | ||
# joinpath(@__DIR__, "..", "CHANGELOG.md"), | ||
# clog; | ||
# repo="gee-hydro/PML.jl", | ||
# ) | ||
# write(clog, replace(read(clog, String), r"^# Literate.jl changelog"m => "# **9.** Changelog")) | ||
|
||
|
||
makedocs( | ||
format=Documenter.HTML( | ||
assets=["assets/custom.css", "assets/favicon.ico"], | ||
prettyurls=true, # haskey(ENV, "GITHUB_ACTIONS"), | ||
canonical="https://fredrikekre.github.io/Literate.jl/v2", | ||
), | ||
modules=[Literate], | ||
sitename="Literate.jl", | ||
pages=Any[ | ||
# "index.md", | ||
# "fileformat.md", | ||
# "pipeline.md", | ||
# "outputformats.md", | ||
# "customprocessing.md", | ||
# "documenter.md", | ||
# "tips.md", | ||
"generated/example.md", | ||
# "changelog.md", | ||
], | ||
) | ||
|
||
deploydocs( | ||
repo="github.com/gee-hydro/PML.jl.git", | ||
push_preview=true, | ||
versions=["v2" => "v^", "v#.#", "dev" => "dev"], | ||
deploy_config=deployconfig, | ||
) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
```@meta | ||
EditURL = "../../../examples/ex-calib_IGBP.jl" | ||
``` | ||
|
||
````@example ex-calib_IGBP | ||
using PML, Ipaper | ||
dir_proj = "$(@__DIR__)/.." | ||
df_out, df, par = deserialize("$dir_proj/data/CRO/FLUXNET_CRO") | ||
df.GPP_obs = df.GPPobs | ||
df.ET_obs = df.ETobs | ||
```` | ||
|
||
r = PMLV2_sites(df; par) | ||
|
||
````@example ex-calib_IGBP | ||
theta, goal, flag = model_calib(df, par0) | ||
df_out = PMLV2_sites(df; par=theta2par(theta)) | ||
gof = [ | ||
(; var="ET", GOF(df.ET_obs, df_out.ET)...), | ||
(; var="GPP", GOF(df.GPP_obs, df_out.GPP)...)] |> DataFrame | ||
DataFrame(gof) | ||
```` | ||
|
||
--- | ||
|
||
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).* | ||
|
File renamed without changes.
File renamed without changes.
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using PML, Ipaper | ||
|
||
df_out, df, par = deserialize(file_FLUXNET_CRO) | ||
df.GPP_obs = df.GPPobs | ||
df.ET_obs = df.ETobs | ||
|
||
# r = PMLV2_sites(df; par) | ||
theta, goal, flag = model_calib(df, par0) | ||
df_out = PMLV2_sites(df; par=theta2par(theta)) | ||
|
||
gof = [ | ||
(; var="ET", GOF(df.ET_obs, df_out.ET)...), | ||
(; var="GPP", GOF(df.GPP_obs, df_out.GPP)...)] |> DataFrame | ||
DataFrame(gof) |
File renamed without changes.
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Literate | ||
|
||
|
||
Literate.markdown("examples/README.jl", "."; flavor=Literate.CommonMarkFlavor()) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,4 +1,4 @@ | ||
include("DataType.jl") | ||
include("PMLV2_sites.jl") | ||
# include("PMLV2_sites.jl") | ||
include("model_calib.jl") | ||
include("model_gof.jl") |
This file contains 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 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 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