numba prints "<NULL>"

27 Views Asked by At

I have a jitted python function (@numba.njit(parallel=True, fastmath=True)) that (amongst other things) prints some status variables:

...
for box_index in range(len(box_sizes)):
    ...
    print("The valxue is:", box_sizes_x[box_index])
    ...

Recently I modified the code a bit, and now when I run it, I see this:

The value is: 0.17
<NULL> 0.34
<NULL> 0.68
<NULL> 1.36
<NULL> 2.72
<NULL> 5.44
<NULL> 10.88

the string literals have been replaced by <NULL>?! Uh?!

There are no other print statements in the loop. If I add another print statement in the loop, the problem goes away. Also, some of the data calculated in the loop is not coming out how I would expect it when the <NULL>s are there, but when I add the extra print statement so the <NULL>s disappear, the data comes out looking fine. The values of box_sizes_x[box_index] being printed are correct.

What is <NULL> and why is it there?

0

There are 0 best solutions below