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

Error in find_rainflow_ranges for boundary cases #14

Open
abhijeet-pandey opened this issue Oct 25, 2022 · 4 comments
Open

Error in find_rainflow_ranges for boundary cases #14

abhijeet-pandey opened this issue Oct 25, 2022 · 4 comments

Comments

@abhijeet-pandey
Copy link

find_rainflow_ranges gives error for arbitrary numpy array. For example if the array doesn't contain any cycles - fatpack.find_rainflow_ranges(np.array([1,2,3,4,5]), return_means=True, k=2**14) produces error.

image

@Gunnstein
Copy link
Owner

Hey @abhijeet-pandey,

Since you mention "arbitrary": Are there more cases which gives error than if an array does not contain any cycles?

For the case of no cycles in the array, there should at the very least be a different error (FatpackError?) and more descriptive error message. A better solution would perhaps be if an empty array was returned since there are no cycles. I will think a bit more on this issue, but I welcome any help or comments.

Best regards,
Gunnstein

@abhijeet-pandey
Copy link
Author

I agree, that in case of no cycles - it should return empty array or None.
Yes, I did observe this error on a long data set (gigabyte size) that I had which is hard to share. One characteristic of the data was that it had sections with no cycles. Hence, I tried fatpack with artificial data with no cycles and was able to reproduce the same error. I hacked myself out of this error by using a try-except block over the if statement throwing the error and do nothing (do a "pass") in case of an exception. This may not be a correct approach though.

@wweijtje
Copy link

Just thinking out loud but would a strain history of np.array([1,2,3,4,5] result in a single residual/half cycle as there is a cycle initiated but not closed.

@abhijeet-pandey
Copy link
Author

abhijeet-pandey commented Jun 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants