Skip to content

Commit

Permalink
Merge branch 'main' into rpmd-docs-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexsp32 authored Nov 10, 2023
2 parents 37e5fbb + 0c56d37 commit 202a26f
Show file tree
Hide file tree
Showing 59 changed files with 538 additions and 27 deletions.
15 changes: 8 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NQCDynamics"
uuid = "36248dfb-79eb-4f4d-ab9c-e29ea5f33e14"
authors = ["James <james.gardner1421@gmail.com>"]
version = "0.13.3"
version = "0.13.4"

[deps]
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
Expand Down Expand Up @@ -45,16 +45,16 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

[compat]
AdvancedHMC = "0.5"
AdvancedMH = "0.6, 0.7"
ComponentArrays = "0.11, 0.12, 0.13, 0.14"
AdvancedHMC = "0.5, 0.6"
AdvancedMH = "0.6, 0.7, 0.8"
ComponentArrays = "0.11, 0.12, 0.13, 0.14, 0.15"
DEDataArrays = "0.2"
Dictionaries = "0.3"
DiffEqBase = "6"
Distributions = "0.25"
FastBroadcast = "0.1, 0.2"
FastLapackInterface = "1, 2"
HDF5 = "0.15, 0.16"
HDF5 = "0.15, 0.16, 0.17"
Interpolations = "0.13, 0.14"
MuladdMacro = "0.2"
NQCBase = "0.2"
Expand All @@ -72,7 +72,7 @@ Reexport = "1"
RingPolymerArrays = "0.1"
Roots = "1, 2"
Rotations = "1"
SciMLBase = "1"
SciMLBase = "1, 2"
StaticArrays = "1"
StatsBase = "0.33, 0.34"
StochasticDiffEq = "6"
Expand All @@ -92,6 +92,7 @@ DiffEqNoiseProcess = "77a26b50-5914-5dd7-bc55-306e6241c503"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
JuLIP = "945c410c-986d-556a-acb1-167a618e0462"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand All @@ -100,4 +101,4 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "SafeTestsets", "CSV", "DataFrames", "DiffEqNoiseProcess", "FiniteDiff", "DiffEqDevTools", "Logging", "PyCall", "JuLIP", "Symbolics", "Statistics", "Plots"]
test = ["Test", "SafeTestsets", "CSV", "DataFrames", "DiffEqNoiseProcess", "FiniteDiff", "DiffEqDevTools", "Logging", "MKL", "PyCall", "JuLIP", "Symbolics", "Statistics", "Plots"]
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
UnitfulAtomic = "a7773ee8-282e-5fa2-be4e-bd808c38a91a"

[compat]
Documenter = "0.27"
Documenter = "1"
DocumenterCitations = "1"
37 changes: 37 additions & 0 deletions docs/add_profiling_info.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

function add_text_blocks(file)
preamble = """
```@setup logging
@info "Expanding $file..."
start_time = time()
```
"""

postamble = """
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after \$runtime s."
```
"""

(tmppath, tmpio) = mktemp()
open(file) do io
write(tmpio, preamble)
for line in eachline(io, keep=true) # keep so the new line isn't chomped
write(tmpio, line)
end
write(tmpio, postamble)
end
close(tmpio)
mv(tmppath, file, force=true)
end


for (root, dirs, files) in walkdir("src")
for file in files
if splitext(file)[2] == ".md"
filepath = joinpath(root, file)
add_text_blocks(filepath)
end
end
end
11 changes: 3 additions & 8 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ using DocumenterCitations
using NQCBase, NQCModels, NQCDistributions, NQCDynamics
using CubeLDFAModel, NNInterfaces

DocMeta.setdocmeta!(NQCDynamics, :DocTestSetup, :(using NQCDynamics); recursive=true)
DocMeta.setdocmeta!(NQCModels, :DocTestSetup, :(using NQCModels, Symbolics); recursive=true)
DocMeta.setdocmeta!(NQCBase, :DocTestSetup, :(using NQCBase); recursive=true)

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

function find_all_files(directory)
Expand All @@ -16,16 +12,15 @@ function find_all_files(directory)
)
end

