[med-svn] [Git][med-team/ghmm][master] 2 commits: Fix Python3.12 string syntax
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sat Dec 7 11:04:37 GMT 2024
Andreas Tille pushed to branch master at Debian Med / ghmm
Commits:
ca32dc8a by Andreas Tille at 2024-12-07T11:59:34+01:00
Fix Python3.12 string syntax
- - - - -
f894e852 by Andreas Tille at 2024-12-07T12:01:58+01:00
routine-update: Ready to upload to unstable
- - - - -
3 changed files:
- debian/changelog
- + debian/patches/python3.12-syntax.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+ghmm (0.9~rc3-10) unstable; urgency=medium
+
+ * Team upload.
+ * Fix Python3.12 string syntax
+ Closes: #1085608
+
+ -- Andreas Tille <tille at debian.org> Sat, 07 Dec 2024 12:01:01 +0100
+
ghmm (0.9~rc3-9) unstable; urgency=medium
* d/control: setup.pys depend on python3-setuptools. (Closes: #1080603)
=====================================
debian/patches/python3.12-syntax.patch
=====================================
@@ -0,0 +1,119 @@
+Description: Fix Python3.12 string syntax
+Bug-Debian: https://bugs.debian.org/1085608
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2024-06-07
+
+--- a/ghmmwrapper/ghmm.py
++++ b/ghmmwrapper/ghmm.py
+@@ -287,7 +287,7 @@ class EmissionDomain(object):
+
+
+ def isAdmissable(self, emission):
+- """ Check whether \p emission is admissable (contained in) the domain
++ """ Check whether p emission is admissable (contained in) the domain
+ raises GHMMOutOfDomain else
+ """
+ return None
+@@ -1507,7 +1507,7 @@ class HMMOpenFactory(HMMFactory):
+ f = open(fileName,"r")
+
+ res = re.compile("^//")
+- stat = re.compile("^ACC\s+(\w+)")
++ stat = re.compile(r"^ACC\s+(\w+)")
+ for line in f.readlines():
+ string = string + line
+ m = stat.match(line)
+@@ -1533,11 +1533,11 @@ class HMMOpenFactory(HMMFactory):
+ #
+ file = open(fileName,'r')
+
+- hmmRe = re.compile("^HMM\s*=")
+- shmmRe = re.compile("^SHMM\s*=")
+- mvalueRe = re.compile("M\s*=\s*([0-9]+)")
+- densityvalueRe = re.compile("density\s*=\s*([0-9]+)")
+- cosvalueRe = re.compile("cos\s*=\s*([0-9]+)")
++ hmmRe = re.compile(r"^HMM\s*=")
++ shmmRe = re.compile(r"^SHMM\s*=")
++ mvalueRe = re.compile(r"M\s*=\s*([0-9]+)")
++ densityvalueRe = re.compile(r"density\s*=\s*([0-9]+)")
++ cosvalueRe = re.compile(r"cos\s*=\s*([0-9]+)")
+ emission_domain = None
+
+ while 1:
+@@ -2099,7 +2099,7 @@ class HMM(object):
+ @param emissionSequences can either be a SequenceSet or a EmissionSequence
+
+ @returns log( P[emissionSequences| model]) of type float which is
+- computed as \f$\sum_{s} log( P[s| model])\f$ when emissionSequences
++ computed as $sum_{s} log( P[s| model])$ when emissionSequences
+ is a SequenceSet
+
+ @note The implementation does not compute the full forward matrix since
+@@ -2375,7 +2375,7 @@ class HMM(object):
+
+ @param eseqs can either be a SequenceSet or an EmissionSequence
+
+- @returns [q_0, ..., q_T] the viterbi-path of \p eseqs is an
++ @returns [q_0, ..., q_T] the viterbi-path of p eseqs is an
+ EmmissionSequence object,
+ [[q_0^0, ..., q_T^0], ..., [q_0^k, ..., q_T^k]} for a k-sequence
+ SequenceSet
+@@ -2470,14 +2470,14 @@ class HMM(object):
+ return self.name2id[stateLabel]
+
+ def getInitial(self, i):
+- """ Accessor function for the initial probability \f$\pi_i\f$ """
++ """ Accessor function for the initial probability $pi_i$ """
+ state = self.cmodel.getState(i)
+ return state.pi
+
+ def setInitial(self, i, prob, fixProb=False):
+- """ Accessor function for the initial probability \f$\pi_i\f$.
++ """ Accessor function for the initial probability $pi_i$.
+
+- If 'fixProb' = True \f$\pi\f$ will be rescaled to 1 with 'pi[i]'
++ If 'fixProb' = True $pi$ will be rescaled to 1 with 'pi[i]'
+ fixed to the arguement value of 'prob'.
+
+ """
+@@ -3321,7 +3321,7 @@ class StateLabelHMM(DiscreteEmissionHMM)
+
+ def labeledlogikelihoods(self, emissionSequences):
+ """ Compute a vector ( log( P[s,l| model]) )_{s} of log-likelihoods of the
+- individual \p emissionSequences using the forward algorithm
++ individual p emissionSequences using the forward algorithm
+
+ @param emissionSequences SequenceSet
+
+--- a/ghmmwrapper/modhmmer.py
++++ b/ghmmwrapper/modhmmer.py
+@@ -189,10 +189,10 @@ class hmmer:
+ self.acc = self.acc[:-1]
+
+ #get number of match states
+- n = int(gotoLine(f,re.compile("^LENG\s*(\d+)")).group(1))
++ n = int(gotoLine(f,re.compile(r"^LENG\s*(\d+)")).group(1))
+ self.n = n
+ #get type of profile hmm: amino/nucleotide
+- m = self.dicType[gotoLine(f,re.compile("^ALPH\s*(\S+)")).group(1)];
++ m = self.dicType[gotoLine(f,re.compile(r"^ALPH\s*(\S+)")).group(1)];
+ self.m = m
+
+ #build matrix for transition: N B E J C T M1 I1 D1 M2 I2 D2 ... Mn In Dn
+@@ -202,13 +202,13 @@ class hmmer:
+ self.maems = [build_matrix(n,m),build_matrix(n,m),build_matrix(1,m)]
+
+ #get line "XT" transitions
+- trans = string.split(gotoLine(f,re.compile("^XT([\s\d\S]*)")).group(1))
++ trans = string.split(gotoLine(f,re.compile(r"^XT([\s\d\S]*)")).group(1))
+ self.set_matrix("XT",trans)
+
+ #null model
+- trans = string.split(gotoLine(f,re.compile("^NULT([\s\d\S]*)")).group(1))
++ trans = string.split(gotoLine(f,re.compile(r"^NULT([\s\d\S]*)")).group(1))
+ self.manull = [self.H2P(trans[0],1.0),self.H2P(trans[1],1.0)] #[G->G,G->F]
+- trans = string.split(gotoLine(f,re.compile("^NULE([\s\d\S]*)")).group(1))
++ trans = string.split(gotoLine(f,re.compile(r"^NULE([\s\d\S]*)")).group(1))
+ for k in range(len(trans)):
+ self.maems[2][0][k] = self.H2P(trans[k],1/float(m))
+
=====================================
debian/patches/series
=====================================
@@ -10,3 +10,4 @@ python3_syntax.patch
fix-test-mcmc.patch
python3.12.patch
gcc-14.patch
+python3.12-syntax.patch
View it on GitLab: https://salsa.debian.org/med-team/ghmm/-/compare/f7d99a741d6e2ffd5d8edb1dda6330a190dfdc24...f894e8521f797bf308a98ff73b3419af82ffe497
--
View it on GitLab: https://salsa.debian.org/med-team/ghmm/-/compare/f7d99a741d6e2ffd5d8edb1dda6330a190dfdc24...f894e8521f797bf308a98ff73b3419af82ffe497
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/20241207/3f4b0136/attachment-0001.htm>
More information about the debian-med-commit
mailing list