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: 76dcccb33b60
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: 1a04cc0c249d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 5, 2016

  1. Copy the full SHA
    4bc5eaf View commit details
  2. Copy the full SHA
    1a04cc0 View commit details
Showing with 22 additions and 8 deletions.
  1. +15 −0 artiq/browser/results.py
  2. +7 −8 artiq/test/coredevice/test_rtio.py
15 changes: 15 additions & 0 deletions artiq/browser/results.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,20 @@
logger = logging.getLogger(__name__)


class ResultIconProvider(QtWidgets.QFileIconProvider):
def icon(self, info):
if not (info.isFile() and info.isReadable() and info.suffix() == "h5"):
return QtWidgets.QFileIconProvider.icon(self, info)
try:
with h5py.File(info.filePath(), "r") as f:
d = f["thumbnail"]
img = QtGui.QImage.fromData(d.value, d.attrs["extension"])
pix = QtGui.QPixmap.fromImage(img)
return QtGui.QIcon(pix)
except:
return QtWidgets.QFileIconProvider.icon(self, info)


class ResultsBrowser(QtWidgets.QSplitter):
def __init__(self, datasets):
QtWidgets.QSplitter.__init__(self)
@@ -16,6 +30,7 @@ def __init__(self, datasets):
self.rt_model.setRootPath(QtCore.QDir.currentPath())
self.rt_model.setNameFilters(["*.h5"])
self.rt_model.setNameFilterDisables(False)
self.rt_model.setIconProvider(ResultIconProvider())

self.rt = QtWidgets.QTreeView()
self.rt.setModel(self.rt_model)
15 changes: 7 additions & 8 deletions artiq/test/coredevice/test_rtio.py
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ def run(self):
self.core.break_realtime()
break
else:
self.set_dataset("pulse_rate", mu_to_seconds(2*dt))
self.set_dataset("pulse_rate", mu_to_seconds(dt))
return


@@ -131,7 +131,7 @@ def run(self):
self.core.break_realtime()
break
else:
self.set_dataset("pulse_rate", mu_to_seconds(dt))
self.set_dataset("pulse_rate", mu_to_seconds(dt/2))
return


@@ -255,21 +255,20 @@ def test_clock_generator_loopback(self):
self.assertEqual(count, 10)

def test_pulse_rate(self):
"""Mimumum delay and duration of sustainably emitted TTL pulses"""
"""Minimum interval for sustained TTL output switching"""
self.execute(PulseRate)
rate = self.dataset_mgr.get("pulse_rate")
print(rate)
self.assertGreater(rate, 100*ns)
self.assertLess(rate, 1500*ns)
self.assertLess(rate, 700*ns)

def test_pulse_rate_dds(self):
"""Minimum delay between DDS batches each setting the frequencies of
two DDS"""
"""Minimum interval for sustained DDS frequency switching"""
self.execute(PulseRateDDS)
rate = self.dataset_mgr.get("pulse_rate")
print(rate)
self.assertGreater(rate, 3*us)
self.assertLess(rate, 12*us)
self.assertGreater(rate, 1*us)
self.assertLess(rate, 6*us)

def test_loopback_count(self):
npulses = 2