Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce the selected-band axis whenever it is present, including when it contains one band. For example,
ndvi(data, [red], nir)currently raises on a rectangular image or broadcasts into an extra dimension on a square image. LoadedImageArrayinputs also retain the band axis with scalar selectors, so evenndvi(image.load(), red, nir)returns an extra dimension.Both cases now return one NDVI value per pixel, consistent with scalar selection on an ordinary array and the existing multiband averaging behavior.
Add regression coverage for singleton lists, tuples, arrays and slices, mixed singleton/multiband selections, and a loaded AVIRIS image. All 13 NDVI tests pass on Python 3.8/NumPy 1.24 and Python 3.12/NumPy 2.5. The five numerical test files pass 162 tests, and the required Flake8 check passes.
A separate audit of the official AVIRIS sample checks 60 region/container/band-selection configurations against per-pixel band means. All 60 now have the expected shape and values; the 12 previously working configurations remain byte-for-byte identical.