@@ -39,7 +39,7 @@ When using functions as indexing arguments, the axis corresponding to each argum
3939
4040``` julia
4141julia> ax[:, > (2 )]
42- 2 × 2 AxisArray (:: Array {Int64,2 }
42+ 2 × 2 AxisArray (:: Matrix {Int64}
4343 • axes:
4444 1 = 1 : 2
4545 2 = 1 : 2
@@ -65,7 +65,7 @@ julia> inds_before = firstindex(axis):(not_index - 1); # all of the indices bef
6565julia> inds_after = (not_index + 1 ): lastindex (axis); # all of the indices after `not_index`
6666
6767julia> x[:, vcat (inds_before, inds_after)]
68- 2 × 3 Array {Int64, 2 }:
68+ 2 × 3 Matrix {Int64}:
6969 1 5 7
7070 2 6 8
7171
@@ -74,7 +74,7 @@ julia> x[:, vcat(inds_before, inds_after)]
7474Using an ` AxisArray ` , this only requires one line of code
7575``` julia
7676julia> ax[:, != (2 )]
77- 2 × 3 AxisArray (:: Array {Int64,2 }
77+ 2 × 3 AxisArray (:: Matrix {Int64}
7878 • axes:
7979 1 = 1 : 2
8080 2 = 1 : 3
@@ -89,7 +89,7 @@ We can using `ChainedFixes` to combine multiple functions.
8989julia> using ChainedFixes
9090
9191julia> ax[:, or (< (2 ), > (3 ))] # == ax[:, [1, 4]]
92- 2 × 2 AxisArray (:: Array {Int64,2 }
92+ 2 × 2 AxisArray (:: Matrix {Int64}
9393 • axes:
9494 1 = 1 : 2
9595 2 = 1 : 2
@@ -99,7 +99,7 @@ julia> ax[:, or(<(2), >(3))] # == ax[:, [1, 4]]
9999 2 2 8
100100
101101julia> ax[:, and (> (1 ), < (4 ))]
102- 2 × 2 AxisArray (:: Array {Int64,2 }
102+ 2 × 2 AxisArray (:: Matrix {Int64}
103103 • axes:
104104 1 = 1 : 2
105105 2 = 1 : 2
@@ -136,7 +136,7 @@ julia> ax = AxisArray(x, nothing, (.1:.1:.4)s)
136136We can still use functions to access these elements
137137``` julia
138138julia> ax[:, < (0.3 s)]
139- 2 × 2 AxisArray (:: Array {Int64,2 }
139+ 2 × 2 AxisArray (:: Matrix {Int64}
140140 • axes:
141141 1 = 1 : 2
142142 2 = (0.1 : 0.1 : 0.2 ) s
@@ -155,7 +155,7 @@ julia> ax[1, 0.1s]
155155...or as intervals.
156156``` julia
157157julia> ax[:, 0.1 s.. 0.3 s]
158- 2 × 3 AxisArray (:: Array {Int64,2 }
158+ 2 × 3 AxisArray (:: Matrix {Int64}
159159 • axes:
160160 1 = 1 : 2
161161 2 = (0.1 : 0.1 : 0.3 ) s
@@ -182,7 +182,7 @@ julia> ax = AxisArray(x, 2:3, 2:5)
182182 3 2 4 6 8
183183
184184julia> ax[:,2 ]
185- 2 - element AxisArray (:: Array {Int64,1 }
185+ 2 - element AxisArray (:: Vector {Int64}
186186 • axes:
187187 1 = 2 : 3
188188)
@@ -259,7 +259,7 @@ julia> ArrayInterface.known_length(typeof(ax)) # size is known at compile time
259259julia> ax[1 : 2 , 1 : 2 ] .= x[1 : 2 , 1 : 2 ]; # underlying type is mutable `Array`, so we can assign new values
260260
261261julia> ax
262- 2 × 2 AxisArray (:: Array {Int64,2 }
262+ 2 × 2 AxisArray (:: Matrix {Int64}
263263 • axes:
264264 1 = 1 : 2
265265 2 = 1 : 2
@@ -274,7 +274,7 @@ julia> ax
274274
275275If each element along a particular axis corresponds to a field of a type then we can encode that information in the axis.
276276``` julia
277- julia> ax = AxisArray (reshape (1 : 4 , 2 , 2 ), StructAxis {Complex{Float64} } (), [:a , :b ])
277+ julia> ax = AxisArray (reshape (1 : 4 , 2 , 2 ), StructAxis {ComplexF64 } (), [:a , :b ])
2782782 × 2 AxisArray (reshape (:: UnitRange{Int64} , 2 , 2 )
279279 • axes:
280280 1 = [:re , :im ]
@@ -289,7 +289,7 @@ julia> ax = AxisArray(reshape(1:4, 2, 2), StructAxis{Complex{Float64}}(), [:a, :
289289We can then create a lazy mapping of that type across views of the array.
290290``` julia
291291julia> axview = struct_view (ax)
292- 2 - element AxisArray (mappedarray (Complex{Float64} , view (reshape (:: UnitRange{Int64} , 2 , 2 ), 1 , :), view (reshape (:: UnitRange{Int64} , 2 , 2 ), 2 , :))
292+ 2 - element AxisArray (mappedarray (ComplexF64 , view (reshape (:: UnitRange{Int64} , 2 , 2 ), 1 , :), view (reshape (:: UnitRange{Int64} , 2 , 2 ), 2 , :))
293293 • axes:
294294 1 = [:a , :b ]
295295)
@@ -313,7 +313,7 @@ julia> mx = attach_metadata(AxisArray(x))
313313 • axes:
314314 1 = 1 : 2
315315 2 = 1 : 4
316- ), :: Dict{Symbol,Any}
316+ ), :: Dict{Symbol, Any}
317317 • metadata:
318318)
319319 1 2 3 4
@@ -345,7 +345,7 @@ We can also pad axes in various ways.
345345julia> x = [:a , :b , :c , :d ];
346346
347347julia> AxisArray (x, circular_pad (first_pad= 2 , last_pad= 2 ))
348- 8 - element AxisArray (:: Array {Symbol,1 }
348+ 8 - element AxisArray (:: Vector {Symbol}
349349 • axes:
350350 1 = - 1 : 6
351351)
@@ -360,7 +360,7 @@ julia> AxisArray(x, circular_pad(first_pad=2, last_pad=2))
360360 6 :b
361361
362362julia> AxisArray (x, replicate_pad (first_pad= 2 , last_pad= 2 ))
363- 8 - element AxisArray (:: Array {Symbol,1 }
363+ 8 - element AxisArray (:: Vector {Symbol}
364364 • axes:
365365 1 = - 1 : 6
366366)
@@ -375,7 +375,7 @@ julia> AxisArray(x, replicate_pad(first_pad=2, last_pad=2))
375375 6 :d
376376
377377julia> AxisArray (x, symmetric_pad (first_pad= 2 , last_pad= 2 ))
378- 8 - element AxisArray (:: Array {Symbol,1 }
378+ 8 - element AxisArray (:: Vector {Symbol}
379379 • axes:
380380 1 = - 1 : 6
381381)
@@ -390,7 +390,7 @@ julia> AxisArray(x, symmetric_pad(first_pad=2, last_pad=2))
390390 6 :b
391391
392392julia> AxisArray (x, reflect_pad (first_pad= 2 , last_pad= 2 ))
393- 8 - element AxisArray (:: Array {Symbol,1 }
393+ 8 - element AxisArray (:: Vector {Symbol}
394394 • axes:
395395 1 = - 1 : 6
396396)
0 commit comments