Skip to content

Commit

Permalink
0.0.58
Browse files Browse the repository at this point in the history
  • Loading branch information
endre bakken stovner committed Jun 9, 2021
1 parent 44f77a3 commit 14ee35b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.0.58 (09.03.21)
- try to fix type mismatches and make causes more explicit

# 0.0.57 (14.10.20)
- accept lists/pd.Series in constructor

Expand Down
7 changes: 4 additions & 3 deletions ncls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ def NCLS(starts, ends, ids):
if isinstance(starts, list) or "pandas" in str(type(starts)):
starts, ends, ids = [np.array(s) for s in [starts, ends, ids]]

ids = np.astype(np.int64)
if starts.dtype == np.int64:
return NCLS64(starts, ends, ids)
return NCLS64(starts, ends.astype(np.int64), ids)
elif starts.dtype == np.int32:
return NCLS32(starts, ends, ids)
return NCLS32(starts, ends.astype(np.int32), ids)
else:
raise Exception("Starts/Ends not int64 or int32: " + str(starts.dtype))

Expand All @@ -24,7 +25,7 @@ def FNCLS(starts, ends, ids):
starts, ends, ids = [np.array(s) for s in [starts, ends, ids]]

if starts.dtype == np.double:
return FNCLS(starts, ends, ids)
return FNCLS(starts, ends.astype(np.double), ids)
else:
raise Exception("Starts/Ends not double: " + str(starts.dtype))

Expand Down
5 changes: 4 additions & 1 deletion ncls/src/ncls.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ cdef class NCLS64:
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.initializedcheck(False)
cpdef all_overlaps_both(self, const int64_t [::1] starts, const int64_t [::1] ends, const int64_t [::1] indexes):
cpdef all_overlaps_both(self,
const int64_t [::1] starts,
const int64_t [::1] ends,
const int64_t [::1] indexes):

cdef int i = 0
cdef int nhit = 0
Expand Down
5 changes: 4 additions & 1 deletion ncls/src/ncls32.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ cdef class NCLS32:
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.initializedcheck(False)
cpdef all_overlaps_both(self, const int32_t [::1] starts, const int32_t [::1] ends, const int64_t [::1] indexes):
cpdef all_overlaps_both(self,
const int32_t [::1] starts,
const int32_t [::1] ends,
const int64_t [::1] indexes):

cdef int i = 0
cdef int nhit = 0
Expand Down
2 changes: 1 addition & 1 deletion ncls/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.57"
__version__ = "0.0.58"

0 comments on commit 14ee35b

Please sign in to comment.