Skip to content

Commit 32b3d6e

Browse files
committed
Updated module doc strings so they are only a single sentence and relocated print_time() function to utils.
1 parent 5ea15e8 commit 32b3d6e

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

labscript/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# #
1212
#####################################################################
1313

14-
"""The labscript compiler interface. This is only relevant to developers and those
14+
"""The labscript compiler interface - this is only relevant to developers and those
1515
interested in the labscript interface to runmanager."""
1616

1717
import builtins

labscript/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# #
1212
#####################################################################
1313

14-
"""Core classes containing common device functionality. These are used in
14+
"""Core classes containing common device functionality - these are used in
1515
labscript-devices when adding support for a hardware device."""
1616

1717
import sys

labscript/functions.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,14 @@
1111
# #
1212
#####################################################################
1313

14-
"""Contains the functional forms of analog output ramps. These are not used directly,
14+
"""Contains the functional forms of analog output ramps - these are not used directly,
1515
instead see the interfaces in `AnalogQuantity`/`AnalogOut`."""
1616

1717
from pylab import *
1818
import numpy as np
1919

20-
def print_time(t, description):
21-
"""Print time with a descriptive string.
20+
from .utils import print_time
2221

23-
Useful debug tool to print time at a specific point
24-
in the shot, during shot compilation. Helpful when
25-
the time is calculated.
26-
27-
Args:
28-
t (float): Time to print
29-
description (str): Descriptive label to print with it
30-
"""
31-
print('t = {0:.9f} s:'.format(t),description)
3222

3323
def ramp(duration, initial, final):
3424
"""Defines a linear ramp.

labscript/labscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# #
1212
#####################################################################
1313

14-
"""Everything else including the `start()`, `stop()`, and `wait()` functions. All other
14+
"""Everything else including the `start()`, `stop()`, and `wait()` functions - all other
1515
classes are also imported here for backwards compatibility"""
1616

1717
import builtins

labscript/utils.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
cached_PseudoclockDevice = None
2727

2828

29+
def print_time(t, description):
30+
"""Print time with a descriptive string.
31+
32+
Useful debug tool to print time at a specific point
33+
in the shot, during shot compilation. Helpful when
34+
the time is calculated.
35+
36+
Args:
37+
t (float): Time to print
38+
description (str): Descriptive label to print with it
39+
"""
40+
print(f"t={t:.9f}s: {description}")
41+
42+
2943
def is_remote_connection(connection):
3044
"""Returns whether the connection is an instance of ``_RemoteConnection``
3145

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