Commit 20833e9
committed
Fix mask broadcasting for numpy where in add_constraints
The switch from xarray's where() to numpy's where() broke dimension-aware
broadcasting. A 1D mask with shape (10,) was being broadcast to (1, 10)
instead of (10, 1), applying to the wrong dimension.
Fix: Explicitly broadcast mask to match data.labels shape before using np.where.1 parent 3316c0f commit 20833e9
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
| |||
0 commit comments