Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctests of QuasiSequenceOrder.py are broken #4

Open
MartinThoma opened this issue Mar 10, 2020 · 0 comments
Open

Doctests of QuasiSequenceOrder.py are broken #4

MartinThoma opened this issue Mar 10, 2020 · 0 comments

Comments

@MartinThoma
Copy link
Owner

How To Reproduce

pytest --doctest-modules propy/QuasiSequenceOrder.py

Error

_________________________________________________________________________________________________ [doctest] propy.QuasiSequenceOrder.GetQuasiSequenceOrder1 __________________________________________________________________________________________________
262 
263     Compute the first 20 quasi-sequence-order descriptors for a given protein
264     sequence.
265 
266     Examples
267     --------
268     >>> from propy.GetProteinFromUniprot import GetProteinSequence
269     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
270     >>> result = GetQuasiSequenceOrder1(protein)
UNEXPECTED EXCEPTION: KeyError('ML')
Traceback (most recent call last):

  File "/home/moose/.pyenv/versions/3.8.1/lib/python3.8/doctest.py", line 1329, in __run
    exec(compile(example.source, filename, "single",

  File "<doctest propy.QuasiSequenceOrder.GetQuasiSequenceOrder1[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 278, in GetQuasiSequenceOrder1
    rightpart = rightpart + GetSequenceOrderCouplingNumber(

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 79, in GetSequenceOrderCouplingNumber
    tau = tau + math.pow(distancematrix[temp1 + temp2], 2)

KeyError: 'ML'

/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py:270: UnexpectedException
_________________________________________________________________________________________________ [doctest] propy.QuasiSequenceOrder.GetQuasiSequenceOrder2 __________________________________________________________________________________________________
291 
292     Compute the last maxlag quasi-sequence-order descriptors for a given
293     protein sequence.
294 
295     Examples
296     --------
297     >>> from propy.GetProteinFromUniprot import GetProteinSequence
298     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
299     >>> result = GetQuasiSequenceOrder2(protein)
UNEXPECTED EXCEPTION: KeyError('ML')
Traceback (most recent call last):

  File "/home/moose/.pyenv/versions/3.8.1/lib/python3.8/doctest.py", line 1329, in __run
    exec(compile(example.source, filename, "single",

  File "<doctest propy.QuasiSequenceOrder.GetQuasiSequenceOrder2[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 308, in GetQuasiSequenceOrder2
    GetSequenceOrderCouplingNumber(ProteinSequence, i + 1, distancematrix)

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 79, in GetSequenceOrderCouplingNumber
    tau = tau + math.pow(distancematrix[temp1 + temp2], 2)

KeyError: 'ML'

/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py:299: UnexpectedException
_________________________________________________________________________________________________ [doctest] propy.QuasiSequenceOrder.GetQuasiSequenceOrderp __________________________________________________________________________________________________
506 
507     Returns
508     -------
509     result is a dict form containing all quasi-sequence-order descriptors
510 
511     Examples
512     --------
513     >>> from propy.GetProteinFromUniprot import GetProteinSequence
514     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
515     >>> result = GetQuasiSequenceOrderp(protein)
UNEXPECTED EXCEPTION: KeyError('ML')
Traceback (most recent call last):

  File "/home/moose/.pyenv/versions/3.8.1/lib/python3.8/doctest.py", line 1329, in __run
    exec(compile(example.source, filename, "single",

  File "<doctest propy.QuasiSequenceOrder.GetQuasiSequenceOrderp[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 521, in GetQuasiSequenceOrderp
    GetQuasiSequenceOrder1(ProteinSequence, maxlag, weight, distancematrix)

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 278, in GetQuasiSequenceOrder1
    rightpart = rightpart + GetSequenceOrderCouplingNumber(

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 79, in GetSequenceOrderCouplingNumber
    tau = tau + math.pow(distancematrix[temp1 + temp2], 2)

KeyError: 'ML'

/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py:515: UnexpectedException
_____________________________________________________________________________________________ [doctest] propy.QuasiSequenceOrder.GetSequenceOrderCouplingNumberp _____________________________________________________________________________________________
099 
100     Returns
101     -------
102     a dict form containing all sequence order coupling numbers based on the given property
103 
104     Examples
105     --------
106     >>> from propy.GetProteinFromUniprot import GetProteinSequence
107     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
108     >>> result = GetSequenceOrderCouplingNumberp(protein)
UNEXPECTED EXCEPTION: KeyError('ML')
Traceback (most recent call last):

  File "/home/moose/.pyenv/versions/3.8.1/lib/python3.8/doctest.py", line 1329, in __run
    exec(compile(example.source, filename, "single",

  File "<doctest propy.QuasiSequenceOrder.GetSequenceOrderCouplingNumberp[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 116, in GetSequenceOrderCouplingNumberp
    Tau["tau" + str(i + 1)] = GetSequenceOrderCouplingNumber(

  File "/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py", line 79, in GetSequenceOrderCouplingNumber
    tau = tau + math.pow(distancematrix[temp1 + temp2], 2)

KeyError: 'ML'

/home/moose/GitHub/propy3/propy/QuasiSequenceOrder.py:108: UnexpectedException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant