labscript-suite / labscript

The 𝗹𝗮𝗯𝘀𝗰𝗿𝗶𝗽𝘁 library provides a translation from expressive Python code to low-level hardware instructions.
http://labscriptsuite.org
BSD 2-Clause "Simplified" License
9 stars 53 forks source link

`Output` cannot expand timeseries with numpy==1.25 #100

Closed dihm closed 1 year ago

dihm commented 1 year ago

Refreshed a labscript installation and bumped up against this line

https://github.com/labscript-suite/labscript/blob/bc7fa4b98d75591988ae2e1c5aee97da86e5067c/labscript/labscript.py#L1725

There appears to be a typo, since np.dtype is not a dtype, but a function for getting dtypes. Older versions of numpy allow this to slide by assuming an object dtype which get corrected later when writing to/from the h5 file. With at least numpy 1.25, this call results in a process hanging error that stops the compiler cold.

Fix is pretty simple: self.raw_output = np.array(self.timeseries, dtype=np.dtype(self.dtype)) to match the call below it.