Commit ae51717
authored
Fix to_polycollection exclude path: always cache antimeridian_face_indices (#1510)
* Fix to_polycollection exclude path: always cache antimeridian_face_indices
Fixes #1507
When to_polycollection is called without a projection, antimeridian_face_indices
was computed but never written to _poly_collection_cached_parameters, leaving
the cache entry as None. dataarray.to_polycollection then called
np.delete(data, None, axis=0), which became a hard IndexError in numpy 2.0
(previously a silent no-op or deprecation warning).
Move the cache write to before the projection-only block so the entry is always
populated regardless of whether a projection is supplied.
* Restore both cache writes outside projection if-block
PR #1454 accidentally moved both non_nan_polygon_indices and
antimeridian_face_indices cache writes inside the projection check. Move them
back out unconditionally, restoring the pre-#1454 behavior.1 parent 1a51f7c commit ae51717
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| |||
0 commit comments