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: 5fef95b073ba
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: f3d8ac301c49
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 7, 2016

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

    jordens committed Apr 7, 2016
    Copy the full SHA
    787ed65 View commit details
  4. Copy the full SHA
    f3d8ac3 View commit details
Showing with 15 additions and 11 deletions.
  1. +4 −2 artiq/applets/plot_xy.py
  2. +10 −9 artiq/applets/simple.py
  3. +1 −0 artiq/gui/entries.py
6 changes: 4 additions & 2 deletions artiq/applets/plot_xy.py
Original file line number Diff line number Diff line change
@@ -42,10 +42,12 @@ def data_changed(self, data, mods):
# 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():
19 changes: 10 additions & 9 deletions artiq/applets/simple.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
import asyncio
import os

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
@@ -34,7 +34,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):
@@ -60,7 +60,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):
@@ -78,10 +78,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(
@@ -93,8 +93,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")

@@ -147,7 +148,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)