micropython-ulab icon indicating copy to clipboard operation
micropython-ulab copied to clipboard

Add a ULAB_PRINT_DTYPE constant

Open HugoNumworks opened this issue 2 years ago • 5 comments

I don't know if it is something you would like to add, but I added a small option for the display of "dtype=..." when printing an array.

HugoNumworks avatar Apr 24 '23 12:04 HugoNumworks

I'm not against it, but there seems to be some discrepancy in numpy itself. What is the rule for printing dtype?

v923z avatar Apr 24 '23 12:04 v923z

there seems to be some discrepancy in numpy itself

I don't use Numpy very often, but I think I have never seen the dtype printed alongside the array, in which case does it happen ?

HugoNumworks avatar Apr 24 '23 14:04 HugoNumworks

there seems to be some discrepancy in numpy itself

I don't use Numpy very often, but I think I have never seen the dtype printed alongside the array, in which case does it happen ?

This doesn't print the dtype:

>>> linspace(0, 10, num=11)
array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])

v923z avatar Apr 24 '23 16:04 v923z

there seems to be some discrepancy in numpy itself

I don't use Numpy very often, but I think I have never seen the dtype printed alongside the array, in which case does it happen ?

This doesn't print the dtype:

>>> linspace(0, 10, num=11)
array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])

Sorry, I meant to ask : In which case does Numpy display the dtype ?

I'm adding the option in here so that it is now possible to disable the display of "dtype=". Currently, it is always displayed, so I set ULAB_PRINT_DTYPE to 1 by default, but my goal is to be able to deactivate it.

HugoNumworks avatar May 16 '23 14:05 HugoNumworks

Sorry, I meant to ask : In which case does Numpy display the dtype ?

I don't know, and that's why I would like to hold off with this, till it is sorted out.

v923z avatar May 16 '23 14:05 v923z