SciRuby / nmatrix

Dense and sparse linear algebra library for Ruby via SciRuby
Other
469 stars 133 forks source link

Last argument as keyword parameters is deprecated in Ruby 2.7 #631

Open wtaysom opened 3 years ago

wtaysom commented 3 years ago

I ran across it in these two spots:

/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/nmatrix-0.2.4/lib/nmatrix/shortcuts.rb:203: warning: Using the last argument as keyword parameters is deprecated
/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/nmatrix-0.2.4/lib/nmatrix/shortcuts.rb:233: warning: Using the last argument as keyword parameters is deprecated

Those are the methods NMatrix::[] and NMatrix.zeros. The fixes are trivial. For example, NMatrix.zeros could be changed to:

    def zeros(shape, **opts)
      NMatrix.new(shape, 0, **{:dtype => :float64}.merge(opts))
    end