ttide_py icon indicating copy to clipboard operation
ttide_py copied to clipboard

ttide might raise errors in newer/higher versions of Python

Open jszhang1002 opened this issue 10 months ago • 2 comments

Image While running code in Python 3.12, an error occurred at the line if ii due to ii being an empty array. I found that in NumPy version 3.12 and newer, there are stricter prohibitions against implicit boolean conversions of arrays. In Python 3.10 and earlier versions, using 'if ii': would implicitly call the bool method. However, in the context of NumPy arrays, this practice is unsafe because the array may contain multiple elements, causing the bool method to raise a ValueError.

jszhang1002 avatar Apr 22 '25 03:04 jszhang1002

Hello, recently I tried to use ttide again, but I also encountered this error with python 3.13.1 and NumPy 2.2.5. Have you found a solution? Like downgrade python and/or NumPy?

Edit1: For everyone with this problem, check this: https://github.com/moflaher/ttide_py/pull/38#issue-2807384159

jtorresto184 avatar May 15 '25 18:05 jtorresto184

Thanks for posting about this, I am using the patch now and it fixed my issue!

kthyng avatar Sep 18 '25 21:09 kthyng