-
Notifications
You must be signed in to change notification settings - Fork 30
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
Numpy Deprecation Warnings #364
Comments
@Witchblade101 I am curious if this is the reason that Paul made the changes in #363. Not this same warning, but a numpy deprecation in general. I would like to see us upgrade to Numpy >=2.0 but I don't know if that's possible right now. |
I believe those are the changes from Brett that we accepted back in the fall. We merged them into Main, but not into siaf-updates. They got pulled into my fork when I created a branch for Paul's changes. |
I'm going to follow the advice of https://numpy.org/devdocs/numpy_2_0_migration_guide.html and try running the recommended Ruff linting rule on a local branch of our code, then run the tests and generate scripts and see what kind of warnings I get, and if everything still looks OK otherwise. |
@Witchblade101 that sounds good to me. Let me know if you need any help testing the migration to numpy 2.0 |
The first check after adding
to pyproject.toml in a clone of the current Main branch:
|
I tried the same thing on a branch made from siaf-updates, but it also found no errors. So as a check of the tool I added
and that gave
so the linter is catching things |
@Witchblade101 that's good! As for the package having linting issues, woof. Might be a task for another time. |
I set the linting to be very aggressive, on purpose, just to see if I had it configured correctly. Next I want to check if it only flags errors, or catches warnings, as well. What we were seeing were deprecation warnings, and those may be getting ignored by default. |
Running generate_nircam.py I got the following warnings:
/Users/dlong/pysiaf/generate/generate_nircam.py:209: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) v2_offset = float( /Users/dlong/pysiaf/generate/generate_nircam.py:212: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.) v3_offset = float(
I suspect we'll see the same in all of the generate scripts, and others. This was fixed in many of our routines as part of #360. This issue is to find and fix it everywhere else.
The text was updated successfully, but these errors were encountered: