Skip to content

Commit

Permalink
np NANs -> np.nan, np minimal version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WardDeb committed Sep 25, 2024
1 parent bf29fae commit b8a4e4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deeptools/computeMatrixOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def cbindMatrices(hm, args):
# Add on additional NA initialized columns
ncol = hm.matrix.matrix.shape[1]
hm.matrix.matrix = np.hstack((hm.matrix.matrix, np.empty(hm2.matrix.matrix.shape)))
hm.matrix.matrix[:, ncol:] = np.NAN
hm.matrix.matrix[:, ncol:] = np.nan

# Update the values
for idx2, group in enumerate(hm2.parameters["group_labels"]):
Expand Down
2 changes: 1 addition & 1 deletion deeptools/heatmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def compute_sub_matrix_worker(self, chrom, start, end, score_file_list, paramete

# create an empty matrix to store the values
sub_matrix = np.zeros((len(regions), matrix_cols))
sub_matrix[:] = np.NAN
sub_matrix[:] = np.nan

j = 0
sub_regions = []
Expand Down
10 changes: 5 additions & 5 deletions deeptools/plotFingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ def getCHANCE(args, idx, mat):
"""
# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return [np.NAN, np.NAN, np.NAN]
return [np.nan, np.nan, np.nan]
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return [np.NAN, np.NAN, np.NAN]
return [np.nan, np.nan, np.nan]

subMatrix = np.copy(mat[:, [idx, refIdx]])
subMatrix[np.isnan(subMatrix)] = 0
Expand Down Expand Up @@ -272,10 +272,10 @@ def getJSD(args, idx, mat):

# Get the index of the reference sample
if args.JSDsample not in args.bamfiles:
return np.NAN
return np.nan
refIdx = args.bamfiles.index(args.JSDsample)
if refIdx == idx:
return np.NAN
return np.nan

# These will hold the coverage histograms
chip = np.zeros(MAXLEN, dtype=int)
Expand Down Expand Up @@ -339,7 +339,7 @@ def signalAndBinDist(x):

if abs(sum(PMFinput) - 1) > 0.01 or abs(sum(PMFchip) - 1) > 0.01:
sys.stderr.write("Warning: At least one PMF integral is significantly different from 1! The JSD will not be returned")
return np.NAN
return np.nan

# Compute the JSD from the PMFs
M = (PMFinput + PMFchip) / 2.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ authors = [
]
requires-python = ">=3.8"
dependencies = [
"numpy >= 1.9.0",
"numpy >= 2.0.0",
"scipy >= 0.17.0",
"matplotlib >= 3.5.0",
"pysam >= 0.14.0",
Expand Down

0 comments on commit b8a4e4a

Please sign in to comment.