Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(python): validate dimensions in list_to_2d_float_array#9799

Open
Bartok9 wants to merge 1 commit into
microsoft:mainmicrosoft/AirSim:mainfrom
Bartok9:aerial/fix-list-to-2d-shape-20260722Bartok9/AirSim:aerial/fix-list-to-2d-shape-20260722Copy head branch name to clipboard
Open

fix(python): validate dimensions in list_to_2d_float_array#9799
Bartok9 wants to merge 1 commit into
microsoft:mainmicrosoft/AirSim:mainfrom
Bartok9:aerial/fix-list-to-2d-shape-20260722Bartok9/AirSim:aerial/fix-list-to-2d-shape-20260722Copy head branch name to clipboard

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

What

list_to_2d_float_array now rejects negative sizes and length mismatches with an explicit ValueError instead of leaking numpy reshape noise. Empty 0×0 buffers remain valid.

Why

Depth helpers sometimes feed truncated flat buffers after empty image responses; clearer fail-closed errors help API callers.

Test plan

  • python3 PythonClient/airsim/tests/test_utils_reshape.py -v (4 tests)
  • Happy-path 2×2 reshape
  • length mismatch / negative dim paths

Does not touch string_to_* / write_file (see open #9795 / #9796).

Reject negative sizes and length mismatches with an explicit ValueError
instead of an opaque numpy reshape failure. Soft-empty 0x0 buffers stay
supported. Offline unit tests included (no simulator).

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.