Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Aug 21, 2017
1 parent e64cb28 commit 367edfd
Show file tree
Hide file tree
Showing 3 changed files with 521 additions and 1 deletion.
15 changes: 15 additions & 0 deletions freud/kspace.pxi
Expand Up @@ -32,6 +32,11 @@ cdef class FTdelta:
self.thisptr.compute()
return self

@property
def FT(self):
"""Return the FT values"""
return self.getFT()

def getFT(self):
"""Return the FT values"""
cdef (float complex)* ft_points = self.thisptr.getFT().get()
Expand Down Expand Up @@ -111,6 +116,11 @@ cdef class FTsphere:
self.thisptr.compute()
return self

@property
def FT(self):
"""Return the FT values"""
return self.getFT()

def getFT(self):
"""Return the FT values"""
cdef (float complex)* ft_points = self.thisptr.getFT().get()
Expand Down Expand Up @@ -189,6 +199,11 @@ cdef class FTpolyhedron:
self.thisptr.compute()
return self

@property
def FT(self):
"""Return the FT values"""
return self.getFT()

def getFT(self):
"""Return the FT values"""
cdef (float complex)* ft_points = self.thisptr.getFT().get()
Expand Down
77 changes: 76 additions & 1 deletion freud/locality.pxi
Expand Up @@ -386,13 +386,29 @@ cdef class LinkCell:
def __dealloc__(self):
del self.thisptr

@property
def box(self):
"""
:return: Freud Box
:rtype: :py:class:`freud.box.Box`
"""
return self.getBox()

def getBox(self):
"""
:return: Freud Box
:rtype: :py:class:`freud.box.Box`
"""
return BoxFromCPP(self.thisptr.getBox())

@property
def num_cells(self):
"""
:return: the number of cells in this box
:rtype: unsigned int
"""
return self.getNumCells()

def getNumCells(self):
"""
:return: the number of cells in this box
Expand Down Expand Up @@ -548,27 +564,59 @@ cdef class NearestNeighbors:
def __dealloc__(self):
del self.thisptr

@property
def UINTMAX(self):
"""
:return: value of C++ UINTMAX used to pad the arrays
:rtype: unsigned int
"""
return self.getUINTMAX()

def getUINTMAX(self):
"""
:return: value of C++ UINTMAX used to pad the arrays
:rtype: unsigned int
"""
return self.thisptr.getUINTMAX()

@property
def box(self):
"""
:return: Freud Box
:rtype: :py:class:`freud.box.Box`
"""
return self.getBox()

def getBox(self):
"""
:return: Freud Box
:rtype: :py:class:`freud.box.Box`
"""
return BoxFromCPP(self.thisptr.getBox())

@property
def num_neighbors(self):
"""
:return: the number of neighbors this object will find
:rtype: unsigned int
"""
return self.getNumNeighbors()

def getNumNeighbors(self):
"""
:return: the number of neighbors this object will find
:rtype: unsigned int
"""
return self.thisptr.getNumNeighbors()

@property
def n_ref(self):
"""
:return: the number of particles this object found neighbors of
:rtype: unsigned int
"""
return self.getNRef()

def getNRef(self):
"""
:return: the number of particles this object found neighbors of
Expand Down Expand Up @@ -597,6 +645,14 @@ cdef class NearestNeighbors:
"""
self.thisptr.setCutMode(strict_cut)

@property
def r_max(self):
"""Return the current neighbor search distance guess
:return: nearest neighbors search radius
:rtype: float
"""
return self.getRMax()

def getRMax(self):
"""Return the current neighbor search distance guess
:return: nearest neighbors search radius
Expand Down Expand Up @@ -658,12 +714,21 @@ cdef class NearestNeighbors:
result[:len(rijs)] = np.sum(rijs**2, axis=-1)
return result

@property
def wrapped_vectors(self):
"""
Return the wrapped vectors for computed neighbors. Array padded with -1 for empty neighbors
:return: wrapped vectors
:rtype: :class:`numpy.ndarray`, shape= :math:`\\left(N_{particles}\\right)`, dtype= :class:`numpy.float32`
"""
return self.getWrappedVectors()

def getWrappedVectors(self):
"""
Return the wrapped vectors for computed neighbors. Array padded with -1 for empty neighbors
:return: wrapped vectors
:return: Neighbor List
:rtype: :class:`numpy.ndarray`, shape= :math:`\\left(N_{particles}\\right)`, dtype= :class:`numpy.float32`
"""
return self._getWrappedVectors()[0]
Expand All @@ -686,6 +751,16 @@ cdef class NearestNeighbors:
result[blank_mask] = -1
return result, blank_mask

@property
def r_sq_list(self):
"""
Return the entire Rsq values list
:return: Rsq list
:rtype: :class:`numpy.ndarray`, shape= :math:`\\left(N_{particles}, N_{neighbors}\\right)`, dtype= :class:`numpy.float32`
"""
return self.getRsqList()

def getRsqList(self):
"""
Return the entire Rsq values list
Expand Down

0 comments on commit 367edfd

Please sign in to comment.