Skip to content

Commit

Permalink
finished documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Jun 20, 2021
1 parent 5c4fdf5 commit b85e799
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
9 changes: 9 additions & 0 deletions docs/src/guide/calculations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Calculations

## Contents
```@contents
Pages=["calculations.md"]
```
## Index
```@index
Pages=["calculations.md"]
```

```@docs
DFCalculation
InputData
Expand Down
10 changes: 9 additions & 1 deletion docs/src/guide/jobs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Jobs

## Contents
```@contents
Pages=["jobs.md"]
```
## Index
```@index
Pages=["jobs.md"]
```
## DFJob
```@docs
DFJob
```
Expand Down
10 changes: 10 additions & 0 deletions docs/src/guide/structure.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Structure
## Contents
```@contents
Pages=["structure.md"]
```
## Index
```@index
Pages=["structure.md"]
```


```@docs
Structure
Base.getindex(::Structure, ::Int)
Expand Down
4 changes: 2 additions & 2 deletions src/atom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ push!(ELEMENTS, Element(:undef, 0, "undef",0, (0.0, 0.0, 0.0)))
"""
element(sym::Symbol)
Returns the predefined `Element` with symbol `sym`,
i.e. `element(:Si)` will return the pregenerated Silicon `Element`.
Returns the predefined [`Element`](@ref) with symbol `sym`,
i.e. `element(:Si)` will return the pregenerated Silicon [`Element`](@ref).
"""
function element(sym::Symbol)
if tryparse(Int, String(sym)[end:end]) != nothing
Expand Down
22 changes: 11 additions & 11 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Projection() = Projection(Orbital(), 0, 0)
β ::T = zero(T),
J ::Vector{T} = T[zero(T)])
DFT+U parameters for a given [`Atom`](@ref Atom).
DFT+U parameters for a given [`Atom`](@ref).
"""
@with_kw mutable struct DFTU{T}
l::Int = -1
Expand Down Expand Up @@ -87,11 +87,11 @@ abstract type AbstractAtom{T, LT<:Length{T}} end
Representation of an `atom`.
The `name` of the `atom` is used as an identifier for the `atom` type, in the sense that atoms with the same `pseudo`, `projections`, `magnetization` and [dftu](@ref DFControl.DFTU) attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.
The `name` of the `atom` is used as an identifier for the `atom` type, in the sense that atoms with the same `pseudo`, `projections`, `magnetization` and [`dftu`](@ref DFTU) attributes should belong to the same type. This also means that during sanity checks atoms that are not of the same type will be given different names. This is done in this way because it often makes sense to change these parameters on all atoms of the same kind at the same time, but still allow the flexibility to change them for individual atoms as well.
`position_cart` should have a valid `Unitful.Length` type such as `Ang`.
See documentation for [Element](@ref) and [Pseudo](@ref pseudo_header) for further information on these attributes.
See documentation for [`Element`](@ref) and [`Pseudo`](@ref) for further information on these attributes.
"""
@with_kw_noshow mutable struct Atom{T<:AbstractFloat, LT<:Length{T}} <: AbstractAtom{T, LT}
name ::Symbol
Expand All @@ -116,11 +116,11 @@ abstract type AbstractStructure{T,LT} end
"""
Structure([name::String,] cell::Mat3, atoms::Vector{<:AbstractAtom}[, data::Dict{Symbol,Any}])
The structure on which the [DFCalculations](@ref Calculations) will be performed.
The structure on which the [`DFCalculations`](@ref DFCalculation) will be performed.
Structure(cif_file::String; name = "NoName")
Creates a `Structure` from the supplied cif file.
Creates a [`Structure`](@ref) from the supplied cif file.
"""
mutable struct Structure{T <: AbstractFloat,AA <: AbstractAtom{T},LT <: Length{T}} <: AbstractStructure{T,LT}
name ::String
Expand Down Expand Up @@ -166,7 +166,7 @@ Basically `dir/exec --<flags>` inside a job script.
Exec(exec::String, dir::String, flags::Pair{Symbol}...)
Will first transform `flags` into a `Vector{ExecFlag}`, and construct the `Exec`.
Will first transform `flags` into a `Vector{ExecFlag}`, and construct the [`Exec`](@ref).
"""
Parameters.@with_kw mutable struct Exec
exec ::String = ""
Expand Down Expand Up @@ -229,11 +229,11 @@ e.g. if `run=false` the corresponding line will be commented out in the job scri
DFCalculation{P<:Package}(name::AbstractString, flags::Pair{Symbol, Any}...; kwargs...)
Create a `DFCalculation` from `name` and `flags`, other `kwargs...` will be passed to the constructor.
Create a [`DFCalculation`](@ref) from `name` and `flags`, other `kwargs...` will be passed to the constructor.
DFCalculation(template::DFCalculation, name::AbstractString, flags::Pair{Symbol, Any}...; excs=deepcopy(execs(template)), run=true, data=nothing, dir=copy(template.dir))
Creates a new `DFCalculation` from the `template`, setting the `flags` of the newly created one to the specified ones.
Creates a new [`DFCalculation`](@ref) from the `template`, setting the `flags` of the newly created one to the specified ones.
"""
@with_kw_noshow mutable struct DFCalculation{P <: Package}
name ::String
Expand Down Expand Up @@ -297,7 +297,7 @@ end
server ::String = getdefault_server(),
server_dir ::String = "")
A `DFJob` embodies a set of calculations with `calculations` to be ran in directory `local_dir`, with the `structure` as the subject.
A [`DFJob`](@ref) embodies a set of [`DFCalculations`](@ref DFCalculation) to be ran in directory `local_dir`, with the [`Structure`](@ref) as the subject.
## Keywords/further attributes
- `calculations`: calculations to calculations that will be run sequentially.
- `local_dir`: the directory where the calculations will be run.
Expand All @@ -309,14 +309,14 @@ A `DFJob` embodies a set of calculations with `calculations` to be ran in direct
DFJob(job_name::String, structure::AbstractStructure, calculations::Vector{<:DFCalculation}, common_flags::Pair{Symbol, <:Any}...; kwargs...)
Creates a new job. The common flags will be attempted to be set in each of the `calculations`. The `kwargs...` are passed to the `DFJob` constructor.
Creates a new job. The common flags will be attempted to be set in each of the `calculations`. The `kwargs...` are passed to the [`DFJob`](@ref) constructor.
DFJob(job_dir::String, job_script="job.tt"; version=nothing, kwargs...)
Loads the job in the `local_dir`.
If `job_dir` is not a valid job path, the previously saved jobs will be scanned for a job with a `local_dir` that
partly includes `job_dir`. If `version` is specified the corresponding job version will be returned if it exists.
The `kwargs...` will be passed to the `DFJob` constructor.
The `kwargs...` will be passed to the [`DFJob`](@ref) constructor.
"""
@with_kw_noshow mutable struct DFJob
name ::String
Expand Down

2 comments on commit b85e799

@louisponet
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/39293

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" b85e799d41d1dd83e88c015015eb9b76033c6ad9
git push origin v0.2.1

Please sign in to comment.