[med-svn] [Git][med-team/python-ncls][master] 4 commits: New upstream version 0.0.56+ds

Nilesh Patra gitlab at salsa.debian.org
Tue Oct 13 07:31:45 BST 2020



Nilesh Patra pushed to branch master at Debian Med / python-ncls


Commits:
bc53e262 by Nilesh Patra at 2020-10-13T11:57:45+05:30
New upstream version 0.0.56+ds
- - - - -
93aa7ae7 by Nilesh Patra at 2020-10-13T11:57:46+05:30
Update upstream source from tag 'upstream/0.0.56+ds'

Update to upstream version '0.0.56+ds'
with Debian dir b38ed97e934aaec487214678230046ef9c3edf9d
- - - - -
f94bd011 by Nilesh Patra at 2020-10-13T11:58:06+05:30
Remove merged patch

- - - - -
c949065e by Nilesh Patra at 2020-10-13T11:58:56+05:30
New Upstream version

- - - - -


11 changed files:

- CHANGELOG
- debian/changelog
- − debian/patches/fix-for-32bit.patch
- − debian/patches/series
- ncls/src/cncls.pxd
- ncls/src/intervaldb.c
- ncls/src/intervaldb.h
- ncls/src/ncls.pyx
- ncls/version.py
- setup.py
- tests/test_ncls.py


Changes:

=====================================
CHANGELOG
=====================================
@@ -1,4 +1,10 @@
-# 0.0.53 (unreleased)
+# 0.0.55-56 (12.10.20)
+- fix build on 32-bit architectures (thanks to nileshpatra)
+
+# 0.0.54 (14.09.20)
+- fix #38 (thanks fireice-uk)
+
+# 0.0.53 (?)
 - add datastructure FNCLS which uses floating point starts and ends
 
 # 0.0.52 (20.02.20)


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+python-ncls (0.0.56+ds-1) UNRELEASED; urgency=medium
+
+  * New upstream version 0.0.56+ds
+
+ -- Nilesh Patra <npatra974 at gmail.com>  Tue, 13 Oct 2020 11:58:17 +0530
+
 python-ncls (0.0.53+ds-1) unstable; urgency=medium
 
   * Remove git mode - upstream has tagged its release


