Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/h3/api/basic_int/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,6 @@ def uncompact_cells(cells, res):
-----
There is currently no guaranteed order of the output cells.
"""
# TODO: add test to make sure an error is returned when input contains cell
# smaller than output res.

hc = _in_collection(cells)
hu = _cy.uncompact_cells(hc, res)
Expand Down
10 changes: 10 additions & 0 deletions tests/test_lib/test_cells_and_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,3 +755,13 @@ def test_construct_cell_inverses_int_api():
def test_center_child_with_deconstruct():
for h in h3.get_res0_cells():
h3.construct_cell(*h3.deconstruct_cell(h), 0) == h3.cell_to_center_child(h)


def test_uncompact_cells_invalid_resolution():
# Create a valid cell at resolution 5
h_res5 = h3.latlng_to_cell(0, 0, 5)

# Attempting to uncompact to a coarser resolution (4)
# should raise an H3ResMismatchError
with pytest.raises(H3ResMismatchError):
h3.uncompact_cells({h_res5}, 4)
Loading