Skip to content

Commit

Permalink
fix doc strings references
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Oct 18, 2024
1 parent 4fb1caa commit d43a5dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
5 changes: 2 additions & 3 deletions docs/src/contributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ types of residues, atoms, the backbone, the side-chains, etc.

## Reference functions

```@autodocs
Modules = [ComplexMixtures]
Pages = ["contributions.jl"]
```@docs
contributions
```
14 changes: 11 additions & 3 deletions docs/src/results.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# [Results](@id results)

```@meta
CollapsedDocStrings = true
```

The results of a MDDF calculation are returned in a data structure which contains
the MDDF, KB integrals, and atomic contributions. The following section
will assume that the computation was performed by calling the `mddf`
Expand Down Expand Up @@ -175,9 +179,13 @@ The complete data available is:

## Reference functions

```@autodocs
Modules = [ComplexMixtures]
Pages = ["results.jl"]
```@docs
Result
load(::String, ::Type{Result})
save(::String, ::Result)
merge(::Vector{Result})
overview(::Result)
ComplexMixtures.Density
```


Expand Down
5 changes: 5 additions & 0 deletions docs/src/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ rc_loaded = load("residue_contributions.json", ResidueContributions)
Note that the `load` function requires, as a second argument, the `ResidueContributions` type, to differentiate
the method from the loading of the `Result` data structure.

```@docs
load(::String, ::Type{ResidueContributions})
save(::String, ::ResidueContributions)
```

!!! tip
These `ResidueContributions` methods are convenience functions only.

Expand Down
8 changes: 5 additions & 3 deletions src/results.jl
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ StructTypes.StructType(::Type{Options}) = StructTypes.Struct()
StructTypes.StructType(::Type{TrajectoryFileOptions}) = StructTypes.Struct()

"""
save(R::Result, filename::String)
save(filename::String, R::Result)
Function to write the result data structure to a json file.
Expand All @@ -754,9 +754,10 @@ function _get_version(filename)
end

"""
load(filename::String, ::Type{T}=Result)
load(filename::String, [::Type{Result}=Result])
Function to load the json saved results file into, by default, the `Result` data structure.
The second parameter is optional for loading `Result` objects.
## Example
Expand All @@ -768,7 +769,7 @@ R = load("results.json", Result)
```
"""
function load(filename::String, ::Type{Result}=Result)
function load(filename::String, ::Type{Result})
filename = expanduser(filename)
_check_version(filename)
R = try
Expand All @@ -783,6 +784,7 @@ function load(filename::String, ::Type{Result}=Result)
end
return R
end
load(filename::String) = load(filename, Result)

@testitem "Result - load/save" begin
using ComplexMixtures: load
Expand Down

0 comments on commit d43a5dd

Please sign in to comment.