Skip to content

Commit 975c8cb

Browse files
committed
fix mypy errors
1 parent 86663c6 commit 975c8cb

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

pctiler/pctiler/endpoints/item.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ def map(
135135
# crop/feature endpoint compat with titiler<0.15 (`/crop` was renamed `/feature`)
136136
@pc_tile_factory.router.post(
137137
r"/crop",
138-
operation_id=f"{self.operation_prefix}postDataForGeoJSONCrop",
138+
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONCrop",
139139
**img_endpoint_params,
140140
)
141141
@pc_tile_factory.router.post(
142142
r"/crop.{format}",
143-
operation_id=f"{self.operation_prefix}postDataForGeoJSONWithFormatCrop",
143+
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONWithFormatCrop",
144144
**img_endpoint_params,
145145
)
146146
@pc_tile_factory.router.post(
147147
r"/crop/{width}x{height}.{format}",
148-
operation_id=f"{self.operation_prefix}postDataForGeoJSONWithSizesAndFormatCrop",
148+
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONWithSizesAndFormatCrop",
149149
**img_endpoint_params,
150150
)
151151
def geojson_crop( # type: ignore
@@ -214,7 +214,7 @@ def geojson_crop( # type: ignore
214214
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTileWithFormatAndScale",
215215
**img_endpoint_params,
216216
)
217-
def tile_compat(
217+
def tile_compat( # type: ignore
218218
request: fastapi.Request,
219219
z: Annotated[
220220
int,
@@ -239,7 +239,7 @@ def tile_compat(
239239
Field(gt=0, le=4, description="Tile size scale. 1=256x256, 2=512x512..."),
240240
] = 1,
241241
format: Annotated[
242-
ImageType,
242+
Optional[ImageType],
243243
Field(
244244
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)."
245245
),
@@ -288,7 +288,7 @@ def tile_compat(
288288
response_model_exclude_none=True,
289289
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTileJSON",
290290
)
291-
def tilejson_compat(
291+
def tilejson_compat( # type: ignore
292292
request: fastapi.Request,
293293
tile_format: Annotated[
294294
Optional[ImageType],

pctiler/pctiler/endpoints/legend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def get_classmap_legend(
7070

7171
keys = list(classmap.keys()) # type: ignore
7272
trimmed_keys = keys[trim_start : len(keys) - trim_end]
73-
trimmed_map = {k: classmap[k] for k in trimmed_keys}
73+
trimmed_map = {k: classmap[k] for k in trimmed_keys} # type: ignore
7474

7575
return JSONResponse(content=trimmed_map)
7676

@@ -155,7 +155,7 @@ def make_colormap(name: str, trim_start: int, length: int) -> ListedColormap:
155155
if len(cm) > 256 or max(cm) >= 256:
156156
raise Exception("Cannot make a colormap for discrete colormap")
157157

158-
colors = make_lut(cm)
158+
colors = make_lut(cm) # type: ignore
159159

160160
colors = colors[trim_start : length + 1]
161161
# rescale to 0-1

pctiler/pctiler/endpoints/pg_mosaic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from psycopg_pool import ConnectionPool
77
from pydantic import Field
88
from titiler.core import dependencies
9-
from titiler.core.dependencies import ColorFormulaParams
109
from titiler.core.factory import img_endpoint_params
1110
from titiler.core.resources.enums import ImageType
1211
from titiler.pgstac.dependencies import SearchIdParams

pctiler/pctiler/reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _get_asset_info(self, asset: str) -> AssetInfo:
160160
info["media_type"] = media_type
161161

162162
if header_size := asset_info.get("file:header_size"):
163-
info["env"]["GDAL_INGESTED_BYTES_AT_OPEN"] = header_size
163+
info["env"].update({"GDAL_INGESTED_BYTES_AT_OPEN": header_size})
164164

165165
if bands := asset_info.get("raster:bands"):
166166
stats = [

0 commit comments

Comments
 (0)