Skip to content

Commit fb39ec1

Browse files
authored
Merge pull request #81 from JuliaGeo/claude/moc-budget-overhang
Fix budget MOC keeping giant cells on non-congruent overhang
2 parents 4296cee + 761fd2e commit fb39ec1

16 files changed

Lines changed: 892 additions & 427 deletions

File tree

docs/src/all_dggs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ for sys in DGG.systems()
7272
" levels ", DGG.levels(sys),
7373
", ", lpad(DGG.ncells(grid), 6), " cells at level 3",
7474
", sorted subtrees: ", DGG.has_sorted_subtrees(sys),
75+
", congruent refinement: ", DGG.has_congruent_refinement(sys),
7576
", id: ", nameof(DGG.cellindextype(sys)))
7677
end
7778
```

docs/src/api/boundaries.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ globalindex
122122
descendant_range
123123
descendants
124124
has_sorted_subtrees
125+
has_congruent_refinement
125126
has_direct_location
126127
node_extent
127128
maxneighbors

lib/DiscreteGlobalGridsConformanceTesting/src/DiscreteGlobalGridsConformanceTesting.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,8 @@ DGG.node_extent(w::GenericFallbackSystem, c::AbstractCellIndex) =
14171417
DGG.node_extent(w.system, c)
14181418
DGG.cap_inflation(w::GenericFallbackSystem) = DGG.cap_inflation(w.system)
14191419
DGG.has_sorted_subtrees(w::GenericFallbackSystem) = DGG.has_sorted_subtrees(w.system)
1420+
DGG.has_congruent_refinement(w::GenericFallbackSystem) =
1421+
DGG.has_congruent_refinement(w.system)
14201422
DGG.descendant_range(w::GenericFallbackSystem, c::AbstractCellIndex, l::Integer) =
14211423
DGG.descendant_range(w.system, c, l)
14221424
DGG.maxneighbors(w::GenericFallbackSystem, conn::Connectivity) =

src/DiscreteGlobalGrids.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ Important cross-system traits:
283283
[`cap_inflation`](@ref) to `1.75`.
284284
- **[`has_sorted_subtrees`](@ref).** True except for A5, whose canonical order
285285
has not established the two-sided [`descendant_range`](@ref) contract.
286+
- **[`has_congruent_refinement`](@ref).** True for HEALPix, S2 and ISEA4R,
287+
whose four children tile their parent exactly; false for IGeo7, H3 and A5.
288+
A `maxcells` [`MultiOrderCellSet`](@ref) descends through meeting cells
289+
alone where it holds, and through cells that miss as well where it does not.
286290
- **[`has_direct_location`](@ref).** True for every system here: each names
287291
the cell containing a point from the point's coordinates, so a
288292
[`PartialGrid`](@ref) over any of them locates through its complete level
@@ -396,7 +400,7 @@ export cellsize, levelfor
396400
# the hierarchy's parent is a method on Base's function, not a name to re-export.
397401
export cellindextype, levels, maxlevel, levelgrid, rootcells, children
398402
export node_extent, maxneighbors, maxring, winding, has_sorted_subtrees
399-
export has_direct_location
403+
export has_congruent_refinement, has_direct_location
400404
export ancestor, descendants, descendant_range
401405
export subtree
402406
export cellid

src/engine/engine.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import ..DiscreteGlobalGrids: AbstractGrid, AbstractHierarchicalGridSystem,
2727
cellindextype, levels, maxlevel, levelgrid, rootcells, children,
2828
node_extent, cap_inflation, maxneighbors, maxring, winding,
2929
static_capacity, STATIC_RING_CAP, STATIC_RING_BYTES,
30-
has_sorted_subtrees, has_direct_location,
30+
has_sorted_subtrees, has_congruent_refinement, has_direct_location,
3131
ancestor, descendants, descendant_range,
3232
subtree,
3333
border_engine, interior_engine, halo_engine,
@@ -77,6 +77,8 @@ include("extent_memo.jl")
7777
include("tiled_raster.jl")
7878
include("query.jl")
7979
include("multiorder.jl")
80+
include("multiorder_budget.jl")
81+
include("multiorder_set.jl")
8082
include("cell_vector.jl")
8183
# The stencil layer reads every collection above it — the subset grid, the
8284
# compressed vector, the multi-order set — and the lazy border walkers besides.

src/engine/multiorder.jl

Lines changed: 52 additions & 389 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)