Skip to content

Commit af136a9

Browse files
committed
Fix doctests to use print_functions
1 parent 891fa63 commit af136a9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.travis.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ python:
66
virtualenv:
77
system_site_packages: false
88
env:
9+
global:
10+
- DISTRIB="conda"
11+
- COVERAGE="true"
912
matrix:
10-
- DISTRIB="conda" PYTHON_VERSION="2.7" COVERAGE="true"
11-
- DISTRIB="conda" PYTHON_VERSION="3.6" COVERAGE="true"
13+
- PYTHON_VERSION="2.7"
14+
- PYTHON_VERSION="3.6"
1215
# command to install dependencies
1316
install: source ci/install.sh
1417
# command to run tests

pyhht/utils.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ def boundary_conditions(x, t, z=None, nbsym=2):
7777
timestamps, maxima timestamps, minima values, maxima values.)
7878
:rtype: tuple
7979
:Example:
80+
>>> from __future__ import print_function
8081
>>> import numpy as np
8182
>>> signal = np.array([-1, 1, -1, 1, -1])
82-
>>> print boundary_conditions(signal, np.arange(5))
83+
>>> print(boundary_conditions(signal, np.arange(5)))
8384
(array([0, 1, 2, 4, 6]), array([-1, 1, 3, 5, 7]), array([-1, 1, -1, -1, -1]), array([1, 1, 1, 1, 1]))
8485
"""
8586
indmax = argrelmax(x)[0]
@@ -216,14 +217,15 @@ def extr(x):
216217
:return: indices of minima, maxima and zero crossings.
217218
:rtype: tuple
218219
:Example:
220+
>>> from __future__ import print_function
219221
>>> import numpy as np
220222
>>> x = np.array([0, -2, 0, 1, 3, 0.5, 0, -1, -1])
221223
>>> indmin, indmax, indzer = extr(x)
222-
>>> print indmin
224+
>>> print(indmin)
223225
[1]
224-
>>> print indmax
226+
>>> print(indmax)
225227
[4]
226-
>>> print indzer
228+
>>> print(indzer)
227229
[0 2 6]
228230
"""
229231
m = x.shape[0]

0 commit comments

Comments
 (0)