[med-svn] [Git][med-team/pdb2pqr][master] 3 commits: Deal with more Python3 errors
Andreas Tille
gitlab at salsa.debian.org
Fri Dec 13 16:20:00 GMT 2019
Andreas Tille pushed to branch master at Debian Med / pdb2pqr
Commits:
663301c9 by Andreas Tille at 2019-12-13T15:44:15Z
Deal with more Python3 errors
- - - - -
e68850cf by Andreas Tille at 2019-12-13T15:44:30Z
Fix installation of dynamic libraries
- - - - -
382cbb2c by Andreas Tille at 2019-12-13T16:19:39Z
More Python3 syntax errors
- - - - -
4 changed files:
- debian/patches/2to3.patch
- debian/pdb2pqr.install
- debian/pdb2pqr.links
- debian/rules
Changes:
=====================================
debian/patches/2to3.patch
=====================================
@@ -8632,6 +8632,17 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
sys.exit(2)
# Print the PQR file
+@@ -765,8 +765,8 @@ Please cite your use of PDB2PQR as:
+ size = psize.Psize()
+ size.parseInput(outpath)
+ size.runPsize(outpath)
+- async = 0 # No async files here!
+- input = inputgen.Input(outpath, size, method, async, potdx=True)
++ async_files = 0 # No async files here!
++ input = inputgen.Input(outpath, size, method, async_files, potdx=True)
+ input.printInputFiles()
+ input.dumpPickle()
+
--- a/main_cgi.py
+++ b/main_cgi.py
@@ -53,7 +53,7 @@ import time
@@ -8876,6 +8887,17 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
sys.exit()
else:
currentdir = os.getcwd()
+@@ -620,8 +620,8 @@ def handleNonOpal(weboptions):
+ size = psize.Psize()
+ size.parseInput(pqrpath)
+ size.runPsize(pqrpath)
+- async = 0 # No async files here!
+- myinput = inputgen.Input(pqrpath, size, method, async, potdx=True)
++ async_files = 0 # No async files here!
++ myinput = inputgen.Input(pqrpath, size, method, async_files, potdx=True)
+ myinput.printInputFiles()
+ myinput.dumpPickle()
+
@@ -646,10 +646,10 @@ def handleNonOpal(weboptions):
#TODO: Better error reporting.
@@ -8899,6 +8921,13 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
import cgi
import cgitb
+@@ -676,4 +676,4 @@ def mainCGI():
+ handleNonOpal(weboptions)
+
+ return
+-
+\ No newline at end of file
++
--- a/pdb2pka/NEWligand_topology.py
+++ b/pdb2pka/NEWligand_topology.py
@@ -7,13 +7,13 @@
@@ -9618,6 +9647,15 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
extent[axis]=minmax[axis][1]-minmax[axis][0]
center[axis]=extent[axis]/2.0+minmax[axis][0]
return center,extent
+@@ -138,7 +138,7 @@ class inputGen:
+ #
+ # Not a known type
+ #
+- raise 'unknown type',type
++ raise Exception('unknown type')
+ return
+
+ def getText_sub(self):
--- a/pdb2pka/ligand_topology.py
+++ b/pdb2pka/ligand_topology.py
@@ -9,7 +9,7 @@ except:
@@ -10013,7 +10051,7 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
else:
# Yes - nothing to do
pass
-@@ -378,7 +378,7 @@ class ligand_charge_handler(MOL2MOLECULE
+@@ -378,10 +378,10 @@ class ligand_charge_handler(MOL2MOLECULE
for at in residue.atoms: # WAS: self.lAtoms:
ele = at.sybylType.split('.')[0]
charge = at.charge
@@ -10021,7 +10059,11 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
+ if ele in ParseRadiiDict:
radius = ParseRadiiDict[ele]
else:
- raise 'Please check ParseRadiiDict in ligff.py -- radius data not found for',ele
+- raise 'Please check ParseRadiiDict in ligff.py -- radius data not found for',ele
++ raise Exception('Please check ParseRadiiDict in ligff.py -- radius data not found for %s' % ele)
+ #
+ # Store the radii and charges
+ #
--- a/pdb2pka/ligandclean/peoe_PDB2PQR.py
+++ b/pdb2pka/ligandclean/peoe_PDB2PQR.py
@@ -67,7 +67,7 @@ Chargeterms = {
@@ -10033,12 +10075,14 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
Chargeterms.update(ChargetermsLower)
def PEOE( atoms, damp=0.778, k=1.56):
-@@ -88,8 +88,8 @@ def PEOE( atoms, damp=0.778, k=1.56):
+@@ -87,9 +87,9 @@ def PEOE( atoms, damp=0.778, k=1.56):
+ abs_qges = 0.0
counter = 0
for a in atoms.atoms:
- sybylType = a.sybylType.lower()
+- sybylType = a.sybylType.lower()
- if not Chargeterms.has_key(sybylType):
- raise KeyError, 'PEOE Error: Atomtype <%s> not known, treating atom %s as dummy' % (a.sybylType, a.name)
++ sybylType = a.sybylType.lower()
+ if sybylType not in Chargeterms:
+ raise KeyError('PEOE Error: Atomtype <%s> not known, treating atom %s as dummy' % (a.sybylType, a.name))
if a.sybylType == 'O.3':
@@ -10055,7 +10099,7 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
class pKaIO:
-@@ -95,7 +95,7 @@ class pKaIO:
+@@ -95,10 +95,10 @@ class pKaIO:
filename=self.pkafile
import string
if not filename:
@@ -10063,7 +10107,20 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
+ print(filename,'is not a filename')
os._exit(0)
if not os.path.isfile(filename):
- raise 'File does not exist:',filename
+- raise 'File does not exist:',filename
++ raise Exception('File does not exist: %s' % filename)
+ fd=open(filename)
+ lines=fd.readlines()
+ fd.close()
+@@ -112,7 +112,7 @@ class pKaIO:
+ else:
+ raise ValueError('Unknown format')
+ if string.lower(string.strip(lines[1]))!=string.lower('Format 1.0'):
+- raise 'unknown format: ',lines[1]
++ raise Exception('unknown format: %s' % lines[1])
+ # Next line is text
+ linenumber=3
+ pKa={}
@@ -246,13 +246,13 @@ class pKaIO:
fd.write('%s pKa File\n' %format)
fd.write('Format 1.0\n')
@@ -10089,6 +10146,27 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
this_data=data[group]
fd.write('%15s %7.4f %7.4f %7.4f %7.4f %7.4f %7.4f \n' %(self.WI_res_text(group,format),
this_data['pKa'],
+@@ -295,7 +295,7 @@ class pKaIO:
+ filename=self.titcurvfile
+ import string
+ if not os.path.isfile(filename):
+- raise 'File does not exist:',filename
++ raise Exception('File does not exist: %s' % filename)
+ fd=open(filename)
+ lines=fd.readlines()
+ fd.close()
+@@ -307,9 +307,9 @@ class pKaIO:
+ elif string.lower(string.strip(lines[0]))==string.lower('pdb2pka Titration Curve File'):
+ format='pdb2pka'
+ else:
+- raise 'Unknown format'
++ raise Exception('Unknown format')
+ if string.lower(string.strip(lines[1]))!=string.lower('Format 1.0'):
+- raise 'unknown format: ',lines[1]
++ raise Exception('unknown format: %s' % lines[1])
+ phvals=string.split(lines[2])
+ phstart=string.atof(phvals[0])
+ phend=string.atof(phvals[1])
@@ -361,27 +361,27 @@ class pKaIO:
#
# Extract some data from the dictionary
@@ -10105,9 +10183,10 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
if newpHvals!=phvals:
- print phvals
- print newpHvals
+- raise 'Dictionary does not contain identical pH values'
+ print(phvals)
+ print(newpHvals)
- raise 'Dictionary does not contain identical pH values'
++ raise Exception('Dictionary does not contain identical pH values')
#
# Check that a pKa value is in the pH values
#
@@ -10140,6 +10219,41 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
newresiduekeys.sort()
residues = []
for k in newresiduekeys:
+@@ -439,11 +439,11 @@ class pKaIO:
+ if self.matrix_file:
+ filename=self.matrix_file
+ else:
+- raise 'No matrix filename given'
++ raise Exception('No matrix filename given')
+ #
+ import os, string
+ if not os.path.isfile(filename):
+- raise "File not found",filename
++ raise Exception("File not found %s" % filename)
+ fd=open(filename)
+ lines=fd.readlines()
+ fd.close()
+@@ -459,9 +459,9 @@ class pKaIO:
+ elif string.lower(string.strip(lines[0]))==string.lower('pdb2pka Interaction Matrix File'):
+ format='WHAT IF'
+ else:
+- raise 'Unknown format'
++ raise Exception('Unknown format')
+ if not string.strip(lines[1])=='Format 1.0':
+- raise 'Wrong format',lines[1]
++ raise Exception('Wrong format %s' % lines[1])
+ x=1
+ done=None
+ partners=None
+@@ -500,7 +500,7 @@ class pKaIO:
+ partners=np
+ else:
+ if partners!=np:
+- raise 'Number of partners changes:',np
++ raise Exception('Number of partners changes: %s' % np)
+ self.matrix[resid]={}
+ #
+ # Now read all the interactions with the partners
@@ -577,7 +577,7 @@ class pKaIO:
fd=open(filename,'w')
fd.write('%s Interaction Matrix File\n' %format)
@@ -10251,6 +10365,23 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
fd.write('%s %7.4f\n' %(self.WI_res_text('T'+group2,format),self.matrix[group]['T'+group2][0]))
fd.write('%7.4f\n%7.4f\n%7.4f\n'%(self.matrix[group]['T'+group2][1],self.matrix[group]['T'+group2][2],self.matrix[group]['T'+group2][3]))
written['T'+group2]=1
+@@ -706,14 +706,14 @@ class pKaIO:
+ if self.desolv_file:
+ filename=self.desolv_file
+ else:
+- raise 'No desolv filename given'
++ raise Exception('No desolv filename given')
+ #
+ #
+ # This subroutine reads a DESOLV file
+ #
+ import os, string
+ if not os.path.isfile(filename):
+- raise "File not found",filename
++ raise Exception("File not found %s" % filename)
+ fd=open(filename)
+ lines=fd.readlines()
+ fd.close()
@@ -729,7 +729,7 @@ class pKaIO:
elif string.strip(lines[0])=='pdb2pka Desolvation Energy File':
format='pdb2pka'
@@ -10260,6 +10391,20 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
#
# Call the generic read routine
#
+@@ -748,11 +748,11 @@ class pKaIO:
+ if self.backgr_file:
+ filename=self.backgr_file
+ else:
+- raise 'No matrix filename given'
++ raise Exception('No matrix filename given')
+ #
+ import os, string
+ if not os.path.isfile(filename):
+- raise "File not found",filename
++ raise Exception("File not found %s" % filename)
+ fd=open(filename)
+ lines=fd.readlines()
+ fd.close()
@@ -768,7 +768,7 @@ class pKaIO:
elif string.strip(lines[0])=='pdb2pka Background Energy File':
format='pdb2pka'
@@ -10558,9 +10703,12 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
#
# Create the APBS input file
#
-@@ -504,17 +504,17 @@ def pre_init(pdbfilename=None,
+@@ -502,19 +502,19 @@ def pre_init(pdbfilename=None,
+ size=src.psize.Psize()
+
method=""
- async=0
+- async=0
++ #async=0
split=0
- import inputgen_pKa
+ from . import inputgen_pKa
@@ -11433,6 +11581,15 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
#
# Create the APBS input file
#
+@@ -420,7 +420,7 @@ def pre_init(original_pdb_list=None,
+ size=src.psize.Psize()
+
+ method=""
+- async=0
++ #async=0
+ split=0
+
+ igen = inputgen_pKa.inputGen(working_pdb_filename)
@@ -428,11 +428,11 @@ def pre_init(original_pdb_list=None,
# For convenience
#
@@ -12853,7 +13010,7 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
-import Source.lib as lib
-from Source.protein import Protein
-+from . import Source.lib as lib
++from .Source import lib
+from .Source.protein import Protein
@@ -12874,8 +13031,8 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
-import Source.lib as lib
-from Source.protein import Protein
-from Source.mutate import makeCompositeAtomsDictionary
-+from . import Source.version as propka
-+from . import Source.lib as lib
++from .Source import version as propka
++from .Source import lib
+from .Source.protein import Protein
+from .Source.mutate import makeCompositeAtomsDictionary
@@ -12897,8 +13054,8 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
-import Source.lib as lib
-from Source.protein import Protein
-from Source.mutate import makeCompositeAtomsDictionary
-+from . import Source.version as propka
-+from . import Source.lib as lib
++from .Source import version as propka
++from .Source import lib
+from .Source.protein import Protein
+from .Source.mutate import makeCompositeAtomsDictionary
pka_print = lib.pka_print
@@ -12921,11 +13078,11 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
-from Source.protein import Protein
-from Source.pdb import readPDB
-import Source.version as propka
-+from . import Source.lib as lib
-+from . import Source.mutate as mutate
++from .Source import lib
++from .Source import mutate
+from .Source.protein import Protein
+from .Source.pdb import readPDB
-+from . import Source.version as propka
++from .Source import version as propka
pka_print = lib.pka_print
@@ -12943,7 +13100,7 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
-import Source.lib as lib
-from Source.protein import Protein
-+from . import Source.lib as lib
++from .Source import lib
+from .Source.protein import Protein
@@ -14023,6 +14180,33 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
class Elec:
"""
+@@ -102,7 +102,7 @@ class Elec:
+ self.label = ""
+ self.nlev = 4
+ self.ofrac = 0.1
+- self.async = 0
++ self.async_files = 0
+ self.asyncflag = asyncflag
+ self.cgcent = "mol 1"
+ self.fgcent = "mol 1"
+@@ -152,7 +152,7 @@ class Elec:
+ text += " cgcent %s\n" % self.cgcent
+ text += " fgcent %s\n" % self.fgcent
+ if self.asyncflag == 1:
+- text += " async %i\n" % self.async
++ text += " async %i\n" % self.async_files
+ text += " mol %i\n" % self.mol
+ if self.lpbe: text += " lpbe\n"
+ else: text += " npbe\n"
+@@ -261,7 +261,7 @@ class Input:
+ outname = base_pqr_name + "-PE%i.in" % i
+ for elec in self.elecs:
+ elec.asyncflag = 1
+- elec.async = i
++ elec.async_files = i
+ file = open(outname, "w")
+ file.write(str(self))
+ file.close()
@@ -368,7 +368,7 @@ def main():
try:
@@ -14032,6 +14216,33 @@ Last-Update: Thu, 12 Dec 2019 15:41:47 +0100
sys.stderr.write("Option error (%s)!\n" % details)
usage()
+@@ -380,7 +380,7 @@ def main():
+
+ method = ""
+ size = psize.Psize()
+- async = 0
++ async_files = 0
+ split = 0
+ istrng = 0
+ potdx = 0
+@@ -400,7 +400,7 @@ def main():
+ elif a == "async":
+ sys.stdout.write("Forcing an asynchronous calculation\n")
+ method = "mg-para"
+- async = 1
++ async_files = 1
+ elif a == "manual":
+ sys.stdout.write("Forcing a manual calculation\n")
+ method = "mg-manual"
+@@ -426,7 +426,7 @@ def main():
+ splitInput(filename)
+ else:
+ size.runPsize(filename)
+- input = Input(filename, size, method, async, istrng, potdx)
++ input = Input(filename, size, method, async_files, istrng, potdx)
+ input.printInputFiles()
+
+ if __name__ == "__main__": main()
--- a/src/na.py
+++ b/src/na.py
@@ -49,7 +49,7 @@ __date__ = "28 February 2006"
=====================================
debian/pdb2pqr.install
=====================================
@@ -11,5 +11,5 @@ pdb2pka/substruct/*.py usr/share/pdb2pqr/pdb2pka/substruct
pdb2pka/graph_cut/*.py usr/share/pdb2pqr/pdb2pka/graph_cut
propka30/* usr/share/pdb2pqr/propka30/
# Binary parts
-pdb2pka/_pMC_mult.so usr/lib/pdb2pqr/pdb2pka
-pdb2pka/substruct/Algorithms.so usr/lib/pdb2pqr/pdb2pka/substruct
+pdb2pka/_pMC_mult*.so usr/lib/pdb2pqr/pdb2pka
+pdb2pka/substruct/Algorithms*.so usr/lib/pdb2pqr/pdb2pka/substruct
=====================================
debian/pdb2pqr.links
=====================================
@@ -1,5 +1,5 @@
-usr/lib/pdb2pqr/pdb2pka/_pMC_mult.so usr/share/pdb2pqr/pdb2pka/_pMC_mult.so
-usr/lib/pdb2pqr/pdb2pka/substruct/Algorithms.so usr/share/pdb2pqr/pdb2pka/substruct/Algorithms.so
+#usr/lib/pdb2pqr/pdb2pka/_pMC_mult.so usr/share/pdb2pqr/pdb2pka/_pMC_mult.so
+#usr/lib/pdb2pqr/pdb2pka/substruct/Algorithms.so usr/share/pdb2pqr/pdb2pka/substruct/Algorithms.so
usr/share/pdb2pqr/pdb2pqr.py usr/bin/pdb2pqr
usr/share/pdb2pqr/propka30/propka.py usr/bin/propka
usr/share/pdb2pqr/src/psize.py usr/bin/psize
=====================================
debian/rules
=====================================
@@ -46,6 +46,11 @@ override_dh_install-arch:
dos2unix debian/pdb2pqr/usr/share/pdb2pqr/propka30/propka.py
dos2unix debian/pdb2pqr/usr/share/pdb2pqr/src/psize.py
+override_dh_link-arch:
+ dh_link -a
+ dh_link -a usr/lib/pdb2pqr/pdb2pka/$(shell basename `find . -name "_pMC_mult*.so"`) usr/share/pdb2pqr/pdb2pka/_pMC_mult.so
+ dh_link -a usr/lib/pdb2pqr/pdb2pka/substruct/$(shell basename `find . -name "Algorithms*.so"`) usr/share/pdb2pqr/pdb2pka/substruct/Algorithms.so
+
override_dh_fixperms-arch:
dh_fixperms -a
chmod 0644 debian/pdb2pqr/usr/share/pdb2pqr/main.py
View it on GitLab: https://salsa.debian.org/med-team/pdb2pqr/compare/1f4ee901456641140ef18ca8e91e4701e1175410...382cbb2cf752593a6a1315a40ac77c8c556f7a82
--
View it on GitLab: https://salsa.debian.org/med-team/pdb2pqr/compare/1f4ee901456641140ef18ca8e91e4701e1175410...382cbb2cf752593a6a1315a40ac77c8c556f7a82
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/20191213/b2530478/attachment-0001.html>
More information about the debian-med-commit
mailing list