Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 29 Dec 2022 11:21:48 +0100
Bug-Debian: https://bugs.debian.org/1027199
Description: Fix AttributeError: module 'numpy' has no attribute 'int'. Did you mean: 'inf'?
 with numpy/1.24.1
 
--- a/fitGCP.py
+++ b/fitGCP.py
@@ -114,7 +114,7 @@ class Zero(Distribution):
 
 	def pmf(self,x):
 		if isinstance(x,np.ndarray):
-			return (x==0).astype(np.float)
+			return (x==0).astype(float)
 		else:
 			return float(x==0)
 
@@ -265,7 +265,7 @@ class PoissonTail(TailDistribution):
 			return 0.
 
 		xmax = int(max(np.max(x),5,stats.poisson.ppf(0.999999,self._p1)))+1
-		xs = np.arange(0,xmax, dtype=np.float)
+		xs = np.arange(0,xmax, dtype=float)
 		#backward cumulative sum
 		tx = np.cumsum((stats.poisson.pmf(xs, self._p1)/xs)[::-1])[::-1]
 		tx[0] = 0
@@ -330,8 +330,8 @@ def init_gamma(mixture_model, dataset):
 
 class DataSet:
 	fname = ""                        # path to original SAM file
-	cov = np.array([],dtype=np.int)   # observed coverage values
-	count = np.array([],dtype=np.int) # number of observations for each cov
+	cov = np.array([],dtype=int)   # observed coverage values
+	count = np.array([],dtype=int) # number of observations for each cov
 	rlen = 0                          # average read length of mapped reads
 	rds = 0                           # total number of reads
 	glen = 0                          # length of the genome
@@ -340,8 +340,8 @@ class DataSet:
 		""" read a genome coverage profile from a pickle file. """
 		data = pickle.load(open(filename,'rb'))
 
-		self.cov = np.array(data[0],dtype=np.int)
-		self.count = np.array(data[1],dtype=np.int)
+		self.cov = np.array(data[0],dtype=int)
+		self.count = np.array(data[1],dtype=int)
 		self.rlen = data[2]
 		self.rds = data[3]
 		self.glen = data[4]
@@ -451,7 +451,7 @@ def iterative_fitting(data_set, mixture_
 			ref_pdf += dist.pmf(xs)*dist.alpha
 		
 		obs_pdf = np.zeros((int(np.max(data_set.cov))+1,))
-		obs_pdf[data_set.cov.astype(np.int)] = data_set.count/float(np.sum(data_set.count))
+		obs_pdf[data_set.cov.astype(int)] = data_set.count/float(np.sum(data_set.count))
 		max_cdf_diff = np.max(np.abs(np.cumsum(ref_pdf)-np.cumsum(obs_pdf)))
 
 		yield i, max_change, max_cdf_diff
@@ -604,7 +604,7 @@ if __name__ == "__main__":
 	DS.cov = DS.cov[np.where(DS.cov < cutoff)]
 	num_unique = len(DS.cov)
 	DS.glen = np.sum(DS.count)
-	mean_cov = np.sum(DS.cov*DS.count)/np.sum(DS.count).astype(np.float)
+	mean_cov = np.sum(DS.cov*DS.count)/np.sum(DS.count).astype(float)
 
 
 	# only view the GCP
