Repository navigation
Update test_MarkovModel.py - #1129
Conversation
Updated Tests/test_MarkovModel.py to expand unittest coverage. See biopython issue #820
| warnings.simplefilter("ignore", UserWarning) | ||
| from Bio import MarkovModel | ||
|
|
||
| try: |
There was a problem hiding this comment.
Can you use just from Bio._py3k import StringIO here?
It is shorter, and will make it slightly easier to remove all the Python 2 specific code one day.
| state_list, state_float = states[0] | ||
| self.assertEqual(state_list, ["N"]) | ||
|
|
||
| # Copyright 2017 by Maximilian Greil. All rights reserved. |
There was a problem hiding this comment.
Just put a single (combined) copyright notice at the top of the file please.
| self.assertTrue( | ||
| array_equal(around( | ||
| markov_model.p_emission, decimals=3), | ||
| around(output_p_emission, decimals=3))) |
There was a problem hiding this comment.
The indentation of the first example is the most readable, with the two things being compared on their on lines (self contained).
| matrix = array([[0., -1.5606477, -3.07477539, -3.84932984], | ||
| [-16.11809565, -2.4079455, -3.27544608, -4.5847794]]) | ||
| self.assertTrue( | ||
| array_equal(around(MarkovModel._forward(len(states), |
There was a problem hiding this comment.
As above, put the array_equal on the first line so that the two things being compared is clearer.
|
I don't know why the coverage report hasn't appeared on the pull request (yet), but this looks good. I've only spotted some minor style issues, and placement of copyright header. |
Adjusted Tests/test_MarkovModel.py to suggestions by Peter Cock.
Fixed code according to pep8 standards.
Additional updates to Tests/test_MarkovModel.py to satisfy pep8 style guide
|
Hello Peter, |
Squashed commit of pull request biopython#1129.
Updated Tests/test_MarkovModel.py to expand unittest coverage.
See biopython issue #820