forked from M-Labs/artiq
artiq.experiment: merge language and coredevice namespaces
perl -i -pe 's/^from artiq import \*$/from artiq.experiment import */' your_experiments/*.py (assuming you skipped the changes form the previous commit)
This commit is contained in:
parent
fbe4d96572
commit
765001054d
@ -0,0 +1,10 @@
|
||||
from artiq.coredevice import exceptions, dds
|
||||
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError,
|
||||
RTIOCollisionError)
|
||||
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE,
|
||||
PHASE_MODE_TRACKING)
|
||||
|
||||
__all__ = []
|
||||
__all__ += ["RTIOUnderflow", "RTIOSequenceError", "RTIOCollisionError"]
|
||||
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE",
|
||||
"PHASE_MODE_TRACKING"]
|
7
artiq/experiment.py
Normal file
7
artiq/experiment.py
Normal file
@ -0,0 +1,7 @@
|
||||
from artiq import language, coredevice
|
||||
from artiq.language import *
|
||||
from artiq.coredevice import *
|
||||
|
||||
__all__ = []
|
||||
__all__.extend(language.__all__)
|
||||
__all__.extend(coredevice.__all__)
|
@ -5,14 +5,9 @@ from artiq.language.environment import *
|
||||
from artiq.language.units import *
|
||||
from artiq.language.scan import *
|
||||
|
||||
from artiq.coredevice.dds import (PHASE_MODE_CONTINUOUS, PHASE_MODE_ABSOLUTE,
|
||||
PHASE_MODE_TRACKING)
|
||||
|
||||
__all__ = []
|
||||
__all__.extend(core.__all__)
|
||||
__all__.extend(types.__all__)
|
||||
__all__.extend(environment.__all__)
|
||||
__all__.extend(units.__all__)
|
||||
__all__.extend(scan.__all__)
|
||||
__all__ += ["PHASE_MODE_CONTINUOUS", "PHASE_MODE_ABSOLUTE",
|
||||
"PHASE_MODE_TRACKING"]
|
||||
|
@ -6,9 +6,6 @@ import os, linecache, re
|
||||
from collections import namedtuple
|
||||
from functools import wraps
|
||||
|
||||
# for runtime files in backtraces
|
||||
from artiq.coredevice.runtime import source_loader
|
||||
|
||||
|
||||
__all__ = ["host_int", "int", "host_round", "round",
|
||||
"kernel", "portable", "syscall", "host_only",
|
||||
@ -390,6 +387,8 @@ class ARTIQException:
|
||||
self.traceback = list(traceback)
|
||||
|
||||
def __str__(self):
|
||||
# lazy import this
|
||||
from artiq.coredevice.runtime import source_loader
|
||||
lines = []
|
||||
lines.append("Core Device Traceback (most recent call last):")
|
||||
for (filename, line, column, function, address) in self.traceback:
|
||||
|
@ -1,4 +1,4 @@
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.coredevice.analyzer import decode_dump, OutputMessage, InputMessage
|
||||
from artiq.test.hardware_testbench import ExperimentCase
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
from artiq.language import *
|
||||
from artiq.coredevice.exceptions import *
|
||||
from artiq.experiment import *
|
||||
from artiq.test.hardware_testbench import ExperimentCase
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.test.hardware_testbench import ExperimentCase
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
from operator import itemgetter
|
||||
from fractions import Fraction
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.sim import devices as sim_devices
|
||||
from artiq.test.hardware_testbench import ExperimentCase
|
||||
|
||||
|
@ -3,10 +3,8 @@
|
||||
|
||||
from math import sqrt
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.test.hardware_testbench import ExperimentCase
|
||||
from artiq.coredevice.exceptions import (RTIOUnderflow, RTIOSequenceError,
|
||||
RTIOCollisionError)
|
||||
|
||||
|
||||
class RTT(EnvExperiment):
|
||||
|
@ -6,7 +6,7 @@ import sys
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.master.databases import DeviceDB, DatasetDB
|
||||
from artiq.master.worker_db import DeviceManager, DatasetManager
|
||||
from artiq.coredevice.core import CompileError
|
||||
|
@ -5,7 +5,7 @@ import sys
|
||||
import os
|
||||
from time import time, sleep
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.master.scheduler import Scheduler
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ import sys
|
||||
import os
|
||||
from time import sleep
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
from artiq.master.worker import *
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Core language reference
|
||||
=======================
|
||||
|
||||
The most commonly used features from those modules can be imported with ``from artiq.language import *``.
|
||||
The most commonly used features from the ARTIQ language modules and from the core device modules are bundled together in ``artiq.experiment`` and can be imported with ``from artiq.experiment import *``.
|
||||
|
||||
:mod:`artiq.language.core` module
|
||||
---------------------------------
|
||||
|
@ -8,7 +8,7 @@ Connecting to the core device
|
||||
|
||||
As a very first step, we will turn on a LED on the core device. Create a file ``led.py`` containing the following: ::
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
|
||||
|
||||
class LED(EnvExperiment):
|
||||
@ -93,7 +93,7 @@ The point of running code on the core device is the ability to meet demanding re
|
||||
|
||||
Create a new file ``rtio.py`` containing the following: ::
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
|
||||
|
||||
class Tutorial(EnvExperiment):
|
||||
|
@ -16,7 +16,7 @@ Then create a ``~/artiq-master/repository`` sub-folder to contain experiments. T
|
||||
|
||||
Create a very simple experiment in ``~/artiq-master/repository`` and save it as ``mgmt_tutorial.py``: ::
|
||||
|
||||
from artiq.language import *
|
||||
from artiq.experiment import *
|
||||
|
||||
|
||||
class MgmtTutorial(EnvExperiment):
|
||||
|
Loading…
Reference in New Issue
Block a user