Skip to content

Commit

Permalink
BUG: fix offset accumulation rules
Browse files Browse the repository at this point in the history
  • Loading branch information
andykee committed Dec 16, 2020
1 parent cd638c4 commit 1659da4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lentil/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,11 @@ class and any subclasses by reimplementing any of the following methods:
ofst = util.slice_offset(slc[seg], amplitude.shape)

# if wavefront.offset is empty, we will just append the offset for each slice as we go (even if offset is None)
if not wavefront.offset:
#if not wavefront.offset:
if ofst:
offset.append(ofst)
else:
offset.append(None)

# if len(wavefront.offset) == 1

Expand All @@ -614,11 +617,14 @@ class and any subclasses by reimplementing any of the following methods:
ofst = util.slice_offset(s, amplitude.shape)

# if wavefront.offset is empty, we will just append the offset for each slice as we go (even if offset is None)
if not wavefront.offset:
# if not wavefront.offset:
if ofst:
offset.append(ofst)
else:
offset.append(None)


if offset:
if not wavefront.offset or not all(wavefront.offset):
# of wavefront.offset is [] or a list of [None]:
wavefront.offset = offset

# TODO: verify this should really be extend and not append
Expand Down

0 comments on commit 1659da4

Please sign in to comment.