Skip to content

fix: guard zoom_array against non-autoarray mask objects#270

Merged
Jammy2211 merged 1 commit intomainfrom
feature/release-fixes-apr-2026
Apr 12, 2026
Merged

fix: guard zoom_array against non-autoarray mask objects#270
Jammy2211 merged 1 commit intomainfrom
feature/release-fixes-apr-2026

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Fix zoom_array in autoarray/plot/utils.py to handle objects that have a .mask attribute but aren't autoarray Mask instances (e.g. numpy.ma.MaskedArray). Previously, passing such an array would crash with AttributeError: 'numpy.ndarray' object has no attribute 'is_all_false'.

This was the root cause of ~200 cascading failures in the Apr 10 release build — workspace simulator scripts that produce plain numpy arrays for plotting triggered this crash, which prevented dataset generation, which caused all downstream scripts to fail with missing data.

Relates to #269.

API Changes

None — internal changes only.

Test Plan

  • test_autoarray/ — 727 passed
  • Release build re-run after merge to verify cascade is resolved
Full API Changes (for automation & release notes)

No public API changes. Internal guard added to zoom_array() in autoarray/plot/utils.py.

🤖 Generated with Claude Code

When a numpy.ma.MaskedArray (or any object with a .mask attribute that
isn't an autoarray Mask) is passed to zoom_array, accessing
.mask.is_all_false crashes. Add a hasattr check so only autoarray Mask
objects trigger the zoom logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jammy2211 Jammy2211 merged commit 45ad33c into main Apr 12, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/release-fixes-apr-2026 branch April 12, 2026 17:55
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