Skip to content

Commit

Permalink
Merge pull request #68 from cesmix-mit/update-doc
Browse files Browse the repository at this point in the history
Documentation update
  • Loading branch information
emmanuellujan authored Jun 5, 2024
2 parents dd3f14f + 2e6fa0e commit 1a5e961
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
version:
- "1.9"
- "1.10"
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
julia = ">= 1.9"
julia = ">= 1.10"
InteratomicPotentials = ">= 0.2.9"
8 changes: 5 additions & 3 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[deps]
AtomsBase = "a963bdd2-2df7-4f54-a1ee-49d51e6be12a"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
InteratomicPotentials = "a9efe35a-c65d-452d-b8a8-82646cd5cb04"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
PotentialLearning = "82b0a93c-c2e3-44bc-a418-f0f89b0ae5c2"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"
17 changes: 11 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")

examples = [
"Subsampling, compute descriptors, and fit ACE" => "Na/fit-dpp-ace-na"
"Compute ACE descriptors, subsample, and fit ACE" => "Na/fit-dpp-ace-na.jl"
]

for (_, name) in examples
example_filepath = joinpath(EXAMPLES_DIR, string(name, ".jl"))
Literate.markdown(example_filepath, OUTPUT_DIR, documenter=true)
for (_, example_path) in examples
s = split(example_path, "/")
sub_path, file_name = string(s[1:end-1]...), s[end]
example_filepath = joinpath(EXAMPLES_DIR, example_path)
Literate.markdown(example_filepath,
joinpath(OUTPUT_DIR, sub_path),
documenter = true)
end

examples = [title=>joinpath("generated", string(name, ".md")) for (title, name) in examples]
examples = [title => joinpath("generated", replace(example_path, ".jl" => ".md"))
for (title, example_path) in examples]


makedocs(
Expand All @@ -43,7 +48,7 @@ makedocs(
highlightsig = true,
sitename = "PotentialLearning.jl",
expandfirst = [],
draft = false,
draft = false,
pages = ["Home" => "index.md",
"How to run the examples" => "how-to-run-the-examples.md",
"Examples" => examples,
Expand Down
7 changes: 4 additions & 3 deletions examples/Na/fit-dpp-ace-na.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
push!(Base.LOAD_PATH, "../../")
#push!(Base.LOAD_PATH, "../../")

using Unitful, UnitfulAtomic
using AtomsBase, InteratomicPotentials, PotentialLearning
using LinearAlgebra, CairoMakie

# Load dataset
confs, thermo = load_data("data/liquify_sodium.yaml", YAML(:Na, u"eV", u""))
path = joinpath(dirname(pathof(PotentialLearning)), "../examples/Na/")
confs, thermo = load_data("$path/data/liquify_sodium.yaml", YAML(:Na, u"eV", u""))
confs, thermo = confs[220:end], thermo[220:end]

# Split dataset
Expand Down Expand Up @@ -61,7 +62,7 @@ scatter!(ax1, e_test, e_err_test, label = "Test", markersize = 5.0)
scatter!(ax1, e_train[dpp_inds2], e_err_train[dpp_inds2], markersize = 5.0,
color = :darkred, label = "DPP Samples")
axislegend(ax1)
save("figures/energy_error_training_test_scatter.pdf", fig)
save("$path/figures/energy_error_training_test_scatter.pdf", fig)
display(fig)


0 comments on commit 1a5e961

Please sign in to comment.