1- # Getting Started
1+ # Installation
22
3- ` DimensionalData.jl ` provides tools and abstractions for working with datasets that have named dimensions, and optionally a lookup index.
4-
5- ## Installation
63```` shell
74julia> ]
85pkg> add DimensionalData
@@ -12,65 +9,11 @@ Check the installed version:
129
1310```` shell
1411julia> ]
15- pkg> st
12+ pkg> status DimensionalData
1613````
1714
1815Start using the package:
1916
2017```` @example basics
2118using DimensionalData
2219````
23-
24- ## Philosophy
25-
26- DimensionalData is a pluggable, generalised version of
27- [ AxisArrays.jl] ( https://github.com/JuliaArrays/AxisArrays.jl ) with a cleaner
28- syntax, and additional functionality found in NamedDims.jl. It has similar goals
29- to pythons [ xarray] ( http://xarray.pydata.org/en/stable/ ) , and is primarily
30- written for use with spatial data in [ Rasters.jl] ( https://github.com/rafaqz/Rasters.jl ) .
31-
32- ::: info
33-
34- - Clean, readable syntax. Minimise required parentheses, minimise of exported
35- - Zero-cost dimensional indexing ` a[Y(4), X(5)] ` of a single value.
36- methods, and instead extend Base methods whenever possible.
37- - Plotting is easy: data should plot sensibly and correctly with useful labels, by default.
38- - Least surprise: everything works the same as in Base, but with named dims. If
39- a method accepts numeric indices or ` dims=X ` in base, you should be able to
40- use DimensionalData.jl dims.
41- - Minimal interface: implementing a dimension-aware type should be easy.
42- - Maximum extensibility: always use method dispatch. Regular types over special
43- syntax. Recursion over @generated . Always dispatch on abstract types.
44- - Type stability: dimensional methods should be type stable _ more often_ than Base methods
45- - Functional style: structs are always rebuilt, and other than the array data,
46- fields are not mutated in place.
47-
48- :::
49-
50- ## Data types and the interface
51-
52- DimensionalData.jl provides the concrete ` DimArray ` type. But its
53- behaviours are intended to be easily applied to other array types.
54-
55- ::: details more
56-
57- The main requirement for extending DimensionalData.jl is to define a ` dims ` method
58- that returns a ` Tuple ` of ` Dimension ` that matches the dimension order
59- and axis values of your data. Define ` rebuild ` and base methods for ` similar `
60- and ` parent ` if you want the metadata to persist through transformations (see
61- the ` DimArray ` and ` AbstractDimArray ` types). A ` refdims ` method
62- returns the lost dimensions of a previous transformation, passed in to the
63- ` rebuild ` method. ` refdims ` can be discarded, the main loss being plot labels
64- and ability to reconstruct dimensions in ` cat ` .
65-
66- Inheriting from ` AbstractDimArray ` in this way will give nearly all the functionality
67- of using ` DimArray ` .
68-
69- :::
70-
71- ## LookupArrays and Dimensions
72-
73- Sub modules ` LookupArrays ` and ` Dimensions ` define the behaviour of
74- dimensions and their lookup index.
75-
76- [ ` LookupArrays ` ] ( @ref ) and [ ` Dimensions ` ] ( @ref ) .
0 commit comments