=====================================
debian/patches/fix-for-32bit.patch deleted
=====================================
@@ -1,86 +0,0 @@
---- a/tests/test_ncls.py
-+++ b/tests/test_ncls.py
-@@ -3,38 +3,32 @@
- 
- import numpy as np
- 
--starts = np.array([5, 9_223_372_036_854_775_805], dtype=np.long)
--
--ends = np.array([6, 9_223_372_036_854_775_807], dtype=np.long)
--
--ids = np.array([2147483647, 3], dtype=np.long)
--
- def test_ncls():
--    # ids = starts
- 
--    print(starts, ends, ids)
-+    starts = np.array([5, 9_223_100], dtype=np.int64)
-+    ends = np.array([6, 1_223_370_036], dtype=np.int64)
-+    ids = np.array([2147483, 1], dtype=np.int64)
- 
-     ncls = NCLS(starts, ends, ids)
-     print(ncls)
-     print(ncls.intervals())
- 
-     assert list(ncls.find_overlap(0, 2)) == []
--    print("aaa", list(ncls.find_overlap(9_223_372_036_854_775_805, 9_223_372_036_854_775_806)))
--    assert list(ncls.find_overlap(0, 9_223_372_036_854_775_806)) == [(5, 6, 2147483647), (9223372036854775805, 9223372036854775807, 3)]
-+    print("aaa", list(ncls.find_overlap(9_223_100, 1_223_370_036)))
-+    assert list(ncls.find_overlap(0, 1_223_370_036)) == [(5, 6, 2147483), (9223100, 1223370036, 1)]
- 
-     r, l = ncls.all_overlaps_both(starts, ends, ids)
--    assert list(r) == [2147483647, 3]
--    assert list(l) == [2147483647, 3]
-+    assert list(r) == [2147483, 1]
-+    assert list(l) == [2147483, 1]
- 
- def test_all_containments_both():
- 
--    starts = np.array([1291845632, 3002335232], dtype=int)
--    ends = np.array([1292894207, 3002597375], dtype=int)
--    ids = np.array([0, 1], dtype=int)
-+    starts = np.array([1291845632, 2002335232], dtype=np.int64)
-+    ends = np.array([1292894207, 2002597375], dtype=np.int64)
-+    ids = np.array([0, 1], dtype=np.int64)
- 
-     ncls = NCLS(starts, ends, ids)
-     subs, covers = ncls.all_containments_both(starts, ends, ids)
--
-     print(ncls.intervals())
- 
-     assert list(subs) == [0, 1] == list(covers)
---- a/ncls/src/ncls.pyx
-+++ b/ncls/src/ncls.pyx
-@@ -159,8 +159,8 @@
-         cdef int nfound = 0
-         cdef int max_end = -1
- 
--        output_arr = np.zeros(length, dtype=long)
--        output_arr_other = np.zeros(length, dtype=long)
-+        output_arr = np.zeros(length, dtype=np.long)
-+        output_arr_other = np.zeros(length, dtype=np.long)
-         cdef long [::1] output
-         cdef long [::1] output_other
- 
-@@ -590,8 +590,8 @@
- 
-         output_arr = np.zeros(length, dtype=np.long)
-         output_arr_other = np.zeros(length, dtype=np.long)
--        cdef int64_t [::1] output
--        cdef int64_t [::1] output_other
-+        cdef long [::1] output
-+        cdef long [::1] output_other
- 
-         output = output_arr
-         output_other = output_arr_other
-@@ -632,8 +632,8 @@
- 
-         output_arr = np.zeros(length, dtype=np.long)
-         output_arr_other = np.zeros(length, dtype=np.long)
--        cdef int64_t [::1] output
--        cdef int64_t [::1] output_other
-+        cdef long [::1] output
-+        cdef long [::1] output_other
- 
-         output = output_arr
-         output_other = output_arr_other


=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-fix-for-32bit.patch


=====================================
ncls/src/cncls.pxd
=====================================
@@ -52,8 +52,8 @@ cdef extern from "ncls/src/intervaldb.h":
         int start
         int len
 
-    int find_overlap_start(int64_t start, int64_t end, IntervalMap im[], int n)
-    int find_suboverlap_start(int64_t start, int64_t end, int isub, IntervalMap im[], SublistHeader subheader[])
+    int64_t find_overlap_start(int64_t start, int64_t end, IntervalMap im[], int n)
+    int64_t find_suboverlap_start(int64_t start, int64_t end, int isub, IntervalMap im[], SublistHeader subheader[])
     int imstart_qsort_cmp(void *void_a,void *void_b)
     IntervalMap *read_intervals(int n,FILE *ifile)
     SublistHeader *build_nested_list(IntervalMap im[],int n,int *p_n,int *p_nlists)


=====================================
ncls/src/intervaldb.c
=====================================
@@ -370,10 +370,10 @@ int find_index_start(int start,int end,IntervalIndex im[],int n)
 
 
 
