@@ -343,28 +343,21 @@ dropax(ax) = ()
343
343
# A simple display method to include axis information. It might be nice to
344
344
# eventually display the axis labels alongside the data array, but that is
345
345
# much more difficult.
346
- if VERSION < v " 0.5.0-dev"
347
- function Base. writemime {T,N} (io:: IO , m:: MIME"text/plain" , A:: AxisArray{T,N} )
348
- println (io, " $N -dimensional AxisArray{$T ,$N ,...} with axes:" )
349
- for (name, val) in zip (axisnames (A), axisvalues (A))
350
- print (io, " :$name , " )
351
- Base. showlimited (io, val)
352
- println (io)
353
- end
354
- print (io, " And data, a " )
355
- writemime (io, m, A. data)
356
- end
357
- else
358
- function Base. show {T,N} (io:: IO , m:: MIME"text/plain" , A:: AxisArray{T,N} )
359
- println (io, " $N -dimensional AxisArray{$T ,$N ,...} with axes:" )
360
- for (name, val) in zip (axisnames (A), axisvalues (A))
361
- print (io, " :$name , " )
362
- show (IOContext (io, :limit => true ), val)
363
- println (io)
364
- end
365
- print (io, " And data, a " )
366
- show (io, m, A. data)
346
+ function summaryio (io:: IO , A:: AxisArray )
347
+ _summary (io, A)
348
+ for (name, val) in zip (axisnames (A), axisvalues (A))
349
+ print (io, " :$name , " )
350
+ show (IOContext (io, :limit => true ), val)
351
+ println (io)
367
352
end
353
+ print (io, " And data, a " , summary (A. data))
354
+ end
355
+ _summary {T,N} (io, A:: AxisArray{T,N} ) = println (io, " $N -dimensional AxisArray{$T ,$N ,...} with axes:" )
356
+
357
+ function Base. summary (A:: AxisArray )
358
+ io = IOBuffer ()
359
+ summaryio (io, A)
360
+ String (io)
368
361
end
369
362
370
363
# Custom methods specific to AxisArrays
0 commit comments