[med-svn] [Git][med-team/fitgcp][master] 6 commits: Use 2to3 to port to Python3

Andreas Tille gitlab at salsa.debian.org
Tue Sep 10 09:29:59 BST 2019



Andreas Tille pushed to branch master at Debian Med / fitgcp


Commits:
9cb24d55 by Andreas Tille at 2019-09-10T06:56:59Z
Use 2to3 to port to Python3

- - - - -
9060f655 by Andreas Tille at 2019-09-10T06:57:40Z
Switch Build system to Python3

- - - - -
4a05c6df by Andreas Tille at 2019-09-10T06:58:04Z
debhelper-compat 12

- - - - -
88f0db3e by Andreas Tille at 2019-09-10T06:58:06Z
Standards-Version: 4.4.0

- - - - -
dd371b68 by Andreas Tille at 2019-09-10T06:58:07Z
Secure URI in copyright format

- - - - -
0dd63d0d by Andreas Tille at 2019-09-10T06:59:16Z
Upload to unstable

- - - - -


7 changed files:

- debian/changelog
- − debian/compat
- debian/control
- debian/copyright
- + debian/patches/2to3.patch
- + debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+fitgcp (0.0.20150429-3) unstable; urgency=medium
+
+  * Use 2to3 to port to Python3
+    Closes: #936518
+  * debhelper-compat 12
+  * Standards-Version: 4.4.0
+  * Secure URI in copyright format
+
+ -- Andreas Tille <tille at debian.org>  Tue, 10 Sep 2019 08:58:14 +0200
+
 fitgcp (0.0.20150429-2) unstable; urgency=medium
 
   * debhelper 11


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-11


=====================================
debian/control
=====================================
@@ -3,11 +3,11 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
 Uploaders: Andreas Tille <tille at debian.org>
 Section: science
 Priority: optional
-Build-Depends: debhelper (>= 11~),
+Build-Depends: debhelper-compat (= 12),
                dh-python,
-               python,
-               python-pysam
-Standards-Version: 4.2.0
+               python3,
+               python3-pysam
+Standards-Version: 4.4.0
 Vcs-Browser: https://salsa.debian.org/med-team/fitgcp
 Vcs-Git: https://salsa.debian.org/med-team/fitgcp.git
 Homepage: http://sourceforge.net/projects/fitgcp/
@@ -16,10 +16,10 @@ Package: fitgcp
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         ${python:Depends},
-         python-scipy,
-         python-numpy,
-         python-pysam
+         ${python3:Depends},
+         python3-scipy,
+         python3-numpy,
+         python3-pysam
 Description: fitting genome coverage distributions with mixture models
  Genome coverage, the number of sequencing reads mapped to a position in
  a genome, is an insightful indicator of irregularities within sequencing