-inline int find_suboverlap_start(int start,int end,int isub,IntervalMap im[],
+inline int64_t find_suboverlap_start(int64_t start, int64_t end, int isub, IntervalMap im[],
                                  SublistHeader subheader[])
 {
-  int i;
+  int64_t i;
 
   if (isub>=0) {
     i=find_overlap_start(start,end,im+subheader[isub].start,subheader[isub].len);


=====================================
ncls/src/intervaldb.h
=====================================
@@ -77,8 +77,8 @@ typedef struct {
 
 extern int *alloc_array(int n);
 
-extern int64_t find_overlap_start(int64_t start,int64_t end,IntervalMap im[],int n);
-extern int find_suboverlap_start(int start,int end,int isub,IntervalMap im[],SublistHeader subheader[]);
+extern int64_t find_overlap_start(int64_t start, int64_t end, IntervalMap im[],int n);
+extern int64_t find_suboverlap_start(int64_t start, int64_t end,int isub, IntervalMap im[], SublistHeader subheader[]);
 extern int imstart_qsort_cmp(const void *void_a,const void *void_b);
 extern int target_qsort_cmp(const void *void_a,const void *void_b);
 extern IntervalMap *read_intervals(int n,FILE *ifile);


=====================================
ncls/src/ncls.pyx
=====================================
@@ -150,7 +150,7 @@ cdef class NCLS64:
     @cython.boundscheck(False)
     @cython.wraparound(False)
     @cython.initializedcheck(False)
-    cpdef last_overlap_both(self, const int64_t [::1] starts, const int64_t [::1] ends, const long [::1] indexes):
+    cpdef last_overlap_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
@@ -159,10 +159,10 @@ cdef class NCLS64:
         cdef int nfound = 0
         cdef int max_end = -1
 
-        output_arr = np.zeros(length, dtype=long)
-        output_arr_other = np.zeros(length, dtype=long)
-        cdef long [::1] output
-        cdef long [::1] output_other
+        output_arr = np.zeros(length, dtype=np.int64)
+        output_arr_other = np.zeros(length, dtype=np.int64)
+        cdef int64_t [::1] output
+        cdef int64_t [::1] output_other
 
         output = output_arr
         output_other = output_arr_other
@@ -588,8 +588,8 @@ cdef class NCLS64:
         cdef int loop_counter = 0
         cdef int nfound = 0
 
-        output_arr = np.zeros(length, dtype=np.long)
-        output_arr_other = np.zeros(length, dtype=np.long)
+        output_arr = np.zeros(length, dtype=np.int64)
+        output_arr_other = np.zeros(length, dtype=np.int64)
         cdef int64_t [::1] output
         cdef int64_t [::1] output_other
 
@@ -630,8 +630,8 @@ cdef class NCLS64:
         cdef int nfound = 0
         cdef int64_t start, end
 
-        output_arr = np.zeros(length, dtype=np.long)
-        output_arr_other = np.zeros(length, dtype=np.long)
+        output_arr = np.zeros(length, dtype=np.int64)
+        output_arr_other = np.zeros(length, dtype=np.int64)
         cdef int64_t [::1] output
         cdef int64_t [::1] output_other
 
@@ -725,10 +725,10 @@ cdef class NCLSIterator:
     cdef cn.IntervalIterator *it_alloc
     cdef cn.IntervalMap im_buf[1024]
     cdef int nhit, ihit
-    cdef int64_t start, end 
+    cdef int64_t start, end
     cdef NCLS64 db
 
-    def __cinit__(self, long start, long end, NCLS64 db not None):
+    def __cinit__(self, int64_t start, int64_t end, NCLS64 db not None):
         self.it = cn.interval_iterator_alloc()
         self.it_alloc = self.it
         self.start = start


=====================================
ncls/version.py
=====================================
@@ -1 +1 @@
-__version__ = "0.0.53"
+__version__ = "0.0.56"


=====================================
setup.py
=====================================
@@ -1,5 +1,5 @@
-from distutils.core import setup
 from setuptools import find_packages, Extension, Command
+from distutils.core import setup
 
 
 # try:
@@ -94,4 +94,3 @@ setup(
     package_data={'': ['*.pyx', '*.pxd', '*.h', '*.c']},
     include_dirs=["."],
 )
-


=====================================
tests/test_ncls.py
=====================================
@@ -1,40 +1,81 @@
+import struct
 
 from ncls import NCLS
 
 import numpy as np
 
-starts = np.array([5, 9_223_372_036_854_775_805], dtype=np.long)
 
-ends = np.array([6, 9_223_372_036_854_775_807], dtype=np.long)
+import struct
+# 64 bit architecture?
+if struct.calcsize("P") * 8 == 64:
 
-ids = np.array([2147483647, 3], dtype=np.long)
+    starts = np.array([5, 9_223_372_036_854_775_805], dtype=np.int64)
 
-def test_ncls():
-    # ids = starts
+    ends = np.array([6, 9_223_372_036_854_775_807], dtype=np.int64)
 
-    print(starts, ends, ids)
+    ids = np.array([2147483647, 3], dtype=np.int64)
 
-    ncls = NCLS(starts, ends, ids)
-    print(ncls)
-    print(ncls.intervals())
+    def test_ncls():
+        # ids = starts
 
-    assert list(ncls.find_overlap(0, 2)) == []
-    print("aaa", list(ncls.find_overlap(9_223_372_036_854_775_805, 9_223_372_036_854_775_806)))
-    assert list(ncls.find_overlap(0, 9_223_372_036_854_775_806)) == [(5, 6, 2147483647), (9223372036854775805, 9223372036854775807, 3)]
+        print(starts, ends, ids)
 
-    r, l = ncls.all_overlaps_both(starts, ends, ids)
-    assert list(r) == [2147483647, 3]
-    assert list(l) == [2147483647, 3]
+        ncls = NCLS(starts, ends, ids)
+        print(ncls)
+        print(ncls.intervals())
 
-def test_all_containments_both():
+        assert list(ncls.find_overlap(0, 2)) == []
+        print("aaa", list(ncls.find_overlap(9_223_372_036_854_775_805, 9_223_372_036_854_775_806)))
+        assert list(ncls.find_overlap(0, 9_223_372_036_854_775_806)) == [(5, 6, 2147483647), (9223372036854775805, 9223372036854775807, 3)]
 
-    starts = np.array([1291845632, 3002335232], dtype=int)
-    ends = np.array([1292894207, 3002597375], dtype=int)
-    ids = np.array([0, 1], dtype=int)
+        r, l = ncls.all_overlaps_both(starts, ends, ids)
+        assert list(r) == [2147483647, 3]
+        assert list(l) == [2147483647, 3]
 
-    ncls = NCLS(starts, ends, ids)
-    subs, covers = ncls.all_containments_both(starts, ends, ids)
+    def test_all_containments_both():
 
-    print(ncls.intervals())
+        starts = np.array([1291845632, 3002335232], dtype=np.int64)
+        ends = np.array([1292894207, 3002597375], dtype=np.int64)
+        ids = np.array([0, 1], dtype=np.int64)
 
-    assert list(subs) == [0, 1] == list(covers)
+        ncls = NCLS(starts, ends, ids)
+        subs, covers = ncls.all_containments_both(starts, ends, ids)
+
+        print(ncls.intervals())
+
+        assert list(subs) == [0, 1] == list(covers)
+
+else:
+
+    starts = np.array([5, 2_147_483_645], dtype=np.int64)
+    ends = np.array([6, 2_147_483_646], dtype=np.int64)
+    ids = np.array([0, 3], dtype=np.int64)
+
+    def test_ncls():
+        # ids = starts
+
+        print(starts, ends, ids)
+
+        ncls = NCLS(starts, ends, ids)
+        print(ncls)
+        print(ncls.intervals())
+
+        assert list(ncls.find_overlap(0, 2)) == []
+        assert list(ncls.find_overlap(0, 2_147_483_647)) == [(5, 6, 0), (2_147_483_645, 2_147_483_646, 3)]
+
+        r, l = ncls.all_overlaps_both(starts, ends, ids)
+        assert list(r) == [0, 3]
+        assert list(l) == [0, 3]
+
+    def test_all_containments_both():
+
+        starts = np.array([5, 10], dtype=np.int64)
+        ends = np.array([6, 50], dtype=np.int64)
+        ids = np.array([0, 1], dtype=np.int64)
+
+        ncls = NCLS(starts, ends, ids)
+        subs, covers = ncls.all_containments_both(starts, ends, ids)
+
+        print(ncls.intervals())
+
+        assert list(subs) == [0, 1] == list(covers)



View it on GitLab: https://salsa.debian.org/med-team/python-ncls/-/compare/4d64cecce52e7b5d3976b760074e7c10142cd001...c949065ef3620e85dfb410a023e80d995cca62e9

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-ncls/-/compare/4d64cecce52e7b5d3976b760074e7c10142cd001...c949065ef3620e85dfb410a023e80d995cca62e9
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201013/6ecf6002/attachment-0001.html>


More information about the debian-med-commit mailing list