diff --git a/artiq/browser/files.py b/artiq/browser/files.py index 339c12d34..46bf10b3f 100644 --- a/artiq/browser/files.py +++ b/artiq/browser/files.py @@ -71,7 +71,7 @@ class ZoomIconView(QtWidgets.QListView): self._char_width = QtGui.QFontMetrics(self.font()).averageCharWidth() self.setViewMode(self.IconMode) w = self._char_width*self.default_size - self.setIconSize(QtCore.QSize(w, w*self.aspect)) + self.setIconSize(QtCore.QSize(w, int(w*self.aspect))) self.setFlow(self.LeftToRight) self.setResizeMode(self.Adjust) self.setWrapping(True) diff --git a/artiq/frontend/aqctl_corelog.py b/artiq/frontend/aqctl_corelog.py index c86c276d5..ca0827585 100755 --- a/artiq/frontend/aqctl_corelog.py +++ b/artiq/frontend/aqctl_corelog.py @@ -76,7 +76,8 @@ def main(): args = get_argparser().parse_args() common_args.init_logger_from_args(args) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: signal_handler = SignalHandler() signal_handler.setup() diff --git a/artiq/frontend/aqctl_moninj_proxy.py b/artiq/frontend/aqctl_moninj_proxy.py index 5d7aca2a3..54d8d0833 100755 --- a/artiq/frontend/aqctl_moninj_proxy.py +++ b/artiq/frontend/aqctl_moninj_proxy.py @@ -196,7 +196,8 @@ def main(): bind_address = common_args.bind_address_from_args(args) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: signal_handler = SignalHandler() signal_handler.setup() diff --git a/artiq/frontend/artiq_client.py b/artiq/frontend/artiq_client.py index 993fe0ee4..8601fed77 100755 --- a/artiq/frontend/artiq_client.py +++ b/artiq/frontend/artiq_client.py @@ -245,7 +245,8 @@ def _show_datasets(datasets): def _run_subscriber(host, port, subscriber): - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: loop.run_until_complete(subscriber.connect(host, port)) try: diff --git a/artiq/frontend/artiq_master.py b/artiq/frontend/artiq_master.py index 2b8893d07..42a7a0a98 100755 --- a/artiq/frontend/artiq_master.py +++ b/artiq/frontend/artiq_master.py @@ -74,7 +74,8 @@ class MasterConfig: def main(): args = get_argparser().parse_args() log_forwarder = init_log(args) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) atexit.register(loop.close) signal_handler = SignalHandler() signal_handler.setup() diff --git a/artiq/frontend/artiq_rtiomon.py b/artiq/frontend/artiq_rtiomon.py index 8649f8d5f..653063ce1 100755 --- a/artiq/frontend/artiq_rtiomon.py +++ b/artiq/frontend/artiq_rtiomon.py @@ -21,7 +21,8 @@ def get_argparser(): def main(): args = get_argparser().parse_args() - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: signal_handler = SignalHandler() signal_handler.setup() diff --git a/artiq/gui/scanwidget.py b/artiq/gui/scanwidget.py index 20e161d97..e3231c6ab 100644 --- a/artiq/gui/scanwidget.py +++ b/artiq/gui/scanwidget.py @@ -49,7 +49,7 @@ class ScanWidget(QtWidgets.QWidget): return self.minimumSizeHint() def minimumSizeHint(self): - return QtCore.QSize(2.5*3*self._labelSize.width(), + return QtCore.QSize(int(2.5*3*self._labelSize.width()), 4*self._labelSize.height()) def _axisToPixel(self, val): @@ -214,7 +214,7 @@ class ScanWidget(QtWidgets.QWidget): self._setView(left, scale) def wheelEvent(self, ev): - y = ev.angleDelta().y()/120. + y = round(ev.angleDelta().y()/120.) if not y: return if ev.modifiers() & QtCore.Qt.ShiftModifier: @@ -252,22 +252,22 @@ class ScanWidget(QtWidgets.QWidget): for t, l in zip(ticks, labels): t = self._axisToPixel(t) - painter.drawText(t - len(l)/2*avgCharWidth, 0, l) - painter.drawLine(t, descent, t, lineSpacing/2) - painter.translate(0, lineSpacing/2) + painter.drawText(int(t - len(l)/2*avgCharWidth), 0, l) + painter.drawLine(int(t), descent, int(t), int(lineSpacing/2)) + painter.translate(0, int(lineSpacing/2)) painter.drawLine(0, 0, self.width(), 0) for p in np.linspace(self._axisToPixel(self._start), self._axisToPixel(self._stop), self._num): - painter.drawLine(p, 0, p, lineSpacing/2) - painter.translate(0, lineSpacing/2) + painter.drawLine(int(p), 0, int(p), int(lineSpacing/2)) + painter.translate(0, int(lineSpacing/2)) for x, c in (self._start, QtCore.Qt.blue), (self._stop, QtCore.Qt.red): x = self._axisToPixel(x) painter.setPen(c) painter.setBrush(c) painter.drawPolygon(*(QtCore.QPointF(*i) for i in [ - (x, 0), (x - lineSpacing/2, lineSpacing), - (x + lineSpacing/2, lineSpacing)])) + (int(x), 0), (int(x - lineSpacing/2), lineSpacing), + (int(x + lineSpacing/2), lineSpacing)])) diff --git a/artiq/gui/waitingspinnerwidget.py b/artiq/gui/waitingspinnerwidget.py index 6771bdbfe..6967e6dea 100644 --- a/artiq/gui/waitingspinnerwidget.py +++ b/artiq/gui/waitingspinnerwidget.py @@ -75,7 +75,7 @@ class QtWaitingSpinner(QWidget): color = self.currentLineColor(distance, self._numberOfLines, self._trailFadePercentage, self._minimumTrailOpacity, self._color) painter.setBrush(color) - painter.drawRoundedRect(QRect(0, -self._lineWidth / 2, self._lineLength, self._lineWidth), self._roundness, + painter.drawRoundedRect(QRect(0, int(-self._lineWidth / 2), self._lineLength, self._lineWidth), self._roundness, self._roundness, Qt.RelativeSize) painter.restore() @@ -160,7 +160,7 @@ class QtWaitingSpinner(QWidget): self.setFixedSize(self.size, self.size) def updateTimer(self): - self._timer.setInterval(1000 / (self._numberOfLines * self._revolutionsPerSecond)) + self._timer.setInterval(int(1000 / (self._numberOfLines * self._revolutionsPerSecond))) def lineCountDistanceFromPrimary(self, current, primary, totalNrOfLines): distance = primary - current diff --git a/artiq/test/coredevice/test_moninj.py b/artiq/test/coredevice/test_moninj.py index 83786a8a1..092f3f7d6 100644 --- a/artiq/test/coredevice/test_moninj.py +++ b/artiq/test/coredevice/test_moninj.py @@ -28,7 +28,8 @@ class MonInjTest(ExperimentCase): def injection_status_cb(channel, override, value): injection_statuses.append((channel, override, value)) - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: moninj_comm = CommMonInj(monitor_cb, injection_status_cb) loop.run_until_complete(moninj_comm.connect(core_host)) diff --git a/doc/manual/conf.py b/doc/manual/conf.py index d8278d61b..7ca6ada86 100644 --- a/doc/manual/conf.py +++ b/doc/manual/conf.py @@ -34,7 +34,8 @@ mock_modules = ["artiq.gui.waitingspinnerwidget", "nac3artiq", "sipyco", "sipyco.pc_rpc", "sipyco.sync_struct", "sipyco.asyncio_tools", "sipyco.logging_tools", - "sipyco.broadcast", "sipyco.packed_exceptions"] + "sipyco.broadcast", "sipyco.packed_exceptions", + "sipyco.keepalive"] for module in mock_modules: sys.modules[module] = Mock() @@ -305,3 +306,4 @@ texinfo_documents = [ # -- Options for sphinxcontrib-wavedrom ----------------------------------- offline_skin_js_path = '_static/default.js' offline_wavedrom_js_path = '_static/WaveDrom.js' +render_using_wavedrompy = True diff --git a/flake.nix b/flake.nix index 5e224581f..2fd7a59d0 100644 --- a/flake.nix +++ b/flake.nix @@ -275,7 +275,7 @@ sha256 = "sha256-ukZd3ajt0Sx3LByof4R80S31F5t1yo+L8QUADrMMm2A="; }; buildInputs = [ pkgs.python3Packages.setuptools_scm ]; - propagatedBuildInputs = [ pkgs.nodejs pkgs.nodePackages.wavedrom-cli ] ++ (with pkgs.python3Packages; [ wavedrom sphinx xcffib cairosvg ]); + propagatedBuildInputs = (with pkgs.python3Packages; [ wavedrom sphinx xcffib cairosvg ]); }; latex-artiq-manual = pkgs.texlive.combine { inherit (pkgs.texlive) @@ -371,6 +371,7 @@ artiq-comtools-msys2-pkg = packages.x86_64-w64-mingw32.artiq-comtools-pkg; artiq-msys2-pkg = packages.x86_64-w64-mingw32.artiq-pkg; msys2-repos = packages.x86_64-w64-mingw32.msys2-repos; + inherit (packages.x86_64-linux) artiq-manual-html artiq-manual-pdf; }; };