Skip to content

Commit 6d4535b

Browse files
committed
* Move Output classes to a separate file.
* `config` also refactored to be inside `compiler`. * constants moved into their own file. * warnings context managers moved into the `utils` file
1 parent 63ce813 commit 6d4535b

File tree

6 files changed

+2285
-2246
lines changed

6 files changed

+2285
-2246
lines changed

labscript/compiler.py

+7
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,12 @@ def reset(self):
6262
self.save_git_info = _SAVE_GIT_INFO
6363
self.shot_properties = {}
6464

65+
# This used to be in a separate config object, but it's been moved here so it
66+
# gets reset
67+
self.suppress_mild_warnings = True
68+
self.suppress_all_warnings = False
69+
self.compression = 'gzip' # set to 'gzip' for compression
70+
71+
6572
compiler = Compiler()
6673
"""The compiler instance"""

labscript/constants.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ns = 1e-9
2+
us = 1e-6
3+
ms = 1e-3
4+
s = 1
5+
Hz = 1
6+
kHz = 1e3
7+
MHz = 1e6
8+
GHz = 1e9

labscript/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def expand_change_times(self, all_change_times, change_times, outputs_by_clockli
399399

400400
if maxrate:
401401
# If there was ramping at this timestep, how many clock ticks fit before the next instruction?
402-
n_ticks, remainder = divmod((all_change_times[i+1] - time)*maxrate, 1)
402+
n_ticks, remainder = np.divmod((all_change_times[i+1] - time)*maxrate, 1)
403403
n_ticks = int(n_ticks)
404404
# Can we squeeze the final clock cycle in at the end?
405405
if remainder and remainder/float(maxrate) >= 1/float(local_clock_limit):

0 commit comments

Comments
 (0)