bh107 / bohrium

Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
http://www.bh107.org
Apache License 2.0
220 stars 31 forks source link

Using format with Bohrium scalar throws warning #599

Closed dionhaefner closed 5 years ago

dionhaefner commented 5 years ago

Example:

>>> import bohrium as bh
>>> a = bh.random.rand(100)
>>> print("{!s}".format(bh.max(a)))  # good
0.9927014448176247
>>> print("{:.2f}".format(float(bh.max(a))))  # good
0.99
>>> print("%s" % bh.max(a))  # good
0.9927014448176247
>>> print("{}".format(bh.max(a)))  # bad
Encountering an operation not supported by Bohrium. It will be handled by the original NumPy:
<string>:1
0.992701444818