Skip to content

Commit

Permalink
Merge pull request #46 from lldelisle/fix_new_numpy
Browse files Browse the repository at this point in the history
Release 17
  • Loading branch information
bgruening authored Jan 20, 2023
2 parents a945716 + bbe4470 commit 340de4b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down
15 changes: 9 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'

steps:
- bash: |
Expand Down Expand Up @@ -44,16 +46,17 @@ jobs:
- job: 'OSX'
timeoutInMinutes: 0
pool:
vmImage: 'macOS-10.14'
vmImage: 'macOS-11'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
Expand Down
2 changes: 1 addition & 1 deletion hicmatrix/HiCMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def keepOnlyTheseChr(self, chromosome_list):
size = self.matrix.shape
# initialize a 1D array containing the columns (and rows) to
# select. By default none are selected
sel = np.empty(size[0], dtype=np.bool)
sel = np.empty(size[0], dtype=bool)
sel[:] = False

for chrName in list(self.interval_trees):
Expand Down
2 changes: 1 addition & 1 deletion hicmatrix/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '16'
__version__ = '17'
# Version number differs from HiCExplorer!
14 changes: 7 additions & 7 deletions hicmatrix/lib/cool.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def load(self):
del _features

if self.matrixFormat is None or self.matrixFormat == 'csr':
matrix = csr_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
matrix = csr_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
elif self.matrixFormat == 'lil':
matrix = lil_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
matrix = lil_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
elif self.matrixFormat == 'dok':
matrix = dok_matrix((data, (instances, features)), shape=(np.int(cooler_file.info['nbins']), np.int(cooler_file.info['nbins'])), dtype=count_dtype)
matrix = dok_matrix((data, (instances, features)), shape=(int(cooler_file.info['nbins']), int(cooler_file.info['nbins'])), dtype=count_dtype)
# elif self.matrixFormat == 'raw':
# matrix = [instances, features, data, np.int(cooler_file.info['nbins'])]
# matrix = [instances, features, data, int(cooler_file.info['nbins'])]
del data
del instances
del features
Expand All @@ -116,7 +116,7 @@ def load(self):
data = matrixDataFrameChunk['count'].values.astype(count_dtype)
instances = matrixDataFrameChunk['bin1_id'].values.astype(used_dtype)
features = matrixDataFrameChunk['bin2_id'].values.astype(used_dtype)
# matrix = [_instances, _features, _data, np.int(cooler_file.info['nbins'])]
# matrix = [_instances, _features, _data, int(cooler_file.info['nbins'])]
# return matrix, None, None, None, None
else:
if len(self.chrnameList) == 1:
Expand Down Expand Up @@ -219,7 +219,7 @@ def load(self):
log.debug('div')
data /= instances_factors
log.debug('non')
return [instances, features, data, np.int(cooler_file.info['nbins'])], None, None, None, None
return [instances, features, data, int(cooler_file.info['nbins'])], None, None, None, None
else:
if self.correctionOperator == '*':
matrix.data *= instances_factors
Expand All @@ -229,7 +229,7 @@ def load(self):
log.debug('hu')

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

cut_intervals = []
if not self.noCutIntervals:
Expand Down
2 changes: 1 addition & 1 deletion hicmatrix/test/test_HiCMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def test_reorderChromosomes_fail():
false_chr_order = ['a', 'b', 'c']
with pytest.raises(Exception) as context:
hic.reorderChromosomes(false_chr_order)
assert("Chromosome name 'c' not found." in str(context.value))
assert "Chromosome name 'c' not found." in str(context.value)


def test_reorderBins():
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
numpy >= 1.16.*
numpy >= 1.20
scipy >= 1.2.*
pandas >= 0.25.*
pytables >= 3.5.*
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def checkProgramIsInstalled(self, program, args, where_to_download,
sys.stderr.write("Error: {}".format(e))


install_requires_py = ["numpy >= 1.16.*",
install_requires_py = ["numpy >= 1.20",
"scipy >= 1.2.*",
"tables >= 3.5.*",
"pandas >= 0.25.*",
Expand Down

0 comments on commit 340de4b

Please sign in to comment.