Skip to content

Commit ab496f9

Browse files
committed
Add more links
1 parent 7a77727 commit ab496f9

File tree

7 files changed

+25
-22
lines changed

7 files changed

+25
-22
lines changed

src/convert_dataset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Base.convert(::Type{Dataset}, obj::Dataset) = obj
44
"""
55
convert_to_dataset(obj; group = :posterior, kwargs...) -> Dataset
66
7-
Convert a supported object to a `Dataset`.
7+
Convert a supported object to a [`Dataset`](@ref).
88
99
In most cases, this function calls [`convert_to_inference_data`](@ref) and returns the
1010
corresponding `group`.

src/convert_inference_data.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
convert(::Type{InferenceData}, obj)
33
4-
Convert `obj` to an `InferenceData`.
4+
Convert `obj` to an [`InferenceData`](@ref).
55
66
`obj` can be any type for which [`convert_to_inference_data`](@ref) is defined.
77
"""
@@ -23,7 +23,7 @@ See [`convert_to_dataset`](@ref)
2323
# Arguments
2424
2525
- `obj` can be many objects. Basic supported types are:
26-
26+
2727
+ [`InferenceData`](@ref): return unchanged
2828
+ [`Dataset`](@ref)/`DimensionalData.AbstractDimStack`: add to `InferenceData` as the only
2929
group
@@ -40,7 +40,7 @@ More specific types may be documented separately.
4040
4141
- `dims`: a collection mapping variable names to collections of objects containing
4242
dimension names. Acceptable such objects are:
43-
43+
4444
+ `Symbol`: dimension name
4545
+ `Type{<:DimensionsionalData.Dimension}`: dimension type
4646
+ `DimensionsionalData.Dimension`: dimension, potentially with indices

