Skip to content

Follow-up cleaning & fixes for compatibility with NumPy 1 & 2 - #7326

Merged
stefanv merged 4 commits into
mainfrom
maintenance/follow-up-numpy2
Mar 12, 2024
Merged

stefanv merged 4 commits into
mainfrom
maintenance/follow-up-numpy2

Conversation

@lagru

@lagru lagru commented Feb 23, 2024

Copy link
Copy Markdown
Member

Description

A follow-up to #7288 addressing a few review comments that were left pending.

Checklist

Release note

Summarize the introduced changes in the code block below in one or a few sentences. The
summary will be included in the next release notes automatically:

...

These aren't actually necessary, as problems with precision were caused
by another test `test_moments_weighted_central` that was changing the
float representation globally with `np.set_printoptions`.
In `test_overrange_tolerance_float`:
The previous test actually checked what happens if a Python float that
is out of range for the image type is used as the tolerance. Not casting
with `max_value.item()` would result in `np.float32(inf)` which is a
different test.

In `flood`:
Furthermore, we need to turn `min_value` and `max_value` into Python
scalars with `.item()` as well. Otherwise `max` and `min` seem to
trigger an overflow error during the comparison.
@lagru lagru added the 🔧 type: Maintenance Refactoring and maintenance of internals label Feb 23, 2024
@lagru
lagru requested a review from stefanv February 23, 2024 12:04
@lagru lagru mentioned this pull request Feb 23, 2024
18 tasks done
@lagru

lagru commented Feb 23, 2024

Copy link
Copy Markdown
Member Author

@stefanv, let me know if I shall revert the deprecation of lookfor here as well (see #7288 (comment)).

@stefanv

stefanv commented Feb 23, 2024

Copy link
Copy Markdown
Member

Is there a reason to deprecate lookfor? That code hasn't been touched in a while, and works fine. It's hard to know whether it is commonly used, but it is still part of our docs / tutorials. Perhaps we do a cleanup of all of those resources together?

@lagru

lagru commented Feb 25, 2024

Copy link
Copy Markdown
Member Author

works fine

In #7288 (comment) it was mentioned that there might be some issues. But I agree that's probably not a reason enough to change the status quo. I'll revert the deprecation an we can deal with that down the road. 👍

add a basic test for it, and make sure its docstring appears in our HTMl
documentation (wasn't the case previously).
We provide a ``lookfor`` function to search API functions::

import skimage as ski
ski.util.lookfor('eigenvalue')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the change from ski.lookfor to ski.util.lookfor. It's still available as the former, but not advertised. Now, ski.util.lookfor is also included in the HTML API doc.

@lagru
lagru force-pushed the maintenance/follow-up-numpy2 branch from 31bdad2 to ecfb0a0 Compare February 25, 2024 16:28
@stefanv
stefanv merged commit 5307e3d into main Mar 12, 2024
@stefanv
stefanv deleted the maintenance/follow-up-numpy2 branch March 12, 2024 17:14
@stefanv stefanv added this to the 0.23 milestone Mar 12, 2024
@lagru lagru mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants