Skip to content

Harden raster/drift behavior and expand unit test coverage#1

Open
yszhang95 wants to merge 22 commits intoWireCell:masterfrom
yszhang95:master
Open

Harden raster/drift behavior and expand unit test coverage#1
yszhang95 wants to merge 22 commits intoWireCell:masterfrom
yszhang95:master

Conversation

@yszhang95
Copy link
Copy Markdown
Member

@yszhang95 yszhang95 commented Apr 24, 2026

A new version tag is released with this PR.

This PR updates the drift and rasterization stack on top of
benchmark_playground, with the main code changes centered in src/tred/graph.py, src/tred/raster/depos.py, and src/tred/raster/steps.py. The branch tightens dtype handling across rasterization, fixes dtype-sensitive grid/index boundary behavior, and clarifies the tail/head drift-time
convention shared by Drifter and Raster. It also improves depos coverage in
1D and N-D paths, including zero-width and finite-width behavior, and makes
the raster compute dtype explicit and consistent.

A large part of the branch is test hardening and documentation. tests/drift/ was expanded and cleaned up around drift.py and Drifter; tests/effq/ was reworked to replace stale integral expectations with charge-recovery and backend-facing assertions; and tests/raster/ is now explicitly documented as visualization-oriented smoke coverage around the Drifter/Raster interaction rather than strict numerical unit coverage. The README
and test notes were also updated, along with pyproject.toml dependency
organization, to better reflect how the suites should be run.

Highlights

  • Adds explicit raster compute dtype support across depos, step
    rasterization, and Raster.
  • Stabilizes charge-box/index calculations at float32/float64 grid
    boundaries.
  • Aligns Drifter endpoint ordering and Raster time handling with the
    current tail-time convention.
  • Strengthens backend-facing tests in tests/drift/ and tests/effq/.
  • Includes tests/raster/ as smoke coverage for end-to-end drift-to-raster
    behavior.
  • Updates docs and dependency groups to match the current workflow.

Verification
Ran:

  uv run --group dev pytest -q tests/drift tests/effq tests/raster

Result:

  111 passed, 4 warnings in 5.05s

The warnings are DeprecationWarnings from NumPy array conversion in tests/effq/test_effq.py, not test failures.

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