This appears to have been fixed in the `develop` branch; the line you 
reference (which is line 870 in 'develop') is now preceded by subtraction 
of a floating point number:

   869     d2 = data - float(offset)
   870     d2 *= scale
This will automatically promote d2 to a floating point type which will have 
no issue with *= assignment.

On Monday, October 17, 2016 at 6:48:22 PM UTC-4, Peter Spuhler wrote:
>
> line 828 in functions.py
> currently
> d2 *= scale
>
> propose change to 
> d2 = d2 * scale
>
> otherwise will fail to convert types when scale and d2 are not of the same 
> type
>
> for example 
>
> d2 = np.array(1)
> scale = np.array(1.0)
>
> results in 
> d2 *= scale
> Traceback (most recent call last):
>   Python Shell, prompt 16, line 1
> TypeError: Cannot cast ufunc multiply output from dtype('float64') to 
> dtype('int32') with casting rule 'same_kind'
>
> whereas 
> d2 = d2 *scale 
> works just fine
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/162e05b3-1ddd-4d05-947d-8689f5d38af8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to