Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xxao committed Mar 31, 2022
1 parent ef71e4c commit 5798b36
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions perrot/series/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5798b36

Please sign in to comment.