Skip to content

Commit

Permalink
workaround diverging doctest on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxrider committed Sep 28, 2022
1 parent c23bcbc commit 7eb5142
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ec_tools/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ def determine_scan_rate(t, x):
def find_extrema_indeces(y, mode="all"):
"""Return the indexes of limits of cyclic voltammetry.
Workaround for Windows platform:
list(array([...], dtype=int64))
TEST:
>>> E = np.array([0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.14, 0.13, 0.12, 0.11, 0.10, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14])
>>> find_extrema_indeces(E)
array([ 5, 11])
>>> list(find_extrema_indeces(E))
[5, 11]
>>> find_extrema_indeces(E, mode="pos")
array([5])
>>> list(find_extrema_indeces(E, mode="pos"))
[5]
"""
signs = np.diff(np.sign(np.diff(y)))

Expand Down

0 comments on commit 7eb5142

Please sign in to comment.