Skip to content

Handle one, two, empty and out-of-range ENVI default bands - #2001

Draft
AbhinavMir wants to merge 1 commit into
danforthcenter:mainfrom
AbhinavMir:envi-default-bands
Draft

Handle one, two, empty and out-of-range ENVI default bands#2001
AbhinavMir wants to merge 1 commit into
danforthcenter:mainfrom
AbhinavMir:envi-default-bands

Conversation

@AbhinavMir

Copy link
Copy Markdown

The ENVI standard allows the default bands field of a header file to
hold one band number for a grayscale image, or three band numbers for
an RGB image. _make_pseudo_rgb always read three values from the field,
so a header with one or two default bands raised an IndexError, and an
empty field raised a ValueError.

Repeat a single default band in each channel to make a grayscale
pseudo-RGB image. Treat an empty default bands field as if the field is
absent, so the bands come from the available wavelengths. Raise a
PlantCV error for any other number of default bands.

A band number that is not in the datacube also raised an IndexError from
numpy. Check the band numbers against the size of the band axis and
raise a PlantCV error that names the bands and the size of the cube.
@deepsource-io

deepsource-io Bot commented Aug 29, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in dae7f5e...2a2f22e on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Python Aug 29, 2026 5:25p.m. Review ↗
Code coverage Aug 29, 2026 5:55p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@AbhinavMir
AbhinavMir marked this pull request as ready for review August 29, 2026 23:02
@AbhinavMir
AbhinavMir marked this pull request as draft August 29, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant