From a5b22aa11224de8e0a4135d4e3c696aa3a3329e5 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Fri, 26 Jul 2019 12:46:40 +0300 Subject: [PATCH] Denormalize infinity sig as special case, very much like 0 sig --- gui/builtinGraphs/base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gui/builtinGraphs/base.py b/gui/builtinGraphs/base.py index aa67dbedb..8fb9f6603 100644 --- a/gui/builtinGraphs/base.py +++ b/gui/builtinGraphs/base.py @@ -18,6 +18,7 @@ # ============================================================================= +import math from abc import ABCMeta, abstractmethod from collections import OrderedDict, namedtuple @@ -151,6 +152,11 @@ class FitGraph(metaclass=ABCMeta): ys = [ys[0], ys[0]] else: raise + # Same for NaN which means we tried to denormalize infinity values, which might be the + # case for the ideal target profile with infinite signature radius + if mainInput.unit == xSpec.unit == '%' and all(math.isnan(x) for x in xs): + xs = [min(mainInput.value), max(mainInput.value)] + ys = [ys[0], ys[0]] return xs, ys _normalizers = {} @@ -225,7 +231,7 @@ class FitGraph(metaclass=ABCMeta): rangeHigh = max(valRange) # Amount is amount of ranges between points here, not amount of points step = (rangeHigh - rangeLow) / segments - if step == 0: + if step == 0 or math.isnan(step): yield rangeLow else: current = rangeLow