@time makedocs(
bib,
@time makedocs(;
plugins=[bib],
sitename="NQCDynamics.jl",
modules=[NQCDynamics, NQCDistributions, NQCModels, NQCBase, CubeLDFAModel],
strict=true,
doctest=false,
format=Documenter.HTML(
prettyurls=get(ENV, "CI", nothing) == "true",
canonical="https://nqcd.github.io/NQCDynamics.jl/stable/",
assets=["assets/favicon.ico", "assets/citations.css"],
ansicolor=true,
),
authors="James Gardner and contributors.",
pages=[
Expand Down
11 changes: 10 additions & 1 deletion docs/src/NQCDistributions/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCDistributions/overview.md..."
start_time = time()
```
# NQCDistributions.jl

# Storing and sampling distributions
Expand Down Expand Up @@ -67,7 +71,7 @@ read on to the next sections about the included sampling methods.
### VelocityBoltzmann

When performing equilibrium simulations it is often desirable to initialise trajectories
when thermal velocities, e.g. in combination with positions obtained from Monte Carlo sampling.
with thermal velocities, e.g. in combination with positions obtained from Monte Carlo sampling.
These can be obtained for each atom from a gaussian distribution of the appropriate
width, or alternatively, using the [`VelocityBoltzmann`](@ref) distribution which simplifies
the process.
Expand Down Expand Up @@ -155,3 +159,8 @@ total_dist.electronic.state # Returns the chosen electronic state.

```


```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/NQCModels/analyticmodels.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCModels/analyticmodels.md..."
start_time = time()
```
# Analytic model library

This page plots many of the analytic models included in `NQCDynamics`.
Expand Down Expand Up @@ -93,3 +97,7 @@ z = range(-0.5, 4.0, length=200)
contour(x, z, v1, color=:blue, levels=0:0.01:0.1, label="V11", colorbar=false)
contour!(x, z, v2, color=:red, levels=0:0.01:0.1, label="V22")
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
14 changes: 11 additions & 3 deletions docs/src/NQCModels/ase.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCModels/ase.md..."
start_time = time()
```
# ASE interface

The easiest way to obtain potentials and forces from established codes is to
Expand All @@ -23,12 +27,12 @@ associated calculator to implement the required [`potential`](@ref) and
First, it is necessary to import `ase` and create the `ase.Atoms` object and attach
the desired calculator. This works exactly as in Python:
```@example ase
using PyCall
using PythonCall: pyimport, pylist
using ASEconvert
ase = pyimport("ase")
emt = pyimport("ase.calculators.emt")
h2 = ase.Atoms("H2", [(0, 0, 0), (0, 0, 0.74)])
h2 = ase.Atoms("H2", pylist([(0, 0, 0), (0, 0, 0.74)]))
h2.calc = emt.EMT()
nothing # hide
```
Expand All @@ -53,3 +57,7 @@ derivative(model, rand(3, 2))
[SchNetPack (SPK)](https://github.com/atomistic-machine-learning/schnetpack) by
passing their ASE calculator to the `AdiabaticASEModel`.
Take a look at [Neural network models](@ref) to learn more.
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/NQCModels/frictionmodels.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCModels/frictionmodels.md..."
start_time = time()
```
# [Electronic friction models](@id models-friction)

To perform [molecular dynamics with electronic friction (MDEF)](@ref mdef-dynamics)
Expand Down Expand Up @@ -69,3 +73,7 @@ to obtain the time-dependent perturbation theory friction from the atomic positi
As with LDFA, one of these models is used in the
[reactive scattering example](@ref example-h2scattering).

```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/NQCModels/neuralnetworkmodels.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCModels/neuralnetworkmodels.md..."
start_time = time()
```
# Neural network models

Using the [ASE interface](@ref) we can directly use models trained using
Expand Down Expand Up @@ -59,3 +63,7 @@ r = [0 0; 0 0; 0 ustrip(auconvert(0.74u"Å"))]
potential(model, r)
derivative(model, r)
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/NQCModels/overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/NQCModels/overview.md..."
start_time = time()
```
# NQCModels.jl

To perform nonadiabatic molecular dynamics simulations, it is necessary to define
Expand Down Expand Up @@ -102,3 +106,7 @@ AbstractTrees.print_tree(Model) # hide

To learn more about NQCModels.jl and learn how to implement new models,
visit the [developer documentation](@ref devdocs-model).
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCBase/nqcbase.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
```@setup logging
@info "Expanding src/api/NQCBase/nqcbase.md..."
start_time = time()
```

# NQCBase

```@autodocs
Modules=[NQCBase]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDistributions/nqcdistributions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
```@setup logging
@info "Expanding src/api/NQCDistributions/nqcdistributions.md..."
start_time = time()
```

# NQCDistributions

```@autodocs
Modules=[NQCDistributions]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/calculators.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/calculators.md..."
start_time = time()
```
# Calculators

```@autodocs
Modules=[NQCDynamics.Calculators]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/dynamicsmethods.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/dynamicsmethods.md..."
start_time = time()
```

# DynamicsMethods

Expand Down Expand Up @@ -34,3 +38,7 @@ Modules=[NQCDynamics.DynamicsMethods.EhrenfestMethods]
```@autodocs
Modules=[NQCDynamics.DynamicsMethods.IntegrationAlgorithms]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/dynamicsoutputs.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/dynamicsoutputs.md..."
start_time = time()
```

# DynamicsOutputs

Expand All @@ -15,3 +19,7 @@ Private=false
Modules=[NQCDynamics.DynamicsOutputs]
Public=false
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/dynamicsutils.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/dynamicsutils.md..."
start_time = time()
```

# DynamicsUtils

```@autodocs
Modules=[NQCDynamics.DynamicsUtils]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/ensembles.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/ensembles.md..."
start_time = time()
```

# Ensembles

```@autodocs
Modules=[NQCDynamics.Ensembles]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/estimators.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/estimators.md..."
start_time = time()
```

# Estimators

```@autodocs
Modules=[NQCDynamics.Estimators]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
8 changes: 8 additions & 0 deletions docs/src/api/NQCDynamics/initialconditions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
```@setup logging
@info "Expanding src/api/NQCDynamics/initialconditions.md..."
start_time = time()
```

# InitialConditions

Expand All @@ -22,3 +26,7 @@ Modules=[NQCDynamics.InitialConditions.QuantisedDiatomic]
```@autodocs
Modules=[NQCDynamics.InitialConditions.MetropolisHastings]
```
```@setup logging
runtime = round(time() - start_time; digits=2)
@info "...done after $runtime s."
```
Loading

0 comments on commit 202a26f

Please sign in to comment.