propy3 icon indicating copy to clipboard operation
propy3 copied to clipboard

Doctests of Autocorrelation.py are broken

Open MartinThoma opened this issue 5 years ago • 0 comments

How to reproduce

pytest --doctest-modules propy/Autocorrelation.py

Errors

_____________________________________________________________________________________________________ [doctest] propy.Autocorrelation.CalculateGearyAuto _____________________________________________________________________________________________________
383     -------
384     result contains 30*p Geary autocorrelation descriptors based on the given
385     properties.
386 
387     Examples
388     --------
389     >>> from propy.GetProteinFromUniprot import GetProteinSequence
390     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
391     >>> AAP, AAPName = _Hydrophobicity, "_Hydrophobicity"
392     >>> result = CalculateGearyAuto(protein, AAP, AAPName)
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.Autocorrelation.CalculateGearyAuto[3]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/Autocorrelation.py", line 397, in CalculateGearyAuto
    ProteinSequence, AAProperty[i], AAPropertyName[i]

KeyError: 0

/home/moose/GitHub/propy3/propy/Autocorrelation.py:392: UnexpectedException
_____________________________________________________________________________________________________ [doctest] propy.Autocorrelation.CalculateMoranAuto _____________________________________________________________________________________________________
348     -------
349     result contains 30*p Moran autocorrelation descriptors based on the given
350     properties.
351 
352     Examples
353     --------
354     >>> from propy.GetProteinFromUniprot import GetProteinSequence
355     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
356     >>> AAP, AAPName = _Hydrophobicity, "_Hydrophobicity"
357     >>> result = CalculateMoranAuto(protein, AAP, AAPName)
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.Autocorrelation.CalculateMoranAuto[3]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/Autocorrelation.py", line 362, in CalculateMoranAuto
    ProteinSequence, AAProperty[i], AAPropertyName[i]

KeyError: 0

/home/moose/GitHub/propy3/propy/Autocorrelation.py:357: UnexpectedException
_____________________________________________________________________________________________ [doctest] propy.Autocorrelation.CalculateNormalizedMoreauBrotoAuto _____________________________________________________________________________________________
314     -------
315     result contains 30*p Normalized Moreau-Broto autocorrelation descriptors
316     based on the given properties.
317 
318     Examples
319     --------
320     >>> from propy.GetProteinFromUniprot import GetProteinSequence
321     >>> protein = GetProteinSequence(ProteinID="Q9NQ39")
322     >>> AAP, AAPName = _Hydrophobicity, "_Hydrophobicity"
323     >>> result = CalculateNormalizedMoreauBrotoAuto(protein, AAP, AAPName)
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.Autocorrelation.CalculateNormalizedMoreauBrotoAuto[3]>", line 1, in <module>

  File "/home/moose/GitHub/propy3/propy/Autocorrelation.py", line 328, in CalculateNormalizedMoreauBrotoAuto
    ProteinSequence, AAProperty[i], AAPropertyName[i]

KeyError: 0

/home/moose/GitHub/propy3/propy/Autocorrelation.py:323: UnexpectedException

MartinThoma avatar Mar 10 '20 09:03 MartinThoma