Skip to content

Commit db52ac7

Browse files
committed
Fix jldoctests.
1 parent 7a0dd46 commit db52ac7

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

Diff for: docs/src/index.md

+22-14
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ julia> for spk = (sin.(0.8:0.2:8.6) .* [0:0.01:.1; .15:.1:.95; 1:-.05:.05] .* 50
5151

5252
```jldoctest
5353
julia> A = AxisArray([y 2y], Axis{:time}(0s:1s/fs:60s), Axis{:chan}([:c1, :c2]))
54+
5455
2-dimensional AxisArray{Float64,2,...} with axes:
5556
:time, 0.0 s:2.5e-5 s:60.0 s
5657
:chan, Symbol[:c1, :c2]
5758
And data, a 2400001×2 Array{Float64,2}:
5859
3.5708 7.14161
59-
6.14454 12.2891
60+
6.14454 12.2891
6061
3.42795 6.85591
6162
1.37825 2.75649
6263
-1.19004 -2.38007
@@ -65,16 +66,17 @@ And data, a 2400001×2 Array{Float64,2}:
6566
-0.226449 -0.452898
6667
0.821446 1.64289
6768
-0.582687 -1.16537
68-
69+
6970
-3.50593 -7.01187
7071
2.26783 4.53565
7172
-0.16902 -0.33804
7273
-3.84852 -7.69703
7374
0.226457 0.452914
7475
0.560809 1.12162
7576
4.67663 9.35326
76-
-2.41005 -4.8201
77+
-2.41005 -4.8201
7778
-3.71612 -7.43224
79+
7880
```
7981

8082
AxisArrays behave like regular arrays, but they additionally use the axis
@@ -98,6 +100,7 @@ And data, a 5-element Array{Float64,1}:
98100
6.85591
99101
2.75649
100102
-2.38007
103+
101104
```
102105

103106
We can also index by the *values* of each axis using an `Interval` type that
@@ -114,12 +117,13 @@ And data, a 7-element Array{Float64,1}:
114117
1.37825
115118
-1.19004
116119
-1.99414
117-
2.9429
120+
2.9429
118121
-0.226449
119122
0.821446
120123
121124
julia> axes(ans, 1)
122125
AxisArrays.Axis{:time,StepRangeLen{Quantity{Float64, Dimensions:{𝐓}, Units:{s}},Base.TwicePrecision{Quantity{Float64, Dimensions:{𝐓}, Units:{s}}},Base.TwicePrecision{Quantity{Float64, Dimensions:{𝐓}, Units:{s}}}}}(5.0e-5 s:2.5e-5 s:0.0002 s)
126+
123127
```
124128

125129
You can also index by a single value on an axis using `atvalue`. This will drop
@@ -135,6 +139,7 @@ julia> A[2.5e-5s..2.5e-5s, :c1]
135139
:time, 2.5e-5 s:2.5e-5 s:2.5e-5 s
136140
And data, a 1-element Array{Float64,1}:
137141
6.14454
142+
138143
```
139144

140145
You can even index by multiple values by broadcasting `atvalue` over an array:
@@ -147,6 +152,7 @@ julia> A[atvalue.([2.5e-5s, 75.0µs])]
147152
And data, a 2×2 Array{Float64,2}:
148153
6.14454 12.2891
149154
1.37825 2.75649
155+
150156
```
151157

152158
Sometimes, though, what we're really interested in is a window of time about a
@@ -158,15 +164,16 @@ we use the `atindex` function:
158164
```jldoctest
159165
julia> A[atindex(-90µs .. 90µs, 5), :c2]
160166
1-dimensional AxisArray{Float64,1,...} with axes:
161-
:time_sub, -7.5e-5 s:2.5e-5 s:7.500000000000002e-5 s
167+
:time_sub, -7.5e-5 s:2.5e-5 s:7.5e-5 s
162168
And data, a 7-element Array{Float64,1}:
169+
12.2891
163170
6.85591
164171
2.75649
165172
-2.38007
166173
-3.98828
167174
5.88581
168175
-0.452898
169-
1.64289
176+
170177
```
171178

172179
Note that the returned AxisArray has its time axis shifted to represent the
@@ -182,26 +189,27 @@ julia> spks = A[atindex(-200µs .. 800µs, idxs), :c1]
182189
:time_sub, -0.0002 s:2.5e-5 s:0.0008 s
183190
:time_rep, Quantity{Float64, Dimensions:{𝐓}, Units:{s}}[0.162 s, 0.20045 s, 0.28495 s, 0.530325 s, 0.821725 s, 1.0453 s, 1.11967 s, 1.1523 s, 1.22085 s, 1.6253 s … 57.0094 s, 57.5818 s, 57.8716 s, 57.8806 s, 58.4353 s, 58.7041 s, 59.1015 s, 59.1783 s, 59.425 s, 59.5657 s]
184191
And data, a 41×247 Array{Float64,2}:
185-
0.672063 7.25649 0.633375 … 1.54583 5.81194 -4.706
192+
-1.82238 2.3315 -1.56147 … 4.33751 4.77713 -1.81713
193+
0.672063 7.25649 0.633375 1.54583 5.81194 -4.706
186194
-1.65182 2.57487 0.477408 3.09505 3.52478 4.13037
187195
4.46035 2.11313 4.78372 1.23385 7.2525 3.57485
188196
5.25651 -2.19785 3.05933 0.965021 6.78414 5.94854
189-
7.8537 0.345008 0.960533 0.812989 0.336715 0.303909
190-
0.466816 0.643649 -3.67087 3.92978 -3.1242 0.789722
197+
7.8537 0.345008 0.960533 0.812989 0.336715 0.303909
198+
0.466816 0.643649 -3.67087 3.92978 -3.1242 0.789722
191199
-6.0445 -13.2441 -4.60716 0.265144 -4.50987 -8.84897
192200
-9.21703 -13.2254 -14.4409 -8.6664 -13.3457 -11.6213
193201
-16.1809 -22.7037 -25.023 -15.9376 -28.0817 -16.996
194-
-23.2671 -31.2021 -25.3787 -24.4914 -32.2599 -26.1118
195202
⋮ ⋱ ⋮
203+
1.72728 4.77428 -10.3922 -2.08555 1.19198 -1.94365
196204
-0.301629 0.0683982 -4.36574 1.92362 -5.12333 -3.4431
197205
4.7182 1.18615 4.40717 -4.51757 -8.64314 0.0800021
198-
-2.43775 -0.151882 -1.40817 -3.38555 -2.23418 0.728549
199-
3.2482 -0.60967 0.471288 2.53395 0.468817 -3.65905
206+
-2.43775 -0.151882 -1.40817 -3.38555 -2.23418 0.728549
207+
3.2482 -0.60967 0.471288 2.53395 0.468817 -3.65905
200208
-4.26967 2.24747 -3.13758 1.74967 4.5052 -0.145357
201209
-0.752487 1.69446 -1.20491 1.71429 1.81936 0.290158
202210
4.64348 -3.94187 -1.59213 7.15428 -0.539748 4.82309
203-
1.09652 -2.66999 0.521931 -3.80528 1.70421 3.40583
204-
-0.94341 2.60785 -3.34291 … 1.10584 4.31118 3.6404
211+
1.09652 -2.66999 0.521931 -3.80528 1.70421 3.40583
212+
205213
```
206214

207215
By indexing with a repeated interval, we have *added* a dimension to the

0 commit comments

Comments
 (0)