Skip to content

Commit

Permalink
0.0.57: accept lists and series in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
endrebak committed Oct 14, 2020
1 parent 5970b21 commit 44f77a3
Show file tree
Hide file tree
Showing 4 changed files with 1,864 additions and 1,445 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.0.57 (14.10.20)
- accept lists/pd.Series in constructor

# 0.0.55-56 (12.10.20)
- fix build on 32-bit architectures (thanks to nileshpatra)

Expand Down
6 changes: 6 additions & 0 deletions ncls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

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]]

if starts.dtype == np.int64:
return NCLS64(starts, ends, ids)
elif starts.dtype == np.int32:
Expand All @@ -17,6 +20,9 @@ def FNCLS(starts, ends, ids):

from ncls.src.fncls import FNCLS

if isinstance(starts, list) or "pandas" in str(type(starts)):
starts, ends, ids = [np.array(s) for s in [starts, ends, ids]]

if starts.dtype == np.double:
return FNCLS(starts, ends, ids)
else:
Expand Down
Loading

0 comments on commit 44f77a3

Please sign in to comment.