From a667f7efa116506a76b8b74fdf1cc993187df2d6 Mon Sep 17 00:00:00 2001 From: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu, 25 Jun 2020 11:17:11 +1000 Subject: [PATCH 1/2] Bugfix for ValueError introduced in #68 --- labscript/labscript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labscript/labscript.py b/labscript/labscript.py index 1b1ee8e..910663f 100644 --- a/labscript/labscript.py +++ b/labscript/labscript.py @@ -102,7 +102,7 @@ def bitfield(arrays,dtype): """converts a list of arrays of ones and zeros into a single array of unsigned ints of the given datatype.""" n = {uint8:8,uint16:16,uint32:32} - if arrays[0] == 0: + if not isinstance(arrays[0], np.ndarray) and arrays[0] == 0: y = zeros(max([len(arr) if iterable(arr) else 1 for arr in arrays]),dtype=dtype) else: y = array(arrays[0],dtype=dtype) From 4e7781092caf7a0f59bf9009be1e377e5f9589f5 Mon Sep 17 00:00:00 2001 From: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu, 25 Jun 2020 11:18:56 +1000 Subject: [PATCH 2/2] Abbreviated bugfix. --- labscript/labscript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labscript/labscript.py b/labscript/labscript.py index 910663f..39fd574 100644 --- a/labscript/labscript.py +++ b/labscript/labscript.py @@ -102,7 +102,7 @@ def bitfield(arrays,dtype): """converts a list of arrays of ones and zeros into a single array of unsigned ints of the given datatype.""" n = {uint8:8,uint16:16,uint32:32} - if not isinstance(arrays[0], np.ndarray) and arrays[0] == 0: + if np.array_equal(arrays[0], 0): y = zeros(max([len(arr) if iterable(arr) else 1 for arr in arrays]),dtype=dtype) else: y = array(arrays[0],dtype=dtype) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy