skorch icon indicating copy to clipboard operation
skorch copied to clipboard

Use terminal coloring library

Open benjamin-work opened this issue 7 years ago • 5 comments

Currently, color highlighting is homebrew. We could use a package instead, e.g. https://github.com/tartley/colorama.

Advantages:

  • potentially more features
  • claims to work on Windows
  • no more custom code (Enum doesn't work in Python 2.7)

Disadvantages:

  • one more dependency

benjamin-work avatar Jul 28 '17 09:07 benjamin-work

https://github.com/tartley/colorama seems to be most popular at the moment.

githubnemo avatar Oct 02 '17 13:10 githubnemo

Another option would be https://pypi.python.org/pypi/colored

ottonemo avatar Oct 11 '17 10:10 ottonemo

jupyter notebook and most *NIX terminals support xterm and ansi100 colors (~256) colors. On the other hand, does it make sense to include many colors that are visually indistinguishable from each other?

If we use a library that supports xterm colors (and actually is intelligent enough to evaluate the type of the terminal, e.g. https://github.com/broadinstitute/xtermcolor) we should probably use only colors that differ a few degrees in color space.

ottonemo avatar Oct 11 '17 15:10 ottonemo

Can we just add a couple of more colors and be fine with that? I believe that using an external library to add more colors is low priority right now. One major advantage would be colors in Windows, but since pytorch does not support Windows right now, there is no hurry.

benjamin-work avatar Oct 12 '17 07:10 benjamin-work

There are issues like https://github.com/timothygebhard/skorch/commit/bdbd96d12bf64a277677984760d9cfce14804425 where the PrintLog might need to switch coloring modes depending on the output destination. A good library could do that for us.

ottonemo avatar Mar 20 '18 15:03 ottonemo