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: 13b4929dd832
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: 7205985f6984
Choose a head ref
  • 5 commits
  • 6 files changed
  • 1 contributor

Commits on Apr 8, 2016

  1. Copy the full SHA
    d6beec1 View commit details
  2. Copy the full SHA
    3e6a8a2 View commit details
  3. plot_xy: fix errorbar plot

    jordens committed Apr 8, 2016
    Copy the full SHA
    37bcd5a View commit details
  4. Copy the full SHA
    38e225d View commit details
  5. applets: style

    jordens committed Apr 8, 2016
    Copy the full SHA
    7205985 View commit details
Showing with 17 additions and 15 deletions.
  1. +0 −1 artiq/applets/image.py
  2. +0 −1 artiq/applets/plot_hist.py
  3. +4 −2 artiq/applets/plot_xy.py
  4. +2 −2 artiq/applets/plot_xy_hist.py
  5. +10 −9 artiq/applets/simple.py
  6. +1 −0 artiq/gui/entries.py
1 change: 0 additions & 1 deletion artiq/applets/image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3.5

import numpy as np
import PyQt5 # make sure pyqtgraph imports Qt5
import pyqtgraph

1 change: 0 additions & 1 deletion artiq/applets/plot_hist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3.5

import numpy as np
import PyQt5 # make sure pyqtgraph imports Qt5
import pyqtgraph

6 changes: 4 additions & 2 deletions artiq/applets/plot_xy.py
Original file line number Diff line number Diff line change
@@ -43,10 +43,12 @@ def data_changed(self, data, mods, title):
# See https://github.com/pyqtgraph/pyqtgraph/issues/211
if hasattr(error, "__len__") and not isinstance(error, np.ndarray):
error = np.array(error)
errbars = pg.ErrorBarItem(x=np.array(x), y=np.array(y), height=error)
errbars = pyqtgraph.ErrorBarItem(
x=np.array(x), y=np.array(y), height=error)
self.addItem(errbars)
if fit is not None:
self.plot(x, fit)
xi = np.argsort(x)
self.plot(x[xi], fit[xi])


def main():
4 changes: 2 additions & 2 deletions artiq/applets/plot_xy_hist.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def _compute_ys(histogram_bins, histograms_counts):
class XYHistPlot(QtWidgets.QSplitter):
def __init__(self, args):
QtWidgets.QSplitter.__init__(self)
self.resize(1000,600)
self.resize(1000, 600)
self.setWindowTitle("XY/Histogram")

self.xy_plot = pyqtgraph.PlotWidget()
@@ -121,7 +121,7 @@ def data_changed(self, data, mods):
self._set_partial_data(xs, histograms_counts)
else:
self._set_full_data(xs, histogram_bins, histograms_counts)


def main():
applet = SimpleApplet(XYHistPlot)
19 changes: 10 additions & 9 deletions artiq/applets/simple.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
import os
import string

from quamash import QEventLoop, QtWidgets, QtGui, QtCore
from quamash import QEventLoop, QtWidgets, QtCore

from artiq.protocols.sync_struct import Subscriber, process_mod
from artiq.protocols import pyon
@@ -35,7 +35,7 @@ async def embed(self, win_id):
self.close_cb()
elif reply["action"] != "embed_done":
logger.error("unexpected action reply to embed request: %s",
action)
reply["action"])
self.close_cb()

def fix_initial_size(self):
@@ -61,7 +61,7 @@ async def listen(self):
raise ValueError("unknown action in parent message")
except:
logger.error("error processing parent message",
exc_info=True)
exc_info=True)
self.close_cb()

def subscribe(self, datasets, init_cb, mod_cb):
@@ -79,10 +79,10 @@ def __init__(self, main_widget_class, cmd_description=None,

self.argparser = argparse.ArgumentParser(description=cmd_description)

self.argparser.add_argument("--update-delay", type=float,
default=default_update_delay,
self.argparser.add_argument(
"--update-delay", type=float, default=default_update_delay,
help="time to wait after a mod (buffering other mods) "
"before updating (default: %(default).2f)")
"before updating (default: %(default).2f)")

group = self.argparser.add_argument_group("standalone mode (default)")
group.add_argument(
@@ -94,8 +94,9 @@ def __init__(self, main_widget_class, cmd_description=None,
"--port", default=3250, type=int,
help="TCP port to connect to")

self.argparser.add_argument("--embed", default=None,
help="embed into GUI", metavar="IPC_ADDRESS")
self.argparser.add_argument(
"--embed", default=None, help="embed into GUI",
metavar="IPC_ADDRESS")

self._arggroup_datasets = self.argparser.add_argument_group("datasets")

@@ -148,7 +149,7 @@ def create_main_widget(self):
# testing has shown that the following procedure must be
# followed exactly on Linux:
# 1. applet creates widget
# 2. applet creates native window without showing it, and
# 2. applet creates native window without showing it, and
# gets its ID
# 3. applet sends the ID to host, host embeds the widget
# 4. applet shows the widget
1 change: 1 addition & 0 deletions artiq/gui/entries.py
Original file line number Diff line number Diff line change
@@ -168,6 +168,7 @@ def apply_properties(widget):

npoints = QtWidgets.QSpinBox()
npoints.setMinimum(1)
npoints.setMaximum((1 << 31) - 1)
disable_scroll_wheel(npoints)
self.addWidget(npoints, 1, 1)