File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 13
13
import sys
14
14
15
15
16
+ def strip_blank_lines (l ):
17
+ "Remove leading and trailing blank lines from a list of lines"
18
+ while l and not l [0 ].strip ():
19
+ del l [0 ]
20
+ while l and not l [- 1 ].strip ():
21
+ del l [- 1 ]
22
+ return l
23
+
24
+
16
25
class Reader (object ):
17
26
"""A line-based string reader.
18
27
@@ -214,6 +223,7 @@ def _parse_param_list(self, content):
214
223
215
224
desc = r .read_to_next_unindented_line ()
216
225
desc = dedent_lines (desc )
226
+ desc = strip_blank_lines (desc )
217
227
218
228
params .append ((arg_name , arg_type , desc ))
219
229
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def test_parameters():
172
172
arg , arg_type , desc = doc ['Parameters' ][1 ]
173
173
assert_equal (arg_type , '(N, N) ndarray' )
174
174
assert desc [0 ].startswith ('Covariance matrix' )
175
- assert doc ['Parameters' ][0 ][- 1 ][- 2 ] == ' (1+2+3)/3'
175
+ assert doc ['Parameters' ][0 ][- 1 ][- 1 ] == ' (1+2+3)/3'
176
176
177
177
178
178
def test_other_parameters ():
@@ -354,7 +354,6 @@ def test_str():
354
354
.. math::
355
355
356
356
(1+2+3)/3
357
-
358
357
cov : (N, N) ndarray
359
358
Covariance matrix of the distribution.
360
359
shape : tuple of ints
@@ -948,6 +947,7 @@ def test_duplicate_signature():
948
947
f : callable ``f(t, y, *f_args)``
949
948
Aaa.
950
949
jac : callable ``jac(t, y, *jac_args)``
950
+
951
951
Bbb.
952
952
953
953
Attributes
You can’t perform that action at this time.
0 commit comments