kmath icon indicating copy to clipboard operation
kmath copied to clipboard

Text representation

Open Zelenyy opened this issue 6 years ago • 4 comments

Override toString method for NDArray

Zelenyy avatar Sep 07 '18 22:09 Zelenyy

I am not sure it is a good idea. Basically, toString() is used only to identify tho object in debug mode, not to represent the result. In order to use it like python people use repr, one need to create a new presentation class and use it to render NDArray. Is there ant specific way you want it to be done?

altavir avatar Sep 08 '18 04:09 altavir

I don't have preferences, but this presenter must be smart.

Zelenyy avatar Sep 09 '18 08:09 Zelenyy

Please elaborate on what do you mean by smart. I do not like the way python tries to do things under the carpet. I see two ways of doing this:

  1. Just use simple rendering functions like NDArray.()->Unit
  2. Implement generic renderers which will take Any and render it according to its own features like it is done in current DataForge Output.

The second way is more smart but I would not like it ti be in the KMath core, we will need separate module for that.

altavir avatar Sep 09 '18 08:09 altavir

Basic functionality could be a part of #61

altavir avatar Jun 07 '19 12:06 altavir