Skip to content

Commit d6b1924

Browse files
committed
fix flake8 style
1 parent d6e9867 commit d6b1924

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

pctiler/pctiler/endpoints/item.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,23 @@ def map(
132132
)
133133

134134

135+
prefix = pc_tile_factory.operation_prefix
136+
137+
135138
# crop/feature endpoint compat with titiler<0.15 (`/crop` was renamed `/feature`)
136139
@pc_tile_factory.router.post(
137140
r"/crop",
138-
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONCrop",
141+
operation_id=f"{prefix}postDataForGeoJSONCrop",
139142
**img_endpoint_params,
140143
)
141144
@pc_tile_factory.router.post(
142145
r"/crop.{format}",
143-
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONWithFormatCrop",
146+
operation_id=f"{prefix}postDataForGeoJSONWithFormatCrop",
144147
**img_endpoint_params,
145148
)
146149
@pc_tile_factory.router.post(
147150
r"/crop/{width}x{height}.{format}",
148-
operation_id=f"{pc_tile_factory.operation_prefix}postDataForGeoJSONWithSizesAndFormatCrop",
151+
operation_id=f"{prefix}postDataForGeoJSONWithSizesAndFormatCrop",
149152
**img_endpoint_params,
150153
)
151154
def geojson_crop( # type: ignore
@@ -156,7 +159,7 @@ def geojson_crop( # type: ignore
156159
format: Annotated[
157160
ImageType,
158161
Field(
159-
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)."
162+
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)." # noqa: E501
160163
),
161164
] = None, # type: ignore[assignment]
162165
src_path=Depends(pc_tile_factory.path_dependency),
@@ -196,42 +199,42 @@ def geojson_crop( # type: ignore
196199
# /tiles endpoint compat with titiler<0.15, Optional `tileMatrixSetId`
197200
@pc_tile_factory.router.get(
198201
"/tiles/{z}/{x}/{y}",
199-
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTile",
202+
operation_id=f"{prefix}getWebMercatorQuadTile",
200203
**img_endpoint_params,
201204
)
202205
@pc_tile_factory.router.get(
203206
"/tiles/{z}/{x}/{y}.{format}",
204-
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTileWithFormat",
207+
operation_id=f"{prefix}getWebMercatorQuadTileWithFormat",
205208
**img_endpoint_params,
206209
)
207210
@pc_tile_factory.router.get(
208211
"/tiles/{z}/{x}/{y}@{scale}x",
209-
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTileWithScale",
212+
operation_id=f"{prefix}getWebMercatorQuadTileWithScale",
210213
**img_endpoint_params,
211214
)
212215
@pc_tile_factory.router.get(
213216
"/tiles/{z}/{x}/{y}@{scale}x.{format}",
214-
operation_id=f"{pc_tile_factory.operation_prefix}getWebMercatorQuadTileWithFormatAndScale",
217+
operation_id=f"{prefix}getWebMercatorQuadTileWithFormatAndScale",
215218
**img_endpoint_params,
216219
)
217220
def tile_compat( # type: ignore
218221
request: fastapi.Request,
219222
z: Annotated[
220223
int,
221224
Path(
222-
description="Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile.",
225+
description="Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile.", # noqa: E501
223226
),
224227
],
225228
x: Annotated[
226229
int,
227230
Path(
228-
description="Column (X) index of the tile on the selected TileMatrix. It cannot exceed the MatrixHeight-1 for the selected TileMatrix.",
231+
description="Column (X) index of the tile on the selected TileMatrix. It cannot exceed the MatrixHeight-1 for the selected TileMatrix.", # noqa: E501
229232
),
230233
],
231234
y: Annotated[
232235
int,
233236
Path(
234-
description="Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix.",
237+
description="Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix.", # noqa: E501
235238
),
236239
],
237240
scale: Annotated[
@@ -241,7 +244,7 @@ def tile_compat( # type: ignore
241244
format: Annotated[
242245
Optional[ImageType],
243246
Field(
244-
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)."
247+
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)." # noqa: E501
245248
),
246249
] = None,
247250
src_path=Depends(pc_tile_factory.path_dependency),
@@ -293,7 +296,7 @@ def tilejson_compat( # type: ignore
293296
tile_format: Annotated[
294297
Optional[ImageType],
295298
Query(
296-
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg).",
299+
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg).", # noqa: E501
297300
),
298301
] = None,
299302
tile_scale: Annotated[

pctiler/pctiler/endpoints/pg_mosaic.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def mosaic_info(
8686
legacy_mosaic_router = APIRouter()
8787

8888

89-
# Compat with titiler-pgstac<0.3.0, (`/tiles/{search_id}/...` was renamed `/{search_id}/tiles/...`)
89+
# Compat with titiler-pgstac<0.3.0,
90+
# (`/tiles/{search_id}/...` was renamed `/{search_id}/tiles/...`)
9091
@legacy_mosaic_router.get("/tiles/{search_id}/{z}/{x}/{y}", **img_endpoint_params)
9192
@legacy_mosaic_router.get(
9293
"/tiles/{search_id}/{z}/{x}/{y}.{format}", **img_endpoint_params
@@ -117,25 +118,25 @@ def tile_routes( # type: ignore
117118
z: Annotated[
118119
int,
119120
Path(
120-
description="Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile.",
121+
description="Identifier (Z) selecting one of the scales defined in the TileMatrixSet and representing the scaleDenominator the tile.", # noqa: E501
121122
),
122123
],
123124
x: Annotated[
124125
int,
125126
Path(
126-
description="Column (X) index of the tile on the selected TileMatrix. It cannot exceed the MatrixHeight-1 for the selected TileMatrix.",
127+
description="Column (X) index of the tile on the selected TileMatrix. It cannot exceed the MatrixHeight-1 for the selected TileMatrix.", # noqa: E501
127128
),
128129
],
129130
y: Annotated[
130131
int,
131132
Path(
132-
description="Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix.",
133+
description="Row (Y) index of the tile on the selected TileMatrix. It cannot exceed the MatrixWidth-1 for the selected TileMatrix.", # noqa: E501
133134
),
134135
],
135136
search_id=Depends(pgstac_mosaic_factory.path_dependency),
136137
tileMatrixSetId: Annotated[ # type: ignore
137138
Literal[tuple(pgstac_mosaic_factory.supported_tms.list())],
138-
f"Identifier selecting one of the TileMatrixSetId supported (default: 'WebMercatorQuad')", # noqa: E501,F722
139+
"Identifier selecting one of the TileMatrixSetId supported (default: 'WebMercatorQuad')", # noqa: E501,F722
139140
] = "WebMercatorQuad",
140141
scale: Annotated[ # type: ignore
141142
Optional[Annotated[int, Field(gt=0, le=4)]],
@@ -144,7 +145,7 @@ def tile_routes( # type: ignore
144145
format: Annotated[
145146
Optional[ImageType],
146147
Field(
147-
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)."
148+
description="Default will be automatically defined if the output image needs a mask (png) or not (jpeg)." # noqa: E501
148149
),
149150
] = None,
150151
backend_params=Depends(pgstac_mosaic_factory.backend_dependency),

pctiler/pctiler/reader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ 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"].update({"GDAL_INGESTED_BYTES_AT_OPEN": header_size}) # type: ignore
163+
info["env"].update( # type: ignore
164+
{"GDAL_INGESTED_BYTES_AT_OPEN": header_size}
165+
)
164166

165167
if bands := asset_info.get("raster:bands"):
166168
stats = [

0 commit comments

Comments
 (0)