assert that log scale is finite

This commit is contained in:
Dominik Demuth 2023-08-01 18:00:23 +02:00
parent a5216b1eed
commit 0eca306ebe

View File

@ -4,7 +4,7 @@ import itertools
import os import os
import uuid import uuid
from math import isnan from math import isfinite
from pathlib import Path from pathlib import Path
import numpy as np import numpy as np
@ -493,9 +493,9 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
with errstate(all='ignore'): with errstate(all='ignore'):
xy = [log10(val) for val in xy] xy = [log10(val) for val in xy]
if isnan(xy[1]): if not isfinite(xy[1]):
xy = [-1, 1] xy = [-1, 1]
elif isnan(xy[0]): elif not isfinite(xy[0]):
xy[0] = xy[1]-4 xy[0] = xy[1]-4
func(xy[0], xy[1], padding=0) func(xy[0], xy[1], padding=0)