-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
SDS_preprocess reference shoreline numpy error #515
Comments
Hello, you could add import math on SDS_preprocess.py and replace |
Thanks. That sorts it out. Is it indicative of an install issue on my side? |
Since numpy doesn't often have an attribute called "math," I'm honestly not sure why np.math works for me. It's a mystery of Python! |
numpy released version 2.0 a few weeks ago, that's probably what's causing the issue. Will check what has changed and adjust the toolbox. |
@climeyG can you please check which version of numpy you are running. |
version 2.0.0 |
yep that makes sense. can you check where |
Hi Kilian
Sorry, you're dealing with someone with no coding background, bumbling
along. How would I do that?
I can trace this back to the _init_.py module, but that's as far as my
limited knowledge goes.
Gerard
…On Fri, 12 Jul 2024 at 04:32, Kilian Vos ***@***.***> wrote:
yep that makes sense. can you check where np.math.atan2 has ended in
numpy 2.0.0?
—
Reply to this email directly, view it on GitHub
<#515 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUX4A2K5WFU67SIUGOMXZ63ZL455TAVCNFSM6AAAAABKSQK4FKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRUGMYTIMRXG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
[image: image.png]
…On Fri, 12 Jul 2024 at 08:09, Gerard van Weele ***@***.***> wrote:
Hi Kilian
Sorry, you're dealing with someone with no coding background, bumbling
along. How would I do that?
I can trace this back to the _init_.py module, but that's as far as my
limited knowledge goes.
Gerard
On Fri, 12 Jul 2024 at 04:32, Kilian Vos ***@***.***> wrote:
> yep that makes sense. can you check where np.math.atan2 has ended in
> numpy 2.0.0?
>
> —
> Reply to this email directly, view it on GitHub
> <#515 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AUX4A2K5WFU67SIUGOMXZ63ZL455TAVCNFSM6AAAAABKSQK4FKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRUGMYTIMRXG4>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Hello, i check where np.math.atan2 has ended in numpy 2.0.0 with that AI generated code #import math Scalar valuesx = 3 Using math.atan2 via np.mathresult_scalar = np.math.atan2(y, x) Array valuesx_array = np.array([3, 1, -1, -3]) Using numpy.arctan2 for arraysresult_array = np.arctan2(y_array, x_array) When i try to execute the code, i got: DeprecationWarning: By the way, if you try np.atan2 you got an AttributeError. File "C:\Users\Avenel\AppData\Local\Programs\Python\Python312\Lib\site-packages\numpy_init_.py", line 347, in getattr To conclude, if x and y are scalar values you should use math.atan2(x,y) but if x and y are arrays you should use np.arctan2(x,y). Hope this will help. |
When i execute the script i got the following error Traceback (most recent call last): |
When I run the reference shoreline process, I end up with the error: AttributeError: module 'numpy' has no attribute 'math'. Assistance will be appreciated.
The text was updated successfully, but these errors were encountered: