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: af7939291809
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: 8df1b03f0f42
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Feb 4, 2015

  1. Copy the full SHA
    f308bf6 View commit details
  2. Copy the full SHA
    0e65f71 View commit details
  3. Copy the full SHA
    0ba07e6 View commit details
  4. Copy the full SHA
    8df1b03 View commit details
Showing with 25 additions and 9 deletions.
  1. +20 −6 artiq/frontend/artiq_run.py
  2. +4 −2 artiq/tools.py
  3. +1 −1 doc/manual/installing.rst
26 changes: 20 additions & 6 deletions artiq/frontend/artiq_run.py
Original file line number Diff line number Diff line change
@@ -6,11 +6,13 @@
from operator import itemgetter
from itertools import chain

import h5py

from artiq.language.db import *
from artiq.protocols import pyon
from artiq.protocols.file_db import FlatFileDB
from artiq.master.db import DBHub, ResultDB
from artiq.tools import file_import
from artiq.tools import file_import, verbosity_args, init_logger


class ELFRunner(AutoDB):
@@ -35,6 +37,7 @@ def get_argparser():
parser = argparse.ArgumentParser(
description="Local experiment running tool")

verbosity_args(parser)
parser.add_argument("-d", "--ddb", default="ddb.pyon",
help="device database file")
parser.add_argument("-p", "--pdb", default="pdb.pyon",
@@ -44,6 +47,9 @@ def get_argparser():
help="run ELF binary")
parser.add_argument("-u", "--unit", default=None,
help="unit to run")
parser.add_argument("-o", "--hdf5", default=None,
help="write results to specified HDF5 file"
" (default: print them)")
parser.add_argument("file",
help="file containing the unit to run")
parser.add_argument("arguments", nargs="*",
@@ -62,6 +68,7 @@ def _parse_arguments(arguments):

def main():
args = get_argparser().parse_args()
init_logger(args)

ddb = FlatFileDB(args.ddb)
pdb = FlatFileDB(args.pdb)
@@ -107,11 +114,18 @@ def main():
unit_inst = unit(dbh, **arguments)
unit_inst.run()

if rdb.data.read or rdb.realtime_data.read:
print("Results:")
for k, v in chain(rdb.realtime_data.read.items(),
rdb.data.read.items()):
print("{}: {}".format(k, v))
if args.hdf5 is not None:
f = h5py.File(args.hdf5, "w")
try:
rdb.write_hdf5(f)
finally:
f.close()
else:
if rdb.data.read or rdb.realtime_data.read:
print("Results:")
for k, v in chain(rdb.realtime_data.read.items(),
rdb.data.read.items()):
print("{}: {}".format(k, v))
finally:
dbh.close()

6 changes: 4 additions & 2 deletions artiq/tools.py
Original file line number Diff line number Diff line change
@@ -32,8 +32,10 @@ def file_import(filename):

def verbosity_args(parser):
group = parser.add_argument_group("verbosity")
group.add_argument("-v", "--verbose", default=0, action="count")
group.add_argument("-q", "--quiet", default=0, action="count")
group.add_argument("-v", "--verbose", default=0, action="count",
help="increase logging level")
group.add_argument("-q", "--quiet", default=0, action="count",
help="decrease logging level")


def init_logger(args):
2 changes: 1 addition & 1 deletion doc/manual/installing.rst
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ Xubuntu 14.04 specific instructions

This command installs all the required packages: ::

$ sudo apt-get install build-essential autotools-dev file git patch perl xutils-devs python3-pip texinfo flex bison libmpc-dev python3-serial python3-dateutil python3-prettytable python3-setuptools python3-numpy python3-scipy python3-sphinx python3-dev python-dev subversion cmake libusb-dev libftdi-dev pkg-config
$ sudo apt-get install build-essential autotools-dev file git patch perl xutils-devs python3-pip texinfo flex bison libmpc-dev python3-serial python3-dateutil python3-prettytable python3-setuptools python3-numpy python3-scipy python3-sphinx python3-h5py python3-dev python-dev subversion cmake libusb-dev libftdi-dev pkg-config

Note that ARTIQ requires Python 3.4 or above.