Skip to content

Commit

Permalink
try typing with literal
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfriend committed Jan 2, 2025
1 parent 49dbf59 commit 4b805bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/h3/api/basic_int/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This file is **symlinked** across the APIs to ensure they are exactly the same.
from typing import Literal

from ... import _cy
from ..._h3shape import (
Expand Down Expand Up @@ -525,7 +526,11 @@ def polygon_to_cells(h3shape, res):
return h3shape_to_cells(h3shape, res)


def h3shape_to_cells_experimental(h3shape, res, contain='center'):
def h3shape_to_cells_experimental(
h3shape: H3Shape,
res: int,
contain: Literal['center', 'full', 'overlap', 'bbox_overlap'] = 'center',
):
"""
Experimental function similar to ``h3shape_to_cells``, but with support for
multiple cell containment modes.
Expand All @@ -542,13 +547,15 @@ def h3shape_to_cells_experimental(h3shape, res, contain='center'):
h3shape : ``H3Shape``
res : int
Resolution of the output cells
contain : {'center', 'full', 'overlap', 'bbox_overlap'}
contain : {'center', 'full', 'overlap', 'bbox_overlap'}, optional
Specifies the containment condition.
- 'center': Cell center is contained in shape
- 'full': Cell is fully contained in shape
- 'overlap': Cell is partially contained in shape
- 'bbox_overlap': Cell bounding box is partially contained in shape
Default is 'center'.
Returns
-------
list of H3Cell
Expand Down

0 comments on commit 4b805bf

Please sign in to comment.