Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctzerotime crashes for positive-only times #24

Closed
luisfabib opened this issue Sep 1, 2020 · 1 comment
Closed

correctzerotime crashes for positive-only times #24

luisfabib opened this issue Sep 1, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@luisfabib
Copy link
Collaborator

When trying to process a time-axis where the first element is already the zero-time, the function crashes.

@luisfabib luisfabib added the bug Something isn't working label Sep 1, 2020
@luisfabib luisfabib self-assigned this Sep 1, 2020
@luisfabib
Copy link
Collaborator Author

The bug was caused by non-Python indexing in an if-statement (a leftover from the MATLAB-Python porting)

    # Determine location of maximum
    idxmax = np.argmax(V_)

-    if idxmax!=1 and idxmax!=len(V):
+    if idxmax!=0 and idxmax!=len(V_)-1:

Added two new tests to test the that bug is gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant