Nilesh Patra pushed to branch master at Debian Med / python-ncls
Commits: 4d64cecc by Nilesh Patra at 2020-10-10T21:24:54+05:30 Fix for building and passing tests for 32-bit archs Waiting for upstream's action with respect to https://github.com/biocore-ntnu/ncls/pull/39 - - - - - 2 changed files: - + debian/patches/fix-for-32bit.patch - + debian/patches/series Changes: ===================================== debian/patches/fix-for-32bit.patch ===================================== @@ -0,0 +1,86 @@ +--- 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 ===================================== @@ -0,0 +1 @@ +fix-for-32bit.patch View it on GitLab: https://salsa.debian.org/med-team/python-ncls/-/commit/4d64cecce52e7b5d3976b760074e7c10142cd001 -- View it on GitLab: https://salsa.debian.org/med-team/python-ncls/-/commit/4d64cecce52e7b5d3976b760074e7c10142cd001 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