=====================================
debian/copyright
=====================================
@@ -1,4 +1,4 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: fitGCP
 Upstream-Contact: Martin S. Lindner <LindnerM at rki.de>
 Source: http://sourceforge.net/projects/fitgcp/files/


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,154 @@
+Description: Use 2to3 to port to Python3
+Bug-Debian: https://bugs.debian.org/936518
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Tue, 10 Sep 2019 08:55:27 +0200
+
+--- a/README.txt
++++ b/README.txt
+@@ -1,4 +1,4 @@
+-Help on python script fitGCP.py
++Help on python3 script fitGCP.py
+ 
+ Fits mixtures of probability distributions to genome coverage profiles using an
+ EM-like iterative algorithm.
+@@ -25,7 +25,7 @@ USAGE:
+ fitGCP runs on the command line. The following command describes the general
+ structure:
+ 
+-python fitGCP.py [options] NAME
++python3 fitGCP.py [options] NAME
+ 
+ fitGCP fits mixtures of probability distributions to genome coverage profiles using
+ an EM-like iterative algorithm.
+@@ -76,4 +76,4 @@ Options:
+                         distributions.
+   -l, --log             Enable logging. Default: False
+   --view                Only view the GCP. Do not fit any distribution.
+-                        Respects cutoff (-c). Default: False
+\ No newline at end of file
++                        Respects cutoff (-c). Default: False
+--- a/fitGCP.py
++++ b/fitGCP.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+ """
+ Created on Fri Aug 31 2012 14:05
+ 
+@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
+ usage = """
+ %prog [options] NAME
+ 
+-Help on python script fitGCP.py
++Help on python3 script fitGCP.py
+ 
+ Fits mixtures of probability distributions to genome coverage profiles using an
+ EM-like iterative algorithm.
+@@ -60,7 +60,7 @@ import sys
+ import os
+ from collections import namedtuple
+ import time
+-import cPickle
++import pickle
+ from optparse import OptionParser
+ from scipy.special import digamma, betainc
+ from scipy.optimize import newton
+@@ -136,7 +136,7 @@ class NBinom(Distribution):
+ 
+ 		if self._use_MOM:
+ 			if var < mean:
+-				print "Warning: var < mean"
++				print("Warning: var < mean")
+ 				var = 1.01*mean
+ 			self._p1 = mean**2 / (var - mean)
+ 			self._p2 = mean / var
+@@ -154,9 +154,9 @@ class NBinom(Distribution):
+ 								  maxiter=10000)
+ 				self._p2 = (self._p1)/(self._p1+mean)
+ 			except:
+-				print "Warning: MLE for negative binomial failed. Using MOM."
++				print("Warning: MLE for negative binomial failed. Using MOM.")
+ 				if var < mean:
+-					print "Warning: var < mean"
++					print("Warning: var < mean")
+ 					var = 1.01*mean
+ 				self._p1 = mean**2 / (var - mean)
+ 				self._p2 = mean / var
+@@ -216,7 +216,7 @@ class NbTail(TailDistribution):
+ 		if isinstance(nbinom, NBinom):
+ 			self._parent = nbinom
+ 		else:
+-			raise(Exception("NbTail must be connected to a NBinom object"))
++			raise Exception
+ 	
+ 	def pmf(self, x):
+ 		if np.isscalar(x) and x == 0:
+@@ -253,7 +253,7 @@ class PoissonTail(TailDistribution):
+ 		if isinstance(poisson, Poisson):
+ 			self._parent = poisson
+ 		else:
+-			raise(Exception("PoissonTail must be connected to a Poisson object"))
++			raise Exception
+ 	
+ 	def pmf(self, x):
+ 		if self._p1 < 1.:
+@@ -338,7 +338,7 @@ class DataSet:
+ 	
+ 	def read_from_pickle(self,filename):
+ 		""" read a genome coverage profile from a pickle file. """
+-		data = cPickle.load(open(filename,'r'))
++		data = pickle.load(open(filename,'r'))
+ 
+ 		self.cov = np.array(data[0],dtype=np.int)
+ 		self.count = np.array(data[1],dtype=np.int)
+@@ -375,7 +375,7 @@ class DataSet:
+ 	
+ 	def write_to_pickle(self, filename):
+ 		""" store dataset in a pickle file. """
+-		return cPickle.dump([self.cov, self.count, self.rlen, self.rds,
++		return pickle.dump([self.cov, self.count, self.rlen, self.rds,
+ 							 self.glen, self.fname], open(filename,'w'))
+ 	
+ 
+@@ -471,7 +471,7 @@ class Logger:
+ 	def log(self, s, c=True):
+ 		""" write string s to log file and print to console (if c) """
+ 		if c:
+-			print s
++			print(s)
+ 		if self.log_file:
+ 			self.log_file.write(s+'\n')
+ 
+@@ -585,7 +585,7 @@ if __name__ == "__main__":
+ 	# load data
+ 	DS = DataSet()
+ 	if os.path.exists(name+'.pcl'):
+-		print 'found pickle file'
++		print('found pickle file')
+ 		DS.read_from_pickle(name+'.pcl')
+ 	else:
+ 		DS.read_from_sam(name+'.sam')
+@@ -617,7 +617,7 @@ if __name__ == "__main__":
+ 		# create empty mixture model
+ 		MM = np.array([])
+ 		create_plot(DS,MM,name+'.png')
+-		print "Wrote GCP plot to file %s."%(name+'.png')
++		print("Wrote GCP plot to file %s."%(name+'.png'))
+ 		sys.exit(0)
+ 
+ 
+@@ -710,7 +710,7 @@ if __name__ == "__main__":
+ 	# run the iteration, repeatedly update the variables MM and GAMMA
+ 	t_start = time.time()
+ 	for i,change,diff in iterative_fitting(DS, MM, GAMMA, options.steps):	
+-		print i
++		print(i)
+ 		t_step = time.time() - t_start
+ 		lg.log(('step#: '+str(i+1)).ljust(20)+'time: '+str(round(t_step,1))+'s'
+ 			   +'\n',False)
+@@ -792,4 +792,4 @@ if __name__ == "__main__":
+ 	if plot:
+ 		create_plot(DS,MM,name+'_'+options.dist+'.png')
+ 
+-	print "\nFinished."
++	print("\nFinished.")


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+2to3.patch


=====================================
debian/rules
=====================================
@@ -3,7 +3,7 @@
 # DH_VERBOSE := 1
 
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_fixperms:
 	dh_fixperms



View it on GitLab: https://salsa.debian.org/med-team/fitgcp/compare/0fc0368e04b9adda48dc4cbb3f40873cfc8c91ce...0dd63d0d91fce2e7afc75ef3acd899bbfd8ee847

-- 
View it on GitLab: https://salsa.debian.org/med-team/fitgcp/compare/0fc0368e04b9adda48dc4cbb3f40873cfc8c91ce...0dd63d0d91fce2e7afc75ef3acd899bbfd8ee847
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190910/3096e435/attachment-0001.html>


More information about the debian-med-commit mailing list