From 0eca306ebe4a248c8618288ca742639eb74b4f62 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Tue, 1 Aug 2023 18:00:23 +0200 Subject: [PATCH] assert that log scale is finite --- src/gui_qt/graphs/graphwindow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui_qt/graphs/graphwindow.py b/src/gui_qt/graphs/graphwindow.py index 61f318c..7796b81 100644 --- a/src/gui_qt/graphs/graphwindow.py +++ b/src/gui_qt/graphs/graphwindow.py @@ -4,7 +4,7 @@ import itertools import os import uuid -from math import isnan +from math import isfinite from pathlib import Path import numpy as np @@ -493,9 +493,9 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow): with errstate(all='ignore'): xy = [log10(val) for val in xy] - if isnan(xy[1]): + if not isfinite(xy[1]): xy = [-1, 1] - elif isnan(xy[0]): + elif not isfinite(xy[0]): xy[0] = xy[1]-4 func(xy[0], xy[1], padding=0)