Conversation
…id dispatch helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapt qed to the pyre::grid reimplementation.
This tracks the pyre grid rewrite (pyre#211), which retires the per-cell-type grid
bindings and the typed-grid Python classes in favor of a single type-erased grid that
presents the buffer protocol. qed consumed the old model in three places — its C++ tile
generators, their bindings, and the Python readers — all of which are reworked here. The
numerical kernels in
lib/qedare unchanged.Grid bindings
The tile generators fall into two families:
native and isce2 take a grid as their source. Each binding is replaced by one
wrapper that receives a
py::buffer(the erased grid, or anything else that speaks thebuffer protocol), rebuilds a read-only typed grid over it with
onGrid, and dispatcheson the buffer's cell format to the existing kernel. The shared helper lives in
ext/qed/grid.h/grid.icc:onGrid<dim, cellTs...>for the dispatch, andasGrid,asIndex,asShapefor the conversions. This collapses the old per-cell-type overloadpiles to one wrapper per generator.
nisar reads a tile out of an HDF5 dataset (using an on-disk
datatype) and only usesthe grid type at compile time for the tile geometry. Those wrappers keep the dataset and
datatype and convert the geometry. The stack generators take a list of datasets; the
masked variants take a second dataset for the mask; the BFPQ generators take the lookup
table as a buffer, which
asBFPQrebuilds into the small heap grid the kernels expect.Geometry arguments accept any Python iterable — tuple, list, or generator — so callers hand
in coordinates without wrapping them.
Readers
The readers no longer build
Shape2D/Index2D/Canonicalobjects or per-type gridfactories. The three memory-mapped-file readers (native
MemoryMap, the isce2 datasets)lay a
pyre.grid.maperased grid over the file; the rest pass their geometry as plainsequences to the tile generators.
Datatypes
Each concrete datatype carries a
cellattribute — the pyre memory cell name (float32,complex64, …) — which is whatpyre.gridwants when it lays a grid over memory. Theexisting
tagremains the class-name form used to build qed's own type-specialized bindingnames (
profileFloat).Dependency
Requires pyre#211. Verified against the live client on NISAR GUNW products — the nisar real
and complex channels (including the masked coherence and the wrapped-interferogram phase)
render correctly.