Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 29, 2022
1 parent d1f1837 commit 623248b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions specreduce/tests/test_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from specreduce.tracing import FlatTrace


# NOTE: same test image as in test_extract.py
# Test image is comprised of 30 rows with 10 columns each. Row content
# is row index itself. This makes it easy to predict what should be the
# value extracted from a region centered at any arbitrary Y position.
Expand Down
6 changes: 4 additions & 2 deletions specreduce/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ def _bound_trace(self):

def __add__(self, delta):
"""
Return a copy of the trace shifted by delta pixels perpendicular to the axis being traced
Return a copy of the trace shifted "forward" by delta pixels perpendicular to the axis
being traced
"""
copy = deepcopy(self)
copy.shift(delta)
return copy

def __sub__(self, delta):
"""
Return a copy of the trace shifted by delta pixels perpendicular to the axis being traced
Return a copy of the trace shifted "backward" by delta pixels perpendicular to the axis
being traced
"""
return self.__add__(-delta)

Expand Down

0 comments on commit 623248b

Please sign in to comment.