Commit e73bc12
authored
* Require explicit opt-in on experimental and internal-only GeoTIFF paths (#2352)
PR 4 of 6 under epic #2340 (GeoTIFF release contract). Adds the
matching read-side gates for the Tier 3 / Tier 4 codecs the writer
already gated in #2137 and #1845, and extends the
``allow_experimental_codecs`` opt-in onto the writer rich-tag attrs
(``gdal_metadata_xml`` / ``extra_tags``).
Read side:
- ``open_geotiff`` / ``read_geotiff_dask`` / ``read_geotiff_gpu`` /
``read_vrt`` now reject sources compressed with LERC, JPEG2000 /
J2K, or LZ4 unless ``allow_experimental_codecs=True``.
- The same readers reject JPEG-in-TIFF unless
``allow_internal_only_jpeg=True``. The flags do not collapse.
- Gates fire at the public entry point (eager) or at graph build
(dask), before any decode work, so the caller learns the opt-in
name from the rejection rather than a deeper decode failure.
Write side:
- ``to_geotiff`` and ``write_geotiff_gpu`` reject writes that include
``attrs['gdal_metadata_xml']`` or ``attrs['extra_tags']`` unless
``allow_experimental_codecs=True``. Round-tripped attrs (carrying
``_xrspatial_geotiff_contract``) are exempt so the canonical
attrs contract from #1984 still round-trips without a flag.
Tests:
- New ``test_experimental_internal_optin_2352.py`` pins the
rejections, the exemption shape, and the public signatures.
- Existing codec / rich-tag tests pass the new opt-ins through; the
``test_reader_kwarg_order_1935.py`` canonical kwarg order is
updated to slot the new flags next to the other ``allow_*``
policy gates.
Out of scope (sibling PRs under epic #2340):
- Docstring rewrites for public read/write entry points (#2346).
- Docs release-contract page (#2347).
- ``SUPPORTED_FEATURES`` tier audit (#2348).
- Unsupported-combination errors (#2349).
Closes #2352.
* Address self-review: explain Adobe Deflate collapse, contract-marker soft gate, and dask graph-build skip (#2352)
Documents three design choices flagged during the self-review pass on
#2356:
* _COMPRESSION_TAG_TO_NAME collapses TIFF tag 32946 (Adobe
Deflate) onto the stable codec.deflate entry on purpose. The
comment makes the deliberate collapse vs accidental passthrough
obvious to a future reviewer.
* The rich-tag gate's _xrspatial_geotiff_contract exemption is a
soft gate by design: forging the marker by hand would bypass it,
but the alternative (gating every read-then-write call) would
break the canonical attrs round-trip from #1984.
* The dask read-side gate uses getattr(..., None) so a
synthesised geo_info (non-TIFF source) skips the check rather than
rejects. The comment documents the lockstep invariant
(_ifd_compression stashed alongside _ifd_photometric /
_ifd_samples_per_pixel on every TIFF source path) so the skip
never silently bypasses a real TIFF read.
1 parent 9c40df4 commit e73bc12
47 files changed
Lines changed: 1127 additions & 129 deletions
File tree
- xrspatial/geotiff
- _backends
- _writers
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
| |||
339 | 345 | | |
340 | 346 | | |
341 | 347 | | |
| 348 | + | |
| 349 | + | |
342 | 350 | | |
343 | 351 | | |
344 | 352 | | |
| |||
535 | 543 | | |
536 | 544 | | |
537 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
538 | 563 | | |
539 | 564 | | |
540 | 565 | | |
| |||
665 | 690 | | |
666 | 691 | | |
667 | 692 | | |
| 693 | + | |
| 694 | + | |
668 | 695 | | |
669 | 696 | | |
670 | 697 | | |
| |||
685 | 712 | | |
686 | 713 | | |
687 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
688 | 719 | | |
689 | 720 | | |
690 | 721 | | |
| |||
696 | 727 | | |
697 | 728 | | |
698 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
699 | 734 | | |
700 | 735 | | |
701 | 736 | | |
| |||
714 | 749 | | |
715 | 750 | | |
716 | 751 | | |
| 752 | + | |
| 753 | + | |
717 | 754 | | |
718 | 755 | | |
719 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
357 | 517 | | |
358 | 518 | | |
359 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
127 | 139 | | |
128 | 140 | | |
129 | 141 | | |
| |||
315 | 327 | | |
316 | 328 | | |
317 | 329 | | |
| 330 | + | |
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| |||
323 | 336 | | |
324 | 337 | | |
325 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
326 | 361 | | |
327 | 362 | | |
328 | 363 | | |
| |||
553 | 588 | | |
554 | 589 | | |
555 | 590 | | |
556 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
557 | 596 | | |
558 | 597 | | |
559 | 598 | | |
| |||
575 | 614 | | |
576 | 615 | | |
577 | 616 | | |
578 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
579 | 620 | | |
580 | 621 | | |
581 | 622 | | |
| |||
631 | 672 | | |
632 | 673 | | |
633 | 674 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
639 | 683 | | |
640 | 684 | | |
641 | 685 | | |
| |||
0 commit comments