Skip to content

Port structural_similarly to ski2 - #8104

Merged
lagru merged 17 commits into
scikit-image:mainfrom
lagru:sk2-data-range
May 13, 2026
Merged

lagru merged 17 commits into
scikit-image:mainfrom
lagru:sk2-data-range

Conversation

@lagru

@lagru lagru commented Mar 27, 2026 •

Copy link
Copy Markdown
Member

Description

Make data_range parameter required as discussed in #development > data_range vs prescale (skimage2).

  • Port structural_similarly
  • Port peak_signal_noise_ratio -> Defered to new PR

Checklist

Release note

For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.

...

@lagru lagru self-assigned this Mar 27, 2026
@lagru lagru added the 🥾 Path to skimage2 A step towards the new "API 2.0" label Mar 27, 2026
@github-project-automation github-project-automation Bot moved this to Pitched in Work pitches Mar 27, 2026
@lagru lagru moved this from Pitched to Doing in Work pitches Mar 27, 2026
@lagru lagru moved this from Doing to Review in Work pitches Mar 27, 2026
@greptile-apps

greptile-apps Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Apply commit hooks" | Re-trigger Greptile

@lagru lagru moved this from Review to Doing in Work pitches Apr 7, 2026
Conflicts:
src/skimage/metrics/_structural_similarity.py
@lagru lagru changed the title Port structural_similarly & peak_signal_noise_ratio to ski2 Port structural_similarly to ski2 Apr 20, 2026
@lagru lagru moved this from Doing to Review in Work pitches Apr 20, 2026
@greptile-apps

greptile-apps Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "Merge branch 'main' into sk2-data-range" | Re-trigger Greptile

lagru added 3 commits April 20, 2026 18:38
Depending on how the test suite is run, the floats are printed
differently in the doctest. I think that's due to
`np.set_printoptions(legacy="1.21")` being set in [1]

This should be fixed in a separate PR.

[1] https://github.com/scikit-image/scikit-image/blob/8dcfe0a8c30021620a46879a140a69b344cb604e/src/skimage/conftest.py#L15
@lagru lagru moved this from Review to Doing in Work pitches Apr 20, 2026
@greptile-apps

greptile-apps Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "Fix doctest" | Re-trigger Greptile

@lagru
lagru marked this pull request as ready for review April 20, 2026 16:52
@lagru lagru moved this from Doing to Review in Work pitches Apr 20, 2026
@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Reviews (4): Last reviewed commit: "Merge branch 'main' into sk2-data-range" | Re-trigger Greptile

@lagru lagru moved this from Review to Doing in Work pitches Apr 28, 2026
@lagru lagru moved this from Doing to Review in Work pitches Apr 28, 2026
lagru added 3 commits April 29, 2026 13:39
This creates a more explicit signature and even more importantly,
makes it clear what the default values are for those parameters.
I was worried about this since the function uses
`gaussian(..., preserve_range=False)` under the hood if
`gaussian_weights=True`.

But since the function converts the input images to float before passing
them to `gaussian` [1] this is fine. `img_as_float` doesn't rescale
the value range of floating images.

[1] https://github.com/scikit-image/scikit-image/blob/4f90b97a87c0456e00df98cf946c2db9d099724a/src/_skimage2/metrics/_structural_similarity.py#L205-L207
@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (5): Last reviewed commit: "Check that `structural_similarity` is in..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (6): Last reviewed commit: "Use `ski2_migration_decorator`" | Re-trigger Greptile

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@lagru
lagru merged commit 1e52154 into scikit-image:main May 13, 2026
21 of 22 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in Work pitches May 13, 2026
@stefanv stefanv added this to the 0.27 milestone May 13, 2026
@lagru
lagru deleted the sk2-data-range branch May 13, 2026 12:33
matthew-brett added a commit that referenced this pull request May 19, 2026
* origin/main:
  Use standard C99 static inline instead of `__inline` (#8159)
  Fix structural_similarity win_size / gaussian_weights conflict (#8162)
  Unwrap seed refactor (#8142)
  ci: Remove llvm build and add ccache support on windows (#8164)
  Document warn_external in contributing guide (#8163)
  CI: Fix emscripten dependencies and clean up wheel test commands (#8147)
  Test only changed subpackages (#8103)
  Fix nightlies: update deprecated scipy call, fix underdetermined test
  Fix minkowski distanced invocation for SciPy >= 1.18 (#8157)
  Port `structural_similarly` to ski2 (#8104)
  make spin build requirement a lower bound (#8158)
matthew-brett added a commit to matthew-brett/scikit-image that referenced this pull request May 21, 2026
* origin/main: (254 commits)
  Refactor, document migration utilities (scikit-image#8184)
  ci: improve handling of pr labels (scikit-image#8169)
  Doctest migration in PRs & on all platforms (scikit-image#8141)
  Update SKIP 4 (import hierarchy, backporting, testing) (scikit-image#8097)
  One page per function / class in HTML docs for skimage2 (scikit-image#8154)
  Pin minimum pytest to 9 (scikit-image#8174)
  docs: make source install instructions more discoverable and add build requirements to top level requirements file (scikit-image#8165)
  Drop `--maxfail=5` from local pytest config (scikit-image#8170)
  Use standard C99 static inline instead of `__inline` (scikit-image#8159)
  Fix structural_similarity win_size / gaussian_weights conflict (scikit-image#8162)
  Unwrap seed refactor (scikit-image#8142)
  ci: Remove llvm build and add ccache support on windows (scikit-image#8164)
  Document warn_external in contributing guide (scikit-image#8163)
  CI: Fix emscripten dependencies and clean up wheel test commands (scikit-image#8147)
  Test only changed subpackages (scikit-image#8103)
  Fix nightlies: update deprecated scipy call, fix underdetermined test
  Fix minkowski distanced invocation for SciPy >= 1.18 (scikit-image#8157)
  Port `structural_similarly` to ski2 (scikit-image#8104)
  make spin build requirement a lower bound (scikit-image#8158)
  Drop Python 3.11 Support (scikit-image#8153)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🥾 Path to skimage2 A step towards the new "API 2.0"

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants