Skip to content

Commit fbbcfe8

Browse files
authored
Add docs interlinks (#91)
* Fix doctests * Add interlinks to referenced packages * Import/export extended functions * Link extended methods to original * Add more links * Remove outdated docstring * Add extension docs pages * Increment patch number * Build preview docs * Add minimal inventories for DimensionalData and IntervalSets * Add more links to inventories * Add links to DimensionalData pages * Link to the InferenceData schema * Link to IntervalSets
1 parent 476f77e commit fbbcfe8

28 files changed

+162
-43
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "InferenceObjects"
22
uuid = "b5cf5a8d-e756-4ee3-b014-01d49d192c00"
33
authors = ["Seth Axen <[email protected]> and contributors"]
4-
version = "0.4.7"
4+
version = "0.4.8"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
ArviZExampleData = "2f96bb34-afd9-46ae-bcd0-9b2d4372fe3c"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
45
InferenceObjects = "b5cf5a8d-e756-4ee3-b014-01d49d192c00"
56
MCMCDiagnosticTools = "be115224-59cd-429b-ad48-344e309966f0"
67
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
@@ -9,3 +10,4 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
910

1011
[compat]
1112
Documenter = "1"
13+
DocumenterInterLinks = "1"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# DocInventory version 1
2+
project = "DimensionalData.jl"
3+
version = "0.29.4"
4+
5+
# NOTE: trimmed to just the pages we link to
6+
[[std.doc]]
7+
dispname = "Selectors"
8+
name = "selectors"
9+
uri = "selectors"
10+
11+
[[std.doc]]
12+
dispname = "DimStacks"
13+
name = "dimstacks"
14+
uri = "stacks"

docs/inventories/IntervalSets.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# DocInventory version 1
2+
project = "IntervalSets.jl"
3+
version = "0.7.10"
4+
5+
# NOTE: trimmed to just the API functions we link to
6+
[[jl.type]]
7+
name = "IntervalSets.AbstractInterval"
8+
uri = "api/#$"

docs/make.jl

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,40 @@
11
using InferenceObjects
22
using Documenter
3+
using DocumenterInterLinks
4+
using MCMCDiagnosticTools: MCMCDiagnosticTools # load extension
35
using NCDatasets: NCDatasets # load extension
6+
using PosteriorStats: PosteriorStats # load extension
7+
using StatsBase: StatsBase # load extension
48

59
DocMeta.setdocmeta!(
610
InferenceObjects, :DocTestSetup, :(using InferenceObjects); recursive=true
711
)
812

13+
links = InterLinks(
14+
"arviz" => "https://python.arviz.org/en/stable/",
15+
"DimensionalData" => (
16+
"https://rafaqz.github.io/DimensionalData.jl/stable/",
17+
joinpath(@__DIR__, "inventories", "DimensionalData.toml"),
18+
),
19+
"IntervalSets" => (
20+
"https://juliamath.github.io/IntervalSets.jl/stable/",
21+
joinpath(@__DIR__, "inventories", "IntervalSets.toml"),
22+
),
23+
"NCDatasets" => "https://alexander-barth.github.io/NCDatasets.jl/stable/",
24+
"PosteriorStats" => "https://julia.arviz.org/PosteriorStats/stable/",
25+
"MCMCDiagnosticTools" => "https://julia.arviz.org/MCMCDiagnosticTools/stable/",
26+
)
27+
928
doctestfilters = [
1029
r"\s+\"created_at\" => .*", # ignore timestamps in doctests
1130
]
1231

1332
makedocs(;
14-
modules=[InferenceObjects],
33+
modules=[
34+
InferenceObjects,
35+
Base.get_extension(InferenceObjects, :InferenceObjectsMCMCDiagnosticToolsExt),
36+
Base.get_extension(InferenceObjects, :InferenceObjectsPosteriorStatsExt),
37+
],
1538
authors="Seth Axen <[email protected]> and contributors",
1639
repo=Remotes.GitHub("arviz-devs", "InferenceObjects.jl"),
1740
sitename="InferenceObjects.jl",
@@ -25,9 +48,14 @@ makedocs(;
2548
"Home" => "index.md",
2649
"Dataset" => "dataset.md",
2750
"InferenceData" => "inference_data.md",
51+
"Extensions" => [
52+
"MCMCDiagnosticTools" => "extensions/mcmcdiagnostictools.md",
53+
"PosteriorStats" => "extensions/posteriorstats.md",
54+
],
2855
],
2956
doctestfilters=doctestfilters,
3057
warnonly=:missing_docs,
58+
plugins=[links],
3159
)
3260

3361
# run doctests on extensions
@@ -49,4 +77,6 @@ for extended_pkg in (MCMCDiagnosticTools, PosteriorStats)
4977
doctest(mod; manual=false)
5078
end
5179

52-
deploydocs(; repo="github.com/arviz-devs/InferenceObjects.jl", devbranch="main")
80+
deploydocs(;
81+
repo="github.com/arviz-devs/InferenceObjects.jl", devbranch="main", push_preview=true
82+
)

docs/src/dataset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namedtuple_to_dataset
2020
## DimensionalData
2121

2222
As a `DimensionalData.AbstractDimStack`, `Dataset` also implements the `AbstractDimStack` API and can be used like a `DimStack`.
23-
See [DimensionalData's documentation](https://rafaqz.github.io/DimensionalData.jl/stable/) for example usage.
23+
See [DimensionalData's documentation](@extref DimensionalData dimstacks) for example usage.
2424

2525
## Tables inteface
2626

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Extension of MCMCDiagnosticTools
2+
3+
The following methods of [MCMCDiagnosticTools.jl](https://julia.arviz.org/MCMCDiagnosticTools) are extended by this package.
4+
5+
```@index
6+
Modules = [MCMCDiagnosticTools]
7+
```
8+
9+
```@autodocs
10+
Modules = [Base.get_extension(InferenceObjects, :InferenceObjectsMCMCDiagnosticToolsExt)]
11+
Private = false
12+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Extension of PosteriorStats
2+
3+
The following methods of [PosteriorStats.jl](https://julia.arviz.org/PosteriorStats) are extended by this package.
4+
5+
```@index
6+
Modules = [
7+
Base.get_extension(InferenceObjects, :InferenceObjectsPosteriorStatsExt),
8+
PosteriorStats,
9+
StatsBase,
10+
]
11+
```
12+
13+
```@autodocs
14+
Modules = [Base.get_extension(InferenceObjects, :InferenceObjectsPosteriorStatsExt)]
15+
Private = false
16+
```

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CurrentModule = InferenceObjects
44

55
# InferenceObjects
66

7-
InferenceObjects.jl is a Julia implementation of the [InferenceData schema](https://python.arviz.org/en/latest/schema/schema.html) for storing results of Bayesian inference.
7+
InferenceObjects.jl is a Julia implementation of the [InferenceData schema](@extref arviz schema) for storing results of Bayesian inference.
88
Its purpose is to serve the following three goals:
99
1. Usefulness in the analysis of Bayesian inference results.
1010
2. Reproducibility of Bayesian inference analysis.

ext/InferenceObjectsMCMCDiagnosticToolsExt/InferenceObjectsMCMCDiagnosticToolsExt.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ using DimensionalData: DimensionalData, Dimensions, LookupArrays
55
using InferenceObjects: InferenceObjects, Random
66
using MCMCDiagnosticTools: MCMCDiagnosticTools
77

8+
import MCMCDiagnosticTools: bfmi, ess_rhat, mcse, rstar
9+
10+
export bfmi, ess_rhat, mcse, rstar
11+
812
maplayers = isdefined(DimensionalData, :maplayers) ? DimensionalData.maplayers : map
913

1014
include("utils.jl")

0 commit comments

Comments
 (0)