-
Notifications
You must be signed in to change notification settings - Fork 133
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
fixed pretty print format for matrices #500
Conversation
16af7d1
to
5c88482
Compare
5c88482
to
deb5648
Compare
Can you provide a little more information about what you fixed? Was there a bug report associated with this PR? |
I am working on the problem of matrix read/write ruby interface. I have faced the problem, that matrix is printed via pry not like a normal matrix row under the row, but row right of the row. I have found it very inconvenient. Moreover I have found there a TODO: to make pretty_print method really pretty. I have deleted one extra if - because self.dim > 2 is always false in that branch of conditions. There were no any bug report associated. |
This is a tough one to evaluate. Usually we require a spec or something like that, but this issue seems more subjective. Can you provide some specific use-cases (examples) that have been improved? |
You can also provide terminal output in the comments. |
what was before: pry -r './lib/nmatrix.rb' What I propose: pry -r './lib/nmatrix.rb' |
looks good! how would this scale to dimensions greater than 2? |
For the moment it fixes only the cases with 2d. I could think about greater dims. |
You can try to imitate octave/matlab. |
Yeah, please check that it doesn't mess up the handling of greater dimensions. That's an area I struggled with when writing the pretty_print code originally. |
I am very sorry for late reply. I have checked the code for dims grater than 3. And than analyzed conditions in branches of this method. I am sure, that my code only affects dim 2! |
if self.shape.size > 1 and self.shape[1] > 100 |
No description provided.