From 5798b36779c4d9c28d13fbf76a673350f44c168a Mon Sep 17 00:00:00 2001 From: xxao Date: Thu, 31 Mar 2022 20:07:01 +0200 Subject: [PATCH] Refactor --- perrot/series/profile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/perrot/series/profile.py b/perrot/series/profile.py index d9658b2..7c6b240 100644 --- a/perrot/series/profile.py +++ b/perrot/series/profile.py @@ -146,31 +146,31 @@ def __init__(self, **overrides): # extract data self.extract_data() - - + + def get_limits(self, x_range=None, y_range=None, exact=False): """Gets current data limits using whole range or specified crops.""" - + # check data if self._limits is None: return None - + # init limits limits = self._limits - + # apply crop if x_range: - + limits = utils.calc_limits_sorted( data=(self._x_data, self._y_data), crop=x_range, extend=False, interpolate=True) - + if self.base not in (UNDEF, None) and limits[1] is not None: limits[1][0] = min(self.base, limits[1][0]) limits[1][1] = max(self.base, limits[1][1]) - + # finalize limits return self.finalize_limits(limits, exact)