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: 9ceca44dbe4e
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: 385e8d98fc7e
Choose a head ref
  • 5 commits
  • 4 files changed
  • 2 contributors

Commits on Apr 14, 2016

  1. gui.models: style

    jordens authored and sbourdeauducq committed Apr 14, 2016
    Copy the full SHA
    69f534c View commit details
  2. master/worker_db: style

    sbourdeauducq committed Apr 14, 2016
    Copy the full SHA
    c97cb1d View commit details
  3. Copy the full SHA
    a27aa96 View commit details
  4. test_rtio: integer division

    jordens authored and sbourdeauducq committed Apr 14, 2016
    Copy the full SHA
    2086e46 View commit details
  5. Copy the full SHA
    385e8d9 View commit details
Showing with 22 additions and 19 deletions.
  1. +14 −13 artiq/gui/models.py
  2. +3 −3 artiq/master/worker_db.py
  3. +3 −1 artiq/protocols/pyon.py
  4. +2 −2 artiq/test/coredevice/test_rtio.py
27 changes: 14 additions & 13 deletions artiq/gui/models.py
Original file line number Diff line number Diff line change
@@ -55,8 +55,9 @@ class DictSyncModel(QtCore.QAbstractTableModel):
def __init__(self, headers, init):
self.headers = headers
self.backing_store = init
self.row_to_key = sorted(self.backing_store.keys(),
key=lambda k: self.sort_key(k, self.backing_store[k]))
self.row_to_key = sorted(
self.backing_store.keys(),
key=lambda k: self.sort_key(k, self.backing_store[k]))
QtCore.QAbstractTableModel.__init__(self)

def rowCount(self, parent):
@@ -73,8 +74,8 @@ def data(self, index, role):
return self.convert(k, self.backing_store[k], index.column())

def headerData(self, col, orientation, role):
if (orientation == QtCore.Qt.Horizontal
and role == QtCore.Qt.DisplayRole):
if (orientation == QtCore.Qt.Horizontal and
role == QtCore.Qt.DisplayRole):
return self.headers[col]
return None

@@ -84,8 +85,8 @@ def _find_row(self, k, v):
while lo < hi:
mid = (lo + hi)//2
if (self.sort_key(self.row_to_key[mid],
self.backing_store[self.row_to_key[mid]])
< self.sort_key(k, v)):
self.backing_store[self.row_to_key[mid]]) <
self.sort_key(k, v)):
lo = mid + 1
else:
hi = mid
@@ -152,8 +153,8 @@ def data(self, index, role):
index.column())

def headerData(self, col, orientation, role):
if (orientation == QtCore.Qt.Horizontal
and role == QtCore.Qt.DisplayRole):
if (orientation == QtCore.Qt.Horizontal and
role == QtCore.Qt.DisplayRole):
return self.headers[col]
return None

@@ -204,8 +205,8 @@ def __init__(self, parent, row, name):
self.is_node = False

def __repr__(self):
return ("<DictSyncTreeSepItem {}, row={}, nchildren={}>"
.format(self.name, self.row, len(self.children_by_row)))
return ("<DictSyncTreeSepItem {}, row={}, nchildren={}>".
format(self.name, self.row, len(self.children_by_row)))


def _bisect_item(a, name):
@@ -246,8 +247,8 @@ def columnCount(self, parent):
return len(self.headers)

def headerData(self, col, orientation, role):
if (orientation == QtCore.Qt.Horizontal
and role == QtCore.Qt.DisplayRole):
if (orientation == QtCore.Qt.Horizontal and
role == QtCore.Qt.DisplayRole):
return self.headers[col]
return None

@@ -301,7 +302,7 @@ def _add_item(self, parent, name, leaf):
next_item.row += 1
name_dict[name] = item
self.endInsertRows()

return item

def __setitem__(self, k, v):
6 changes: 3 additions & 3 deletions artiq/master/worker_db.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
import time
import re

import numpy as np
import h5py

from artiq.protocols.sync_struct import Notifier
@@ -44,7 +43,8 @@ def _last_rid(self):
def _update_cache(self, rid):
contents = str(rid) + "\n"
directory = os.path.abspath(os.path.dirname(self.cache_filename))
with tempfile.NamedTemporaryFile("w", dir=directory, delete=False) as f:
with tempfile.NamedTemporaryFile("w", dir=directory, delete=False
) as f:
f.write(contents)
tmpname = f.name
os.replace(tmpname, self.cache_filename)
@@ -68,7 +68,7 @@ def _last_rid_from_results(self):
except:
continue
minute_folders = filter(lambda x: re.fullmatch('\d\d-\d\d', x),
minute_folders)
minute_folders)
for mf in minute_folders:
minute_path = os.path.join(day_path, mf)
try:
4 changes: 3 additions & 1 deletion artiq/protocols/pyon.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
The main rationale for this new custom serializer (instead of using JSON) is
that JSON does not support Numpy and more generally cannot be extended with
other data types while keeping a concise syntax. Here we can use the Python
function call syntax to mark special data types.
function call syntax to express special data types.
"""


@@ -24,8 +24,10 @@
import tempfile

import numpy

from ..language.core import int as wrapping_int


_encode_map = {
type(None): "none",
bool: "bool",
4 changes: 2 additions & 2 deletions artiq/test/coredevice/test_rtio.py
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ def run(self):
dt = seconds_to_mu(5*us)
while True:
delay(10*ms)
for i in range(100):
for i in range(1250):
try:
with self.core_dds.batch:
self.dds0.set(100*MHz)
@@ -131,7 +131,7 @@ def run(self):
self.core.break_realtime()
break
else:
self.set_dataset("pulse_rate", mu_to_seconds(dt/2))
self.set_dataset("pulse_rate", mu_to_seconds(dt//2))
return