src/dataset.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Container of dimensional arrays sharing some dimensions.
55
66
This type is an
7-
[`DimensionalData.AbstractDimStack`](https://rafaqz.github.io/DimensionalData.jl/stable/reference/#DimensionalData.AbstractDimStack)
7+
[`DimensionalData.AbstractDimStack`](https://rafaqz.github.io/DimensionalData.jl/stable/stacks)
88
that implements the same interface as `DimensionalData.DimStack` and has identical usage.
99
1010
When a `Dataset` is passed to Python, it is converted to an `xarray.Dataset` without copying
@@ -64,8 +64,8 @@ Any non-array values will be converted to a 0-dimensional array.
6464
dataset, in addition to defaults. Values should be JSON serializable.
6565
- `library::Union{String,Module}`: library used for performing inference. Will be attached
6666
to the `attrs` metadata.
67-
- `dims`: a collection mapping variable names to collections of objects containing dimension
68-
names. Acceptable such objects are:
67+
- `dims`: a collection mapping variable names to collections of objects containing
68+
dimension names. Acceptable such objects are:
6969
+ `Symbol`: dimension name
7070
+ `Type{<:DimensionsionalData.Dimension}`: dimension type
7171
+ `DimensionsionalData.Dimension`: dimension, potentially with indices

src/from_dict.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
from_dict(posterior::AbstractDict; kwargs...) -> InferenceData
33
4-
Convert a `Dict` to an `InferenceData`.
4+
Convert a dictionary to an [`InferenceData`](@ref).
55
66
# Arguments
77
@@ -62,8 +62,9 @@ end
6262
"""
6363
convert_to_inference_data(obj::AbstractDict; kwargs...) -> InferenceData
6464
65-
Convert `obj` to an [`InferenceData`](@ref). See [`from_namedtuple`](@ref) for a description
66-
of `obj` possibilities and `kwargs`.
65+
Convert a dictionary to an [`InferenceData`](@ref).
66+
67+
See [`from_dict`](@ref) for a description of `obj` possibilities and `kwargs`.
6768
"""
6869
function convert_to_inference_data(data::AbstractDict; group=:posterior, kwargs...)
6970
group = Symbol(group)

src/from_namedtuple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
kwargs...
1111
) -> InferenceData
1212
13-
Convert a `NamedTuple` or container of `NamedTuple`s to an `InferenceData`.
13+
Convert a `NamedTuple` or container of `NamedTuple`s to an [`InferenceData`](@ref).
1414
1515
If containers are passed, they are flattened into a single `NamedTuple` with array elements
1616
whose first dimensions correspond to the dimensions of the containers.

src/inference_data.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Construct an inference data from either a `NamedTuple` or keyword arguments of g
1717
1818
Groups must be [`Dataset`](@ref) objects.
1919
20-
Instead of directly creating an `InferenceData`, use the exported `from_xyz` functions or
21-
[`convert_to_inference_data`](@ref).
20+
Instead of directly creating an [`InferenceData`](@ref), use the exported `from_xyz`
21+
functions or [`convert_to_inference_data`](@ref).
2222
"""
2323
struct InferenceData{group_names,group_types<:Tuple{Vararg{Dataset}}}
2424
groups::NamedTuple{group_names,group_types}
@@ -57,10 +57,13 @@ Base.getproperty(data::InferenceData, k::Symbol) = getproperty(parent(data), k)
5757
Base.getindex(data::InferenceData, groups::Symbol; coords...) -> Dataset
5858
Base.getindex(data::InferenceData, groups; coords...) -> InferenceData
5959
60-
Return a new `InferenceData` containing the specified groups sliced to the specified coords.
60+
Return a new [`InferenceData`](@ref) containing the specified groups sliced to the
61+
specified `coords`.
6162
62-
`coords` specifies a dimension name mapping to an index, a `DimensionalData.Selector`, or
63-
an `IntervalSets.AbstractInterval`.
63+
`coords` specifies a dimension name mapping to an index, a
64+
[`DimensionalData.Selector`](https://rafaqz.github.io/DimensionalData.jl/stable/selectors),
65+
or an
66+
[`IntervalSets.AbstractInterval`](https://juliamath.github.io/IntervalSets.jl/stable/api/#IntervalSets.AbstractInterval).
6467
6568
If one or more groups lack the specified dimension, a warning is raised but can be ignored.
6669
All groups that contain the dimension must also contain the specified indices, or an
@@ -116,8 +119,8 @@ with metadata Dict{String, Any} with 1 entry:
116119
"created_at" => "2022-08-11T11:15:21.4"
117120
```
118121
119-
Select data from just the posterior, returning a `Dataset` if the indices index more than
120-
one element from any of the variables:
122+
Select data from just the posterior, returning a [`Dataset`](@ref) if the indices index more
123+
than one element from any of the variables:
121124
122125
```@repl getindex
123126
julia> idata[:observed_data, id=At(["a"])]
@@ -164,7 +167,7 @@ end
164167
"""
165168
Base.setindex(data::InferenceData, group::Dataset, name::Symbol) -> InferenceData
166169
167-
Create a new `InferenceData` containing the `group` with the specified `name`.
170+
Create a new [`InferenceData`](@ref) containing the `group` with the specified `name`.
168171
169172
If a group with `name` is already in `data`, it is replaced.
170173
"""

src/io.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Load an [`InferenceData`](@ref) from an unopened NetCDF file.
55
6-
Remaining `kwargs` are passed to [`NCDatasets.NCDataset`](https://alexander-barth.github.io/NCDatasets.jl/stable/dataset/#NCDatasets.NCDataset).
6+
Remaining `kwargs` are passed to [`NCDatasets.NCDataset`](@extref).
77
This method loads data eagerly. To instead load data lazily, pass an opened `NCDataset` to
88
`from_netcdf`.
99
@@ -71,8 +71,7 @@ Write `data` to a NetCDF file.
7171
group the data represents.
7272
7373
`dest` specifies either the path to the NetCDF file or an opened NetCDF file.
74-
If `dest` is a path, remaining `kwargs` are passed to
75-
[`NCDatasets.NCDataset`](https://alexander-barth.github.io/NCDatasets.jl/stable/dataset/#NCDatasets.NCDataset).
74+
If `dest` is a path, remaining `kwargs` are passed to [`NCDatasets.NCDataset`](@extref).
7675
7776
!!! note
7877
This method requires that NCDatasets is loaded before it can be used.

0 commit comments

Comments
 (0)