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

Added NMatrix::IO::Matlab IO features with checking metadata about .m… #620

Closed
wants to merge 1 commit into from

Conversation

psonicc
Copy link

@psonicc psonicc commented Apr 15, 2018

I have created a new file mat5_reader_spec.rb which not only check for validity of the elements stored in matrix ,but also checks for metadata related to .mat file.
regarding issue number #588

require_relative '../../lib/nmatrix'

describe NMatrix::IO::Matlab do
def check_matrix_data_sparse arr

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could use shared_examples instead of define a method. what do you think? 🤔

end
it "reads MATLAB .mat file containing a single square sparse matrix" do
pending("not yet implemented for NMatrix-JRuby") if jruby?
n = NMatrix::IO::Matlab.load_mat("spec/4x4_sparse.mat")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen that you are using n = NMatrix::IO::Matlab.load_mat(...) in multiple test. Maybe you could use a let like:

let(:my_file) { "spec/4x4_sparse.mat" }
let(:n) { NMatrix::IO::Matlab.load_mat(my_file) }

it "reads MATLAB .mat file containing a single square sparse matrix" do
  expect(n[0,0]).to eq(2)
  ...
end
...

what do you think? 🤔

@psonicc psonicc closed this by deleting the head repository Jan 26, 2023
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

Successfully merging this pull request may close these issues.

2 participants