-
Notifications
You must be signed in to change notification settings - Fork 41
/
Lookups.jl
76 lines (58 loc) · 2.09 KB
/
Lookups.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""
Lookups
Module for [`Lookup`](@ref)s and [`Selector`](@ref)s used in DimensionalData.jl
`Lookup` defines traits and `AbstractArray` wrappers
that give specific behaviours for a lookup index when indexed with [`Selector`](@ref).
For example, these allow tracking over array order so fast indexing works even when
the array is reversed.
To load `Lookup` types and methods into scope:
```julia
using DimensionalData
using DimensionalData.Lookups
```
"""
module Lookups
using Dates, IntervalSets, Extents
import Adapt, ConstructionBase
import InvertedIndices
using InvertedIndices: Not
using Base: tail, OneTo, @propagate_inbounds
export order, sampling, span, bounds, hasselection, dim,
metadata, units, sort, selectindices, val, reducelookup,
locus, shiftlocus, maybeshiftlocus, intervalbounds
# Deprecated
export index
export issampled, iscategorical, iscyclic, isnolookup, isintervals, ispoints, isregular,
isexplicit, isstart, iscenter, isend, isordered, isforward, isreverse
export Selector
export At, Between, Touches, Contains, Near, Where, All
export ..
export Not
export LookupTrait
export Order, Ordered, ForwardOrdered, ReverseOrdered, Unordered, AutoOrder
export Sampling, Points, Intervals, AutoSampling, NoSampling
export Span, Regular, Irregular, Explicit, AutoSpan, NoSpan
export Position, Locus, Center, Start, End, AutoLocus, AutoPosition
export Metadata, NoMetadata
export AutoStep, AutoBounds, AutoValues
export Lookup
export AutoLookup, NoLookup
export Aligned, AbstractSampled, Sampled, AbstractCyclic, Cyclic, AbstractCategorical, Categorical
export Unaligned, Transformed
# Deprecated
export LookupArray
const StandardIndices = Union{AbstractArray{<:Integer},Colon,Integer,CartesianIndex,CartesianIndices}
# As much as possible keyword rebuild is automatic
rebuild(x; kw...) = ConstructionBase.setproperties(x, (; kw...))
include("metadata.jl")
include("lookup_traits.jl")
include("lookup_arrays.jl")
include("predicates.jl")
include("selector.jl")
include("beginend.jl")
include("indexing.jl")
include("methods.jl")
include("utils.jl")
include("set.jl")
include("show.jl")
end