Skip to content

Commit

Permalink
Use x when looping over inputs in ND histogram.
Browse files Browse the repository at this point in the history
No change in code function.  This closes #8.
  • Loading branch information
pavoljuhas committed Dec 14, 2015
1 parent 96a1f25 commit bac0c02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skxray/core/accumulators/histogram.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class Histogram:


def _fillnd(self, coords, np.ndarray[wnumtype, ndim=1] weight):
# allocate pointer arrays per each supported numerical types
cdef np.int_t* aint_ptr[MAX_DIMENSIONS]
cdef int aint_stride[MAX_DIMENSIONS]
cdef int aint_count = 0
Expand All @@ -181,7 +182,7 @@ class Histogram:
# numerical data type
numtypes = [np.dtype(int), np.dtype(float)]
numtypeindex = {tp : i for i, tp in enumerate(numtypes)}
ctypeindices = [numtypeindex.get(c.dtype, 999) for c in coords]
ctypeindices = [numtypeindex.get(x.dtype, 999) for x in coords]
coordsorder = np.argsort(ctypeindices, kind='mergesort')
istrides = np.asarray(self._values.strides, dtype=np.int32)[coordsorder]
istrides //= self._values.itemsize
Expand Down

0 comments on commit bac0c02

Please sign in to comment.