Skip to content

Commit b4bdd7e

Browse files
authored
Merge pull request #255 from kojix2/narray_format
Set the default format for NArray to 'text/plain'.
2 parents 7ed6d07 + 5fbf7d9 commit b4bdd7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/iruby/display.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def format(mime = nil, &block)
170170
end
171171

172172
type { Numo::NArray }
173+
format 'text/plain' do |obj|
174+
obj.inspect
175+
end
173176
format 'text/latex' do |obj|
174177
obj.ndim == 2 ?
175178
LaTeX.matrix(obj, obj.shape[0], obj.shape[1]) :
@@ -180,6 +183,9 @@ def format(mime = nil, &block)
180183
end
181184

182185
type { NArray }
186+
format 'text/plain' do |obj|
187+
obj.inspect
188+
end
183189
format 'text/latex' do |obj|
184190
obj.dim == 2 ?
185191
LaTeX.matrix(obj.transpose(1, 0), obj.shape[1], obj.shape[0]) :

0 commit comments

Comments
 (0)