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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)
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