Skip to content

Commit 340de4b

Browse files
authored
Merge pull request #46 from lldelisle/fix_new_numpy
Release 17
2 parents a945716 + bbe4470 commit 340de4b

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dist/
1414
downloads/
1515
eggs/
1616
.eggs/
17-
lib/
1817
lib64/
1918
parts/
2019
sdist/

azure-pipelines.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ jobs:
99
vmImage: 'ubuntu-latest'
1010
strategy:
1111
matrix:
12-
Python36:
13-
python.version: '3.6'
1412
Python37:
1513
python.version: '3.7'
1614
Python38:
1715
python.version: '3.8'
16+
Python39:
17+
python.version: '3.9'
18+
Python310:
19+
python.version: '3.10'
1820

1921
steps:
2022
- bash: |
@@ -44,16 +46,17 @@ jobs:
4446
- job: 'OSX'
4547
timeoutInMinutes: 0
4648
pool:
47-
vmImage: 'macOS-10.14'
49+
vmImage: 'macOS-11'
4850
strategy:
4951
matrix:
50-
Python36:
51-
python.version: '3.6'
5252
Python37:
5353
python.version: '3.7'
5454
Python38:
5555
python.version: '3.8'
56-
56+
Python39:
57+
python.version: '3.9'
58+
Python310:
59+
python.version: '3.10'
5760
steps:
5861
- bash: |
5962
echo "##vso[task.prependpath]$CONDA/bin"

hicmatrix/HiCMatrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def keepOnlyTheseChr(self, chromosome_list):
628628
size = self.matrix.shape
629629
# initialize a 1D array containing the columns (and rows) to
630630
# select. By default none are selected
631-
sel = np.empty(size[0], dtype=np.bool)
631+
sel = np.empty(size[0], dtype=bool)
632632
sel[:] = False
633633

634634
for chrName in list(self.interval_trees):

hicmatrix/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = '16'
1+
__version__ = '17'
22
# Version number differs from HiCExplorer!

hicmatrix/lib/cool.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def load(self):
9494
del _features
9595

9696
if self.matrixFormat is None or self.matrixFormat == 'csr':
97-
matrix = csr_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
97+
matrix = csr_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
9898
elif self.matrixFormat == 'lil':
99-
matrix = lil_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
99+
matrix = lil_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
100100
elif self.matrixFormat == 'dok':
101-
matrix = dok_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
101+
matrix = dok_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
102102
# elif self.matrixFormat == 'raw':
103-
# matrix = [instances, features, data, np.int(cooler_file.info['nbins'])]
103+
# matrix = [instances, features, data, int(cooler_file.info['nbins'])]
104104
del data
105105
del instances
106106
del features
@@ -116,7 +116,7 @@ def load(self):
116116
data = matrixDataFrameChunk['count'].values.astype(count_dtype)
117117
instances = matrixDataFrameChunk['bin1_id'].values.astype(used_dtype)
118118
features = matrixDataFrameChunk['bin2_id'].values.astype(used_dtype)
119-
# matrix = [_instances, _features, _data, np.int(cooler_file.info['nbins'])]
119+
# matrix = [_instances, _features, _data, int(cooler_file.info['nbins'])]
120120
# return matrix, None, None, None, None
121121
else:
122122
if len(self.chrnameList) == 1:
@@ -219,7 +219,7 @@ def load(self):
219219
log.debug('div')
220220
data /= instances_factors
221221
log.debug('non')
222-
return [instances, features, data, np.int(cooler_file.info['nbins'])], None, None, None, None
222+
return [instances, features, data, int(cooler_file.info['nbins'])], None, None, None, None
223223
else:
224224
if self.correctionOperator == '*':
225225
matrix.data *= instances_factors
@@ -229,7 +229,7 @@ def load(self):
229229
log.debug('hu')
230230

231231
elif self.matrixOnly:
232-
return [instances, features, data, np.int(cooler_file.info['nbins'])], None, None, None, None
232+
return [instances, features, data, int(cooler_file.info['nbins'])], None, None, None, None
233233

234234
cut_intervals = []
235235
if not self.noCutIntervals:

hicmatrix/test/test_HiCMatrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def test_reorderChromosomes_fail():
561561
false_chr_order = ['a', 'b', 'c']
562562
with pytest.raises(Exception) as context:
563563
hic.reorderChromosomes(false_chr_order)
564-
assert("Chromosome name 'c' not found." in str(context.value))
564+
assert "Chromosome name 'c' not found." in str(context.value)
565565

566566

567567
def test_reorderBins():

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
numpy >= 1.16.*
1+
numpy >= 1.20
22
scipy >= 1.2.*
33
pandas >= 0.25.*
44
pytables >= 3.5.*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def checkProgramIsInstalled(self, program, args, where_to_download,
9393
sys.stderr.write("Error: {}".format(e))
9494

9595

96-
install_requires_py = ["numpy >= 1.16.*",
96+
install_requires_py = ["numpy >= 1.20",
9797
"scipy >= 1.2.*",
9898
"tables >= 3.5.*",
9999
"pandas >= 0.25.*",

0 commit comments

Comments
 (0)