@@ -38,9 +38,10 @@ path to whatever the new name will be.
3838## Example of currently-implemented behavior:
3939
4040``` julia
41- julia> Pkg. add (" AxisArrays" )
41+ julia> using Pkg; Pkg. add (" AxisArrays" )
4242julia> using AxisArrays, Unitful
4343julia> import Unitful: s, ms, µs
44+ julia> using Random: MersenneTwister
4445
4546julia> rng = MersenneTwister (123 ) # Seed a random number generator for repeatable examples
4647julia> fs = 40000 # Generate a 40kHz noisy signal, with spike-like stuff added for testing
@@ -237,8 +238,8 @@ headers.
237238
238239``` julia
239240B = AxisArray (reshape (1 : 15 , 5 , 3 ), .1 : .1 : 0.5 , [:a , :b , :c ])
240- B[Axis {:row} (Interval (. 2 ,. 4 ) )] # restrict the AxisArray along the time axis
241- B[Interval ( 0. ,. 3 ) , [:a , :c ]] # select an interval and two of the columns
241+ B[Axis {:row} (0.2 .. 0.4 )] # restrict the AxisArray along the time axis
242+ B[0.0 .. 0.3 , [:a , :c ]] # select an interval and two of the columns
242243```
243244
244245User-defined axis types can be added along with custom indexing
@@ -248,7 +249,8 @@ behaviors.
248249``` julia
249250B = AxisArray (randn (100 ,100 ,100 ), :x , :y , :z )
250251Itotal = sumz = 0.0
251- for iter in CartesianRange (indices (B)) # traverses in storage order for cache efficiency
252+ for iter in CartesianIndices (Base. axes (B)) # traverses in storage order for cache efficiency
253+ global Itotal, sumz
252254 I = B[iter] # intensity in a single voxel
253255 Itotal += I
254256 sumz += I * iter[axisdim (B, Axis{:z })] # axisdim "looks up" the z dimension
0 commit comments