Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 387de11e56fd
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 651ed71b79ef
Choose a head ref
  • 2 commits
  • 19 files changed
  • 1 contributor

Commits on Feb 22, 2015

  1. Copy the full SHA
    4267e0d View commit details
  2. Copy the full SHA
    651ed71 View commit details
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -9,4 +9,4 @@ doc/manual/_build
/dist
/*.egg-info
/.coverage
examples/results
examples/master/results
4 changes: 1 addition & 3 deletions artiq/frontend/artiq_master.py
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@ def main():
pdb.hooks.append(simplephist)
rtr = RTResults()
repository = Repository()
explist = FlatFileDB("explist.pyon")

if os.name == "nt":
loop = asyncio.ProactorEventLoop()
@@ -71,7 +70,6 @@ def run_cb(rid, run_params):
"master_pdb": pdb,
"master_schedule": scheduler,
"master_repository": repository,
"master_explist": explist
})
loop.run_until_complete(server_control.start(
args.bind, args.port_control))
@@ -84,7 +82,7 @@ def run_cb(rid, run_params):
"parameters": pdb.data,
"parameters_simplehist": simplephist.history,
"rt_results": rtr.groups,
"explist": explist.data
"explist": repository.explist
})
loop.run_until_complete(server_notify.start(
args.bind, args.port_notify))
4 changes: 1 addition & 3 deletions artiq/frontend/artiq_run.py
Original file line number Diff line number Diff line change
@@ -112,9 +112,7 @@ def main():
module = file_import(args.file)
if args.unit is None:
units = [(k, v) for k, v in module.__dict__.items()
if k[0] != "_"
and isclass(v)
and hasattr(v, "__artiq_unit__")]
if isclass(v) and hasattr(v, "__artiq_unit__")]
l = len(units)
if l == 0:
print("No units found in module")
31 changes: 30 additions & 1 deletion artiq/master/repository.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
import os
from inspect import isclass

from artiq.protocols.sync_struct import Notifier
from artiq.tools import file_import


def scan_experiments():
r = dict()
for f in os.listdir("repository"):
if f.endswith(".py"):
try:
m = file_import(os.path.join("repository", f))
except:
continue
for k, v in m.__dict__.items():
if isclass(v) and hasattr(v, "__artiq_unit__"):
entry = {
"file": os.path.join("repository", f),
"unit": k,
"gui_file": getattr(v, "__artiq_gui_file__", None)
}
r[v.__artiq_unit__] = entry
return r


class Repository:
def __init__(self):
self.explist = Notifier(scan_experiments())

def get_data(self, filename):
with open(filename) as f:
with open(os.path.join("repository", filename)) as f:
return f.read()
4 changes: 1 addition & 3 deletions artiq/master/worker_impl.py
Original file line number Diff line number Diff line change
@@ -69,9 +69,7 @@ def get_unit(file, unit):
module = file_import(file)
if unit is None:
units = [v for k, v in module.__dict__.items()
if k[0] != "_"
and isclass(v)
and hasattr(v, "__artiq_unit__")]
if isclass(v) and hasattr(v, "__artiq_unit__")]
if len(units) != 1:
raise ValueError("Found {} units in module".format(len(units)))
return units[0]
12 changes: 0 additions & 12 deletions examples/explist.pyon

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ def model_numpy(xdata, F0):

class FloppingF(AutoDB):
__artiq_unit__ = "Flopping F simulation"
__artiq_gui_file__ = "flopping_f_simulation_gui.py"

class DBKeys:
implicit_core = False
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@


class AluminumSpectroscopy(AutoDB):
__artiq_unit__ = "Aluminum spectroscopy (simulation)"

class DBKeys:
mains_sync = Device()
laser_cooling = Device()
7 changes: 7 additions & 0 deletions examples/ddb_sim.pyon → examples/sim/ddb.pyon
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
{
"core": {
"type": "local",
"module": "artiq.sim.devices",
"class": "Core",
"arguments": {}
},
"mains_sync": {
"type": "local",
"module": "artiq.sim.devices",
"class": "Input",
"arguments": {"name": "mains_sync"}
},
"pmt": {
"type": "local",
"module": "artiq.sim.devices",
"class": "Input",
"arguments": {"name": "pmt"}
},
"laser_cooling": {
"type": "local",
"module": "artiq.sim.devices",
"class": "WaveOutput",
"arguments": {"name": "laser_cooling"}
},
"spectroscopy": {
"type": "local",
"module": "artiq.sim.devices",
"class": "WaveOutput",
"arguments": {"name": "spectroscopy"}
},
"spectroscopy_b": {
"type": "local",
"module": "artiq.sim.devices",
"class": "VoltageOutput",
"arguments": {"name": "spectroscopy_b"}
},
"state_detection": {
"type": "local",
"module": "artiq.sim.devices",
"class": "WaveOutput",
"arguments": {"name": "state_detection"}
1 change: 1 addition & 0 deletions examples/sim/pdb.pyon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
File renamed without changes.