From ac0c63336a0cfe0edc95a2081fedda50882cd239 Mon Sep 17 00:00:00 2001 From: YinFengQi Date: Fri, 12 Dec 2025 16:05:58 +0800 Subject: [PATCH 1/2] fix: set 0 as default `max_BLACS_conn_length` - Set the default value of `max_BLACS_conn_length` to 0 so that the `np.empty` always receives a valid arguement - Fixes #118 --- labscript/labscript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labscript/labscript.py b/labscript/labscript.py index 6e1d23f..037c59f 100644 --- a/labscript/labscript.py +++ b/labscript/labscript.py @@ -229,7 +229,7 @@ def generate_connection_table(hdf5_file): devicedict = {} # Only use a string dtype as long as is needed: - max_BLACS_conn_length = -1 + max_BLACS_conn_length = 0 for device in compiler.inventory: devicedict[device.name] = device From 32e46d9cd4543630a9627b45af82e7ec7e27b5f0 Mon Sep 17 00:00:00 2001 From: YinFengQi Date: Mon, 19 Jan 2026 01:09:44 +0800 Subject: [PATCH 2/2] add attribute `BLACS_connection` to class `Device` - Define the attribute `BLACS_connection` in base class `Device`, to ensure that all `Device` subclasses have this attribute. Suggested-by: @dihm --- labscript/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/labscript/base.py b/labscript/base.py index cbab6b6..e57ab9d 100644 --- a/labscript/base.py +++ b/labscript/base.py @@ -93,6 +93,7 @@ def __init__( self.connection = connection self.start_order = start_order self.stop_order = stop_order + self.BLACS_connection = "" if start_order is not None and not isinstance(start_order, int): raise TypeError( f"Error when instantiating {name}. start_order must be an integer, not "