Skip to content

Commit

Permalink
First update to documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuellujan committed Jun 5, 2024
1 parent 9b4ac0b commit aae2e04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
23 changes: 14 additions & 9 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ DocMeta.setdocmeta!(
recursive = true,
)


bib = CitationBibliography(joinpath(@__DIR__, "citation.bib"))

# Generate examples

#const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
#const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")
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"
]

#examples = Pair{String,String}[]
for (_, name) in examples
example_filepath = joinpath(EXAMPLES_DIR, string(name, ".jl"))
Literate.markdown(example_filepath, OUTPUT_DIR, documenter=true)
end

#for (_, name) in examples
# example_filepath = joinpath(EXAMPLES_DIR, string(name, ".jl"))
# Literate.markdown(example_filepath, OUTPUT_DIR, documenter = true)
#end
examples = [title=>joinpath("generated", string(name, ".md")) for (title, name) in examples]

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

makedocs(
root = joinpath(dirname(pathof(PotentialLearning)), "..", "docs"),
Expand All @@ -39,9 +43,10 @@ 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,
"API" => "api.md"],
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
Expand Down
28 changes: 11 additions & 17 deletions docs/src/how-to-run-the-examples.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# How to run the examples

## Add registries

Open a Julia REPL (`$ julia`), type `]` to enter the Pkg REPL, and add the following registries:
```julia
pkg> registry add https://github.com/JuliaRegistries/General
Expand All @@ -10,32 +9,27 @@ Open a Julia REPL (`$ julia`), type `]` to enter the Pkg REPL, and add the follo
pkg> registry add https://github.com/ACEsuit/ACEregistry
```

## Install the dependencies of the `examples` folder project

## Clone repository and access an example folder
Clone `PotentialLearning.jl` repository in your working directory.
```shell
$ git clone [email protected]:cesmix-mit/PotentialLearning.jl.git
```
Open a Julia REPL activating the `examples` folder project.
```shell
$ julia --project=PotentialLearning.jl/examples
```
Type `]` to enter the Pkg REPL and instantiate.
```julia
pkg> instantiate
```

## Run an example

Access to any folder within `PotentialLearning.jl/examples`. E.g.
```shell
$ cd PotentialLearning.jl/examples/ACE
$ cd PotentialLearning.jl/examples/Na
```

## Run example
Open a Julia REPL, activate the `examples` folder project, and define the number of threads.
```julia
$ julia --project=../ --threads=4
$ julia --project=./ --threads=4
```
Type `]` to enter the Pkg REPL and instantiate.
```julia
pkg> instantiate
```
Finally, include the example file.
```julia
julia> include("fit-ace.jl")
julia> include("fit-dpp-ace-na.jl")
```

0 comments on commit aae2e04

Please sign in to comment.