Skip to content

Commit

Permalink
shell tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Ortner committed Sep 10, 2024
1 parent 0807f85 commit b39d306
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ makedocs(;
"literate_tutorials/basic_julia_workflow.md",
"literate_tutorials/smoothness_priors.md",
"literate_tutorials/dataset_analysis.md",
"tutorials/scripting.md",
# "tutorials/lammps.md",
# "tutorials/python_ase.md",
# "tutorials/molly.md",
Expand Down
43 changes: 43 additions & 0 deletions docs/src/tutorials/scripting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

# Basic Shell Workflow

This short introduces a basic workflow where models are specified via
JSON files and model fitting is achieved via a shell script.

At the start of a new project we
- create a project folder
- activate a Julia project in that folder
- add `ACEpotentials` to the Julia project

```shell
mkdir myace
cd myace
julia --project=. -e 'using Pkg; Pkg.add("ACEpotentials")'
```

Next we can use an `ACEpotentials` utility to copy a script for running
the model fitting, and an example model specification file.

```shell
julia --project=. -e 'using ACEpotentials; ACEpotentials.copy_runfit(@__DIR__())'
```

This should create two new files in the `myace` folder:
- `runfit.jl`
- `example_params.json`
Copy (or move) the `example_params.json` file to a new filename, e.g.

```shell
cp example_params.json myace_params_1.json
```

then edit that file to specify the model hyperparameters,
the fitting method, and the path to the dataset (or, datasets if validation
and or test sets are also provided). To produce a fit, use

```shell
julia --project=. runfit.jl -p myace_params_1.json
```

This will produce an output file e.g. `results.jl` (the output filename can be changed in the input json), which contains the model specification, the fitted model parameters, and a dictionary of computed errors (rmse, mae).

2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using ACEpotentials, Test, LazyArtifacts

@testset "ACEpotentials.jl" begin

# @testset "Models" begin include("models/test_models.jl") end
@testset "Models" begin include("models/test_models.jl") end

# fitting tests
@testset "Test silicon" begin include("test_silicon.jl") end
Expand Down

0 comments on commit b39d306

Please sign in to comment.