Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dask based implemenetation of reproject #88

Merged
merged 24 commits into from
May 1, 2023
Merged

Conversation

Kirill888
Copy link
Member

@Kirill888 Kirill888 commented Apr 30, 2023

  1. Generalize GeoboxTiles
    • support arbitrary chunked grids
    • support GCPGeoBox input
    • support "clipping" of tiles
  2. Implement GeoboxTiles.grid_intersect method for computing cross-block depenendencies
  3. Implement BlockAssembler helper class
  4. Implement Dask graph construction for reproject workflow using above

Closes #26

TODO:

Kirill888 added 23 commits April 1, 2023 16:29
Since numpy arrays shape is of type Tuple[int, ...] mark those
types as acceptable inputs into shape construction function.

ValueError will be raised at runtime when input is not 2-tuple.
This allows working with arbitrary 2d Dask inputs, and not
just those that have same shape of tiles except for edge tiles
signature was missing chunk information
Call some function with `[]` instead of `()`, handy
for exposing slicing into some object.

`(x: TK)->TV` into `[x: TK]->TV`.
Support slices on top of individual indexes
Also introduce `.crop` functionality.
Declare returned type as just (slice, slice), was
(NormalizedSlice, NormalizedSlice). This is to be
type compatible with numpy.
This will be used in dask reproject to assemble
computed chunks into a contigous array.
x[-1,:] and x[-1:,:] should behave the same, but x[-1,:] case was
broken.
From a set of tile indexes compute cropped version
and map indexes into the cropped space.
support yxb/tyxb axis order on input
- not fully tested yet
- todo: share intersection work across multiple bands of
  a single dataset that share common chunking regime
There were still assumptions about fixed sized chunks
in the code, so that broke for variable-sized chunks

Adding `.locate(pix) -> tile` to RoiTiles classes and
using that to map from world geometry to tile indexes.
@codecov
Copy link

codecov bot commented Apr 30, 2023

Codecov Report

Patch coverage: 81.73% and project coverage change: -1.61 ⚠️

Comparison is base (36ad1b1) 98.11% compared to head (fea7c62) 96.51%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #88      +/-   ##
===========================================
- Coverage    98.11%   96.51%   -1.61%     
===========================================
  Files           23       25       +2     
  Lines         3819     4188     +369     
===========================================
+ Hits          3747     4042     +295     
- Misses          72      146      +74     
Impacted Files Coverage Δ
odc/geo/_dask.py 0.00% <0.00%> (ø)
odc/geo/overlap.py 100.00% <ø> (ø)
odc/geo/_xr_interop.py 98.52% <88.23%> (-0.22%) ⬇️
odc/geo/geobox.py 99.41% <98.33%> (+0.03%) ⬆️
odc/geo/_blocks.py 100.00% <100.00%> (ø)
odc/geo/_version.py 100.00% <100.00%> (ø)
odc/geo/geom.py 100.00% <100.00%> (ø)
odc/geo/roi.py 100.00% <100.00%> (ø)
odc/geo/types.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented May 1, 2023

@github-actions github-actions bot temporarily deployed to pull request May 1, 2023 00:45 Inactive
@Kirill888 Kirill888 marked this pull request as ready for review May 1, 2023 00:47
@Kirill888 Kirill888 merged commit 11e31ad into develop May 1, 2023
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.

Port xr_reproject from odc.algo
1 participant