|
79 | 79 |
|
80 | 80 |
|
81 | 81 | """ |
82 | | - copy_runfit(dest) |
| 82 | + copy_runfit(dest = pwd()) |
83 | 83 |
|
84 | 84 | Copies the `runfit.jl` script and an example model parameter file to `dest`. |
85 | 85 | If called from the destination directory, use |
86 | 86 | ```julia |
87 | | -ACEpotentials.copy_runfit(@__DIR__()) |
| 87 | +ACEpotentials.copy_runfit() |
88 | 88 | ``` |
89 | 89 | This is intended to setup a local project directory with the necessary |
90 | 90 | scripts to run a fitting job. |
91 | 91 | """ |
92 | | -function copy_runfit(dest) |
| 92 | +function copy_runfit(dest = pwc()) |
93 | 93 | script_path = joinpath(@__DIR__(), "..", "scripts") |
94 | 94 | runfit_orig = joinpath(script_path, "runfit.jl") |
95 | 95 | exjson_orig = joinpath(script_path, "example_params.json") |
@@ -184,12 +184,19 @@ end |
184 | 184 | """ |
185 | 185 | copy_tutorial(dest) |
186 | 186 |
|
187 | | -Copies the `ACEpotential-Tutorial.ipynb` notebook file to `dest`. |
| 187 | +Converts the `ACEpotential-Tutorial.jl` literate notebook to a jupyter notebook |
| 188 | +and copies it to the folder `dest`. |
188 | 189 | """ |
189 | | -function copy_tutorial(dest) |
| 190 | +function copy_tutorial(dest = pwd()) |
190 | 191 | path = joinpath(@__DIR__(), "..", "examples", "Tutorial") |
191 | | - orig = joinpath(path, "ACEpotentials-Tutorial.ipynb") |
192 | | - dest = joinpath(dest, "ACEpotentials-Tutorial.ipynb") |
193 | | - run(`cp $orig $dest`) |
| 192 | + orig = joinpath(path, "ACEpotentials-Tutorial.jl") |
| 193 | + dest_jl = joinpath(dest, "ACEpotentials-Tutorial.jl") |
| 194 | + cp(orig, dest_jl) |
| 195 | + julia_cmd = Base.julia_cmd() |
| 196 | + run(`$julia_cmd --project=. -e 'using Pkg; Pkg.add(["IJulia", "Literate"])'`) |
| 197 | + jl_script = "using Literate; Literate.notebook(\"$dest_jl\", \"$dest\"; config = Dict(\"execute\" => false))" |
| 198 | + run(`$julia_cmd --project=. -e $jl_script`) |
| 199 | + rm(dest_jl) |
194 | 200 | return nothing |
195 | 201 | end |
| 202 | + |
0 commit comments