Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puts or p on simple matrix crashes #625

Open
ljulliar opened this issue Feb 5, 2019 · 2 comments
Open

puts or p on simple matrix crashes #625

ljulliar opened this issue Feb 5, 2019 · 2 comments

Comments

@ljulliar
Copy link

ljulliar commented Feb 5, 2019

Just installed nmatrix on Ruby 2.5.3 / Debian 9. Trying to print a simple matrix under irb would crash:

2.5.3 :001 > require 'nmatrix'
 => true 
2.5.3 :002 > m =  NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5], dtype: :int64)
 => #<NMatrix:0x000055694e8bd028 shape:[2,3] dtype:int64 stype:dense> 
2.5.3 :003 > puts m
Traceback (most recent call last):
Traceback (most recent call last):
        18: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/bin/irb:11:in `<main>'
        17: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:383:in `start'
        16: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:427:in `run'
        15: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:427:in `catch'
        14: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:428:in `block in run'
        13: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:487:in `eval_input'
        12: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb/ruby-lex.rb:231:in `each_top_level_statement'
        11: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb/ruby-lex.rb:231:in `catch'
        10: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb/ruby-lex.rb:232:in `block in each_top_level_statement'
         9: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb/ruby-lex.rb:232:in `loop'
         8: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb/ruby-lex.rb:246:in `block (2 levels) in each_top_level_statement'
         7: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:488:in `block in eval_input'
         6: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:623:in `signal_status'
         5: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:529:in `block (2 levels) in eval_input'
         4: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:529:in `puts'
         3: from /home/ljulliard/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/irb.rb:529:in `puts'
         2: from /home/ljulliard/.rvm/gems/ruby-2.5.3/gems/packable-1.3.10/lib/packable/extensions/io.rb:62:in `write_with_packing'
         1: from /home/ljulliard/.rvm/gems/ruby-2.5.3/gems/packable-1.3.10/lib/packable/extensions/io.rb:86:in `pack_and_write'
/home/ljulliard/.rvm/gems/ruby-2.5.3/gems/packable-1.3.10/lib/packable/extensions/io.rb:86:in `pos': Illegal seek @ rb_io_tell - <STDOUT> (Errno::ESPIPE)```

Any clue on what's happening here ?
@WaKeMaTTa
Copy link

Try this:

require 'nmatrix'
m =  NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5], dtype: :int64)
m

@kojix2
Copy link
Member

kojix2 commented Apr 6, 2019

To be honest and not afraid to criticize, NMatrix is not well maintained, and Numo::NArray is better in many ways. Please try NArray before giving up Nmarix and using NumPy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants