Skip to content

Polish reproject/merge docstrings and cover Inf/chunk_size/max_memory cases#1461

Merged
brendancol merged 1 commit intomainfrom
reproject-docstring-and-test-polish
May 4, 2026
Merged

Polish reproject/merge docstrings and cover Inf/chunk_size/max_memory cases#1461
brendancol merged 1 commit intomainfrom
reproject-docstring-and-test-polish

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Closes #1459.

Summary

  • Document the actual chunk_size=None default in both reproject() and merge(): 512 for the standard dask path, 2048 for the in-memory streaming and dask+cupy paths.
  • Add short Examples blocks to reproject() and merge() so the two main entry points match the rest of the subpackage.
  • Add four tests that previously had no coverage:
    • test_reproject_handles_inf_input: reproject must not crash on +/-Inf pixels.
    • test_reproject_chunk_size_tuple: tuple form of chunk_size is exercised on a dask input and asserted against the output chunks.
    • test_reproject_max_memory_string_arg: '256MB' and '1GB' are accepted.
    • test_reproject_max_memory_int_arg: integer byte count is accepted.

No behavior change in the implementation; only docstrings and tests.

Test plan

  • pytest xrspatial/tests/test_reproject.py -x passes (184 passed locally).
  • The four new tests run and pass under the keyword filter.

…ses (#1459)

Spell out the chunk_size default behavior in both reproject() and
merge() docstrings (512 for the standard dask path, 2048 for the
streaming and dask+cupy paths). Add short Examples blocks to both
to match the rest of the subpackage.

Add tests for previously uncovered cases:
- reproject on input containing +/-Inf must not crash.
- chunk_size as a tuple propagates to the dask output chunks.
- max_memory accepts human-readable strings ('256MB', '1GB').
- max_memory accepts integer byte counts.
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 4, 2026
@brendancol brendancol merged commit e7a0d60 into main May 4, 2026
11 checks passed
@brendancol brendancol deleted the reproject-docstring-and-test-polish branch May 5, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reproject/merge docstring polish and missing edge-case tests

1 participant