Package: pyranges / 0.0.111+ds-4

numpy_1.24.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Description: Adapt to numpy 1.24
Bug-Debian: https://bugs.debian.org/1028852
Author: Andreas Tille <tille@debian.org>
Last-Update: Sat, 14 Jan 2023 16:30:10 +0100

--- a/tests/test_binary.py
+++ b/tests/test_binary.py
@@ -232,7 +232,7 @@ def test_coverage(gr, gr2, strandedness)
         names=
         "Chromosome Start End Name Score Strand NumberOverlaps FractionOverlaps"
         .split(),
-        dtype={"FractionOverlap": np.float},
+        dtype={"FractionOverlap": float},
         sep="\t")
 
     result = gr.coverage(gr2, strandedness=strandedness)
--- a/pyranges/pyranges.py
+++ b/pyranges/pyranges.py
@@ -1705,7 +1705,7 @@ class PyRanges():
         For printing, the PyRanges was sorted on Chromosome and Strand.
         """
 
-        subsetter = np.zeros(len(self), dtype=np.bool)
+        subsetter = np.zeros(len(self), dtype=bool)
         subsetter[:n] = True
         return self[subsetter]
 
@@ -3571,7 +3571,7 @@ class PyRanges():
         ValueError: Cannot take a larger sample than population when 'replace=False'
         """
         sample = np.random.choice(len(self), size=n, replace=False)
-        subsetter = np.zeros(len(self), dtype=np.bool)
+        subsetter = np.zeros(len(self), dtype=bool)
         subsetter[sample] = True
         return self[subsetter]
 
@@ -4533,7 +4533,7 @@ class PyRanges():
         For printing, the PyRanges was sorted on Chromosome and Strand.
         """
 
-        subsetter = np.zeros(len(self), dtype=np.bool)
+        subsetter = np.zeros(len(self), dtype=bool)
         subsetter[(len(self) - n):] = True
         return self[subsetter]
 
--- a/tests/hypothesis_helper.py
+++ b/tests/hypothesis_helper.py
@@ -269,7 +269,7 @@ def genomicfeature(draw):
     dataset = getattr(pr.data, dataset_name)()
     dataset = dataset[dataset.Feature.isin(["gene", "transcript", "exon"])]
 
-    # subsetter = draw(arrays(np.bool, shape=len(dataset)))
+    # subsetter = draw(arrays(bool, shape=len(dataset)))
     gene_ids = list(dataset.gene_id.drop_duplicates())
     genes = draw(
         st.lists(st.sampled_from(gene_ids), unique="True", min_size=1))