Skip to content

Commit

Permalink
fixed failing python test
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Sep 24, 2024
1 parent 9a0b087 commit 6868e0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions python/mosaic/api/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"rst_tessellate",
"rst_transform",
"rst_tooverlappingtiles",
"rst_to_overlapping_tiles", # <- deprecated
"rst_to_overlapping_tiles", # <- deprecated
"rst_type",
"rst_to_overlapping_tiles",
"rst_tryopen",
Expand Down Expand Up @@ -755,7 +755,9 @@ def rst_numbands(raster_tile: ColumnOrName) -> Column:
)


def rst_pixelcount(raster_tile: ColumnOrName, count_nodata: Any = False, count_all: Any = False) -> Column:
def rst_pixelcount(
raster_tile: ColumnOrName, count_nodata: Any = False, count_all: Any = False
) -> Column:
"""
Parameters
----------
Expand All @@ -776,7 +778,7 @@ def rst_pixelcount(raster_tile: ColumnOrName, count_nodata: Any = False, count_a
count_nodata = lit(count_nodata)

if type(count_all) == bool:
count_all = lit(count_all)
count_all = lit(count_all)

return config.mosaic_context.invoke_function(
"rst_pixelcount",
Expand Down Expand Up @@ -1366,10 +1368,10 @@ def rst_tessellate(raster_tile: ColumnOrName, resolution: ColumnOrName) -> Colum


def rst_tooverlappingtiles(
raster_tile: ColumnOrName,
width: ColumnOrName,
height: ColumnOrName,
overlap: ColumnOrName,
raster_tile: ColumnOrName,
width: ColumnOrName,
height: ColumnOrName,
overlap: ColumnOrName,
) -> Column:
"""
Tiles the raster into tiles of the given size.
Expand All @@ -1388,12 +1390,11 @@ def rst_tooverlappingtiles(


def rst_to_overlapping_tiles(
raster_tile: ColumnOrName,
width: ColumnOrName,
height: ColumnOrName,
overlap: ColumnOrName,
) -> Column:

raster_tile: ColumnOrName,
width: ColumnOrName,
height: ColumnOrName,
overlap: ColumnOrName,
) -> Column:
return rst_tooverlappingtiles(raster_tile, width, height, overlap)


Expand Down
2 changes: 1 addition & 1 deletion python/test/test_raster_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_raster_scalar_functions(self):
.withColumn(
"rst_mapalgebra",
api.rst_mapalgebra(
array("tile", "rst_initnodata"),
array("tile_from_file", "rst_initnodata"),
lit('{"calc": "A+B", "A_index": 0, "B_index": 1}'),
),
)
Expand Down

0 comments on commit 6868e0a

Please sign in to comment.