question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Meta-issue: ndimage spline boundary handling (NumFOCUS proposal)

See original GitHub issue

This is a meta-issue to help keep track of open issues and PRs related to ndimage enhancements and bug fixes for our NumFOCUS small development grant.

cc @rgommers, @stefanv

PRs associated with the proposal

  • gh-12721: improve numerical accuracy of rotate (thanks, @ev-br!)
  • gh-12746: parameterize scipy.ndimage tests
  • gh-12767: grid-wrap, reflect and updated tutorials
  • gh-12776: grid-constant
  • gh-12802: benchmarks for scipy.ndimage.interpolation
  • gh-12812: complex-valued image support for ndimage.interpolation functions
  • gh-13095: implement zoom coordinate convention consistent with the grid interpretation
  • gh-13139: fix for mode=‘nearest’ when prefilter=False and order > 1

Issues related to problems with wrap and reflect boundary conditions:

gh-1323 (fixed by gh-12767) gh-2640 (reflect and wrap cases fixed by gh-12767. constant and nearest still imperfect for order > 1) gh-8131 (fixed by gh-12767) gh-8465 (fixed by gh-12767)

Issues related to problems with constant boundary condition:

gh-2640 gh-9865 Related: The following three were recently fixed, but having a grid-constant mode is probably more robust for general cases. gh-1903 (fixed by gh-12721) gh-10926 (fixed by gh-12721) gh-12543 (fixed by gh-12721)

tasks related to documentation

gh-9746

misc things to review

https://github.com/scipy/scipy/pull/9537#discussion_r244550683 https://gist.github.com/jaimefrio/79ee7a9f8d7ff6ca10ae72633ec68c80 discussion in gh-8537 gh-5223 (fix proposed in gh-13095)

abandoned PR with good discussion:

gh-206 (previously abandoned PR with partial fix)

related issues/PRs in downstream libraries

scikit-image/scikit-image#1514 scikit-image/scikit-image#1583 scikit-image/scikit-image#1585 (resolved by gh-12767) scikit-image/scikit-image#1732 scikit-image/scikit-image#1789 scikit-image/scikit-image#2629 scikit-image/scikit-image#3445 scikit-image/scikit-image#4824 scikit-image/scikit-image#4279 scikit-image/scikit-image#4416 cupy/cupy#1523 google/jax#1711 google/jax#3928

other misc issues

gh-8845 (won’t fix)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
grlee77commented, Nov 29, 2020

I am going to close this meta-issue now that all PRs related to it have been merged. Thank you to everyone who reviewed and/or gave feedback!

1reaction
grlee77commented, Sep 10, 2020

I have spent the majority of my funded effort toward the SciPy proposal at this point and don’t plan substantial additional work here aside from finishing up the currently open PRs and tidying up some things downstream at scikit-image and CuPy once we finalize things here. I wanted to summarize some API/design choices below for consideration/comment.

cc also @sethtroisi and @larsoner as discussion participants from related PRs.

For scipy.ndimage.interpolation functions

  • 1.) Two new modes: grid-wrap (gh-12767) and grid-constant (gh-12776) were introduced. I believe the consensus is to keep both the existing wrap and constant modes in addition to these? I would have preferred if the existing wrap and constant modes behaved as these grid variants from the start, but I don’t think it is very easy to change that at this point.

  • 2.) The synonym grid-mirror was introduced for mode reflect. I am personally not sure this is desirable and may just generate more confusion. If we do introduce it, do we deprecate reflect?

  • 3.) Better documentation of boundary handling was added to the ndimage tutorials in (see doc artifacts in gh-12767 and gh-12776). Perhaps we should also link to these from the mode docstring in the individual functions to help avoid potential user confusion?

For scipy.ndimage.filters functions

All of the convolution-based filters already operate only on a grid, so the existing wrap mode already operates like the new grid-wrap introduced in the interpolation module. Likewise, there is not a distinction between grid-constant and constant as there is no consideration of values at fractional offsets outside the image boundary.

  • 1.) should we also allow use of grid-wrap as a synonym for wrap or explicitly raise an exception if it is provided? (ditto for grid-mirror as a synonym for reflect and grid-constant as a synonym for constant)
  • 2.) If we decide to allow these new names, do we deprecate either the old or new name?

I don’t really think we should deprecate use of either 'wrap' or constant with their current meaning for these filtering functions for two reasons: 1.) it will be an annoyance for many downstream users and 2.) wrap and constant already match the behavior of manually padding using these modes in numpy.pad.

Given that I also don’t think it makes much sense to keep two synonymous names long-term, I am personally leaning toward NOT making changes to the mode names used by the ndimage.filters module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SciPy 1.6.0 Release Notes — SciPy v1.9.3 Manual
New grid_mode option for scipy.ndimage.zoom to enable results consistent with ... #12773: Meta-issue: ndimage spline boundary handling (NumFOCUS proposal).
Read more >
Mailman 3 ANN: SciPy 1.6.0rc2 -- please test - SciPy-Dev - python.org
`scipy.ndimage` improvements: Fixes and ehancements to boundary extension modes for ... Meta-issue: ndimage spline boundary handling (NumFOCUS proposal) ...
Read more >
SciPy: doc/release/1.6.0-notes.rst | Fossies
scipy.ndimage improvements: Fixes and ehancements to boundary extension modes ... #12773: Meta-issue: ndimage spline boundary handling (NumFOCUS proposal) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found