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 PseudoAAC.py are broken #3

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

Doctests of PseudoAAC.py are broken #3

MartinThoma opened this issue Mar 10, 2020 · 0 comments

Comments

@MartinThoma
Copy link
Owner

How to reproduce

pytest --doctest-modules propy/PseudoAAC.py

Errors

______________________________________________________________________________________________________ [doctest] propy.PseudoAAC.GetCorrelationFunction ______________________________________________________________________________________________________
472     AAP : List[Any]
473         contains the properties, each of which is a dict form.
474 
475     Returns
476     -------
477     result is the correlation value between two amino acids.
478 
479     Examples
480     --------
481     >>> GetCorrelationFunction(Ri="S", Rj="D", AAP=_Hydrophobicity)
UNEXPECTED EXCEPTION: KeyError(0)
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.PseudoAAC.GetCorrelationFunction[0]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 488, in GetCorrelationFunction
    temp = NormalizeEachAAP(AAP[i])

KeyError: 0

/home/moose/GitHub/propy3/propy/PseudoAAC.py:481: UnexpectedException
___________________________________________________________________________________________________________ [doctest] propy.PseudoAAC.GetPseudoAAC ___________________________________________________________________________________________________________
597 
598     Returns
599     -------
600     result is a dict form containing calculated 20+lamda PAAC descriptors.
601 
602     Examples
603     --------
604     >>> from propy.GetProteinFromUniprot import GetProteinSequence
605     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
606     >>> result = GetPseudoAAC(protein)
UNEXPECTED EXCEPTION: ZeroDivisionError('float division by zero')
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.PseudoAAC.GetPseudoAAC[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 611, in GetPseudoAAC
    res.update(GetPseudoAAC1(ProteinSequence, lamda, weight, AAP))

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 539, in GetPseudoAAC1
    rightpart = rightpart + GetSequenceOrderCorrelationFactor(

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 525, in GetSequenceOrderCorrelationFactor
    res.append(GetCorrelationFunction(AA1, AA2, AAP))

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 490, in GetCorrelationFunction
    result = round(theta / NumAAP, 3)

ZeroDivisionError: float division by zero

/home/moose/GitHub/propy3/propy/PseudoAAC.py:606: UnexpectedException
________________________________________________________________________________________________ [doctest] propy.PseudoAAC.GetSequenceOrderCorrelationFactor _________________________________________________________________________________________________
507 
508     Returns
509     -------
510     result is the correlation factor value with the gap equal to k.
511 
512     Examples
513     --------
514     >>> from propy.GetProteinFromUniprot import GetProteinSequence
515     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
516     >>> result = GetSequenceOrderCorrelationFactor(protein)
UNEXPECTED EXCEPTION: ZeroDivisionError('float division by zero')
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.PseudoAAC.GetSequenceOrderCorrelationFactor[2]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 525, in GetSequenceOrderCorrelationFactor
    res.append(GetCorrelationFunction(AA1, AA2, AAP))

  File "/home/moose/GitHub/propy3/propy/PseudoAAC.py", line 490, in GetCorrelationFunction
    result = round(theta / NumAAP, 3)

ZeroDivisionError: float division by zero

/home/moose/GitHub/propy3/propy/PseudoAAC.py:516: UnexpectedException
@MartinThoma MartinThoma changed the title Doctests of Pseudo Doctests of PseudoAAC.py Mar 10, 2020
@MartinThoma MartinThoma changed the title Doctests of PseudoAAC.py Doctests of PseudoAAC.py are broken Mar 10, 2020
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