From c18495d4849f1ff386dd51c225560abe4404c699 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 13 Aug 2014 18:30:57 +0800 Subject: [PATCH] MPO -> AutoContext --- artiq/devices/dds_core.py | 2 +- artiq/devices/gpio_core.py | 2 +- artiq/devices/ttl_core.py | 2 +- artiq/language/core.py | 2 +- artiq/sim/devices.py | 8 ++++---- doc/slides/artiq_overview.tex | 6 +++--- examples/al_spectroscopy.py | 2 +- examples/compiler_test.py | 2 +- examples/coredev_test.py | 4 ++-- examples/dds_test.py | 2 +- examples/simple_simulation.py | 2 +- examples/time_test.py | 4 ++-- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/artiq/devices/dds_core.py b/artiq/devices/dds_core.py index 3145d6253..d380f2edf 100644 --- a/artiq/devices/dds_core.py +++ b/artiq/devices/dds_core.py @@ -1,7 +1,7 @@ from artiq.language.core import * from artiq.language.units import * -class DDS(MPO): +class DDS(AutoContext): parameters = "dds_sysclk reg_channel rtio_channel" def build(self): diff --git a/artiq/devices/gpio_core.py b/artiq/devices/gpio_core.py index 4b6fa4b95..0574cefc7 100644 --- a/artiq/devices/gpio_core.py +++ b/artiq/devices/gpio_core.py @@ -1,6 +1,6 @@ from artiq.language.core import * -class GPIOOut(MPO): +class GPIOOut(AutoContext): parameters = "channel" @kernel diff --git a/artiq/devices/ttl_core.py b/artiq/devices/ttl_core.py index eda921c1d..49e697b08 100644 --- a/artiq/devices/ttl_core.py +++ b/artiq/devices/ttl_core.py @@ -1,6 +1,6 @@ from artiq.language.core import * -class TTLOut(MPO): +class TTLOut(AutoContext): parameters = "channel" @kernel diff --git a/artiq/language/core.py b/artiq/language/core.py index f21877365..0ac2f0d4f 100644 --- a/artiq/language/core.py +++ b/artiq/language/core.py @@ -5,7 +5,7 @@ from artiq.language import units def _make_kernel_ro(value): return isinstance(value, (int, float, str, units.Quantity)) -class MPO: +class AutoContext: parameters = "" implicit_core = True diff --git a/artiq/sim/devices.py b/artiq/sim/devices.py index cb0e49e79..c5ec905f7 100644 --- a/artiq/sim/devices.py +++ b/artiq/sim/devices.py @@ -1,6 +1,6 @@ from random import Random -from artiq.language.core import MPO, delay +from artiq.language.core import AutoContext, delay from artiq.language import units from artiq.sim import time @@ -8,7 +8,7 @@ class Core: def run(self, k_function, k_args, k_kwargs): return k_function(*k_args, **k_kwargs) -class Input(MPO): +class Input(AutoContext): parameters = "name" def build(self): @@ -25,14 +25,14 @@ class Input(MPO): delay(duration) return result -class WaveOutput(MPO): +class WaveOutput(AutoContext): parameters = "name" def pulse(self, frequency, duration): time.manager.event(("pulse", self.name, frequency, duration)) delay(duration) -class VoltageOutput(MPO): +class VoltageOutput(AutoContext): parameters = "name" def set(self, value): diff --git a/doc/slides/artiq_overview.tex b/doc/slides/artiq_overview.tex index 395c2fa3e..528b9d425 100644 --- a/doc/slides/artiq_overview.tex +++ b/doc/slides/artiq_overview.tex @@ -86,7 +86,7 @@ with parallel: \begin{frame}[fragile] \frametitle{\fontseries{l}\selectfont Object orientation and code reuse} \begin{verbatimtab} -class Main(MPO): +class Main(AutoContext): def build(self): self.ion1 = Ion(...) self.ion2 = Ion(...) @@ -130,9 +130,9 @@ class Main(MPO): \begin{frame}[fragile] \frametitle{\fontseries{l}\selectfont Channels and parameters} \begin{itemize} -\item A kernel is a method of a class that derives from the \verb!MPO! class +\item A kernel is a method of a class that derives from the \verb!AutoContext! class \item The entry point for an experiment is called \verb!run! --- may or may not be a kernel -\item The \verb!MPO! class manages channels and parameters, and sets them as attributes +\item The \verb!AutoContext! class manages channels and parameters, and sets them as attributes \item If channels/parameters are passed as constructor arguments, those are used \item Otherwise, they are looked up in the device and parameter databases \end{itemize} diff --git a/examples/al_spectroscopy.py b/examples/al_spectroscopy.py index 7d5e19699..4a3dfbd4c 100644 --- a/examples/al_spectroscopy.py +++ b/examples/al_spectroscopy.py @@ -1,7 +1,7 @@ from artiq.language.units import * from artiq.language.core import * -class AluminumSpectroscopy(MPO): +class AluminumSpectroscopy(AutoContext): parameters = "mains_sync laser_cooling spectroscopy spectroscopy_b state_detection pmt \ spectroscopy_freq photon_limit_low photon_limit_high" diff --git a/examples/compiler_test.py b/examples/compiler_test.py index b93669900..c247db045 100644 --- a/examples/compiler_test.py +++ b/examples/compiler_test.py @@ -3,7 +3,7 @@ from artiq.language.core import * my_range = range -class CompilerTest(MPO): +class CompilerTest(AutoContext): parameters = "a b A B" def print_done(self): diff --git a/examples/coredev_test.py b/examples/coredev_test.py index b2e1d26e7..e4f09847a 100644 --- a/examples/coredev_test.py +++ b/examples/coredev_test.py @@ -1,7 +1,7 @@ -from artiq.language.core import MPO, kernel +from artiq.language.core import AutoContext, kernel from artiq.devices import corecom_serial, core, gpio_core -class CompilerTest(MPO): +class CompilerTest(AutoContext): parameters = "led" def output(self, n): diff --git a/examples/dds_test.py b/examples/dds_test.py index 966a2663b..cd832dddb 100644 --- a/examples/dds_test.py +++ b/examples/dds_test.py @@ -2,7 +2,7 @@ from artiq.language.units import * from artiq.language.core import * from artiq.devices import corecom_serial, core, dds_core, gpio_core -class DDSTest(MPO): +class DDSTest(AutoContext): parameters = "a b c d led" @kernel diff --git a/examples/simple_simulation.py b/examples/simple_simulation.py index d60b26f5d..54b5412de 100644 --- a/examples/simple_simulation.py +++ b/examples/simple_simulation.py @@ -1,7 +1,7 @@ from artiq.language.units import * from artiq.language.core import * -class SimpleSimulation(MPO): +class SimpleSimulation(AutoContext): parameters = "a b c d" @kernel diff --git a/examples/time_test.py b/examples/time_test.py index 997e72336..d933c2e43 100644 --- a/examples/time_test.py +++ b/examples/time_test.py @@ -2,7 +2,7 @@ from artiq.language.units import * from artiq.language.core import * from artiq.devices import corecom_serial, core -class DummyPulse(MPO): +class DummyPulse(AutoContext): parameters = "name" def print_on(self, t, f): @@ -17,7 +17,7 @@ class DummyPulse(MPO): delay(duration) self.print_off(now()) -class TimeTest(MPO): +class TimeTest(AutoContext): parameters = "a b c d" @kernel