Suggestion: Change class instance output (via __repr__) to output shapes as tuples
Background: When making changes for #145 , I added a test of __repr__ for empty ktensor instances and saw an inconsistency of how the shape attribute is output in this case.
In MATLAB, here is the output string (for a ktensor for example):
B is a ktensor of size 3 x 4 x 5
Here is the proposed corresponding output string in pyttb:
ktensor of shape (3, 4, 5)
Several motivators for this suggestion:
- Output reflects that the shape attribute is a tuple.
- Consistency with numpy-like shape attributes:
- Empty:
ktensor of shape () (rather that ktensor of shape 0, which may confuse users)
- 1-way:
ktensor of shape (2,) (rather than ktensor of shape 2, which may confuse users)
- d-way:
ktensor of shape (3, 4, 5)
I made the changes in a current PR (#182), but would like input before merging the changes.