From d43a5dd98e1e6268a65b6d6325c2bbcd13af6470 Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Fri, 18 Oct 2024 12:20:07 -0300 Subject: [PATCH] fix doc strings references --- docs/src/contributions.md | 5 ++--- docs/src/results.md | 14 +++++++++++--- docs/src/tools.md | 5 +++++ src/results.jl | 8 +++++--- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/docs/src/contributions.md b/docs/src/contributions.md index 0e9ca273..15bc070b 100644 --- a/docs/src/contributions.md +++ b/docs/src/contributions.md @@ -143,7 +143,6 @@ types of residues, atoms, the backbone, the side-chains, etc. ## Reference functions -```@autodocs -Modules = [ComplexMixtures] -Pages = ["contributions.jl"] +```@docs +contributions ``` diff --git a/docs/src/results.md b/docs/src/results.md index 384d9adf..4d2f3312 100644 --- a/docs/src/results.md +++ b/docs/src/results.md @@ -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` @@ -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 ``` diff --git a/docs/src/tools.md b/docs/src/tools.md index d0a81c17..3ea8d317 100644 --- a/docs/src/tools.md +++ b/docs/src/tools.md @@ -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. diff --git a/src/results.jl b/src/results.jl index 8b0d9664..411b7f22 100644 --- a/src/results.jl +++ b/src/results.jl @@ -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. @@ -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 @@ -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 @@ -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