@@ -13,6 +13,7 @@ A number of Python features can be used inside a kernel for compilation and exec
13
13
* 64-bit signed integers (use ``numpy.int64 `` to convert)
14
14
* Double-precision floating point numbers
15
15
* Lists of any supported types
16
+ * String constants
16
17
* User-defined classes, with attributes of any supported types (attributes that are not used anywhere in the kernel are ignored)
17
18
18
19
For a demonstration of some of these features, see the ``mandelbrot.py `` example.
@@ -29,29 +30,29 @@ Kernel code can call host functions without any additional ceremony. However, su
29
30
30
31
The Python types correspond to ARTIQ type annotations as follows:
31
32
32
- +-------------+-------------------------+
33
- | Python | ARTIQ |
34
- +=============+=========================+
35
- | NoneType | TNone |
36
- +-------------+-------------------------+
37
- | bool | TBool |
38
- +-------------+-------------------------+
39
- | int | TInt32 or TInt64 |
40
- +-------------+-------------------------+
41
- | float | TFloat |
42
- +-------------+-------------------------+
43
- | str | TStr |
44
- +-------------+-------------------------+
45
- | list of T | TList(T) |
46
- +-------------+-------------------------+
47
- | range | TRange32, TRange64 |
48
- +-------------+-------------------------+
49
- | numpy.int32 | TInt32 |
50
- +-------------+-------------------------+
51
- | numpy.int64 | TInt64 |
52
- +-------------+-------------------------+
53
- | numpy.float64 | TFloat |
54
- +-------------+-------------------------+
33
+ +--------------- +-------------------------+
34
+ | Python | ARTIQ |
35
+ +=============== +=========================+
36
+ | NoneType | TNone |
37
+ +-------------+--------------------------- +
38
+ | bool | TBool |
39
+ +-------------+--------------------------- +
40
+ | int | TInt32 or TInt64 |
41
+ +-------------+--------------------------- +
42
+ | float | TFloat |
43
+ +-------------+--------------------------- +
44
+ | str | TStr |
45
+ +-------------+--------------------------- +
46
+ | list of T | TList(T) |
47
+ +-------------+--------------------------- +
48
+ | range | TRange32, TRange64 |
49
+ +-------------+--------------------------- +
50
+ | numpy.int32 | TInt32 |
51
+ +-------------+--------------------------- +
52
+ | numpy.int64 | TInt64 |
53
+ +-------------+--------------------------- +
54
+ | numpy.float64 | TFloat |
55
+ +-------------+--------------------------- +
55
56
56
57
Pitfalls
57
58
--------
0 commit comments