Skip to content

Commit

Permalink
Include an additional periodicity corner case in YTPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Xarthisius committed Mar 5, 2018
1 parent 89f3906 commit c7e93e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yt/geometry/selection_routines.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ cdef class PointSelector(SelectorObject):

def __init__(self, dobj):
cdef np.float64_t[:] DLE = _ensure_code(dobj.ds.domain_left_edge)
cdef np.float64_t[:] DRE = _ensure_code(dobj.ds.domain_right_edge)
for i in range(3):
self.p[i] = _ensure_code(dobj.p[i])

Expand All @@ -651,6 +652,8 @@ cdef class PointSelector(SelectorObject):
self.p[i] = np.fmod(self.p[i], self.domain_width[i])
if self.p[i] < DLE[i]:
self.p[i] += self.domain_width[i]
elif self.p[i] >= DRE[i]:
self.p[i] -= self.domain_width[i]

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down

0 comments on commit c7e93e6

Please sign in to comment.