Skip to content

Commit aba4e97

Browse files
authored
A bit more documentation on auto things and lookups and format (#898)
1 parent 052a602 commit aba4e97

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docs/src/extending_dd.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Nearly everything in DimensionalData.jl is designed to be extensible.
77
- `AbstractDimStack` is easily extended to custom mixed array datasets.
88
`RasterStack` or `ArViZ.Dataset` are examples.
99
- `Lookup` can have new types added, e.g. to `AbstractSampled` or
10-
`AbstractCategorical`. `Rasters.Projected` is a lookup that knows
10+
`AbstractCategorical`. For example, `Rasters.Projected` is a lookup that knows
1111
its coordinate reference system, but otherwise behaves as a regular
1212
`Sampled` lookup.
1313

@@ -16,7 +16,7 @@ Nearly everything in DimensionalData.jl is designed to be extensible.
1616
## `dims`
1717

1818
Objects extending DimensionalData.jl that have dimensions must return
19-
a `Tuple` of constructed `Dimension`s from `dims(obj)`.
19+
a `Tuple` of constructed `Dimension`s from `dims(obj)`, like `(X(), Y())`.
2020

2121
### `Dimension` axes
2222

@@ -44,7 +44,7 @@ implemented.
4444
## `rebuild`
4545

4646
Rebuild methods are used to rebuild immutable objects with new field values,
47-
in a way that is more flexible and extensible than just using ConstructionBase.jl
47+
in a more flexible and extensible way than just using ConstructionBase.jl
4848
reconstruction. Developers can choose to ignore some of the fields passed
4949
by `rebuild`.
5050

@@ -85,11 +85,14 @@ format(dims, array)
8585
This lets DimensionalData detect the lookup properties, fill in missing fields
8686
of a `Lookup`, pass keywords from `Dimension` to detected `Lookup`
8787
constructors, and accept a wider range of dimension inputs like tuples of `Symbol`
88-
and `Type`.
88+
and `Type`. The way you indicate that something needs to be filled is by using the `Auto` types,
89+
like [`AutoOrder`](@ref) or [`AutoSampling`](@ref)
8990

9091
Not calling `format` in the outer constructors of an `AbstractDimArray`
9192
has undefined behaviour.
9293

94+
When creating lookup types, you need to define `DimensionalData.format` on your lookup type.
95+
9396

9497
## Interfaces.jl interface testing
9598

0 commit comments

Comments
 (0)