Skip to content

Commit

Permalink
fix: python 3.12 code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jverrydt committed Jun 12, 2024
1 parent e73d8e2 commit 418b25a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions titiler/stacapi/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,18 @@ def get_layer_from_collections( # noqa: C901
tms_id: None for tms_id in tilematrixsets
}

if ("cube:dimensions" in collection.extra_fields
and "time" in collection.extra_fields["cube:dimensions"]):
if (
"cube:dimensions" in collection.extra_fields
and "time" in collection.extra_fields["cube:dimensions"]
):
layer["time"] = [
python_datetime.datetime.strptime(
t,
"%Y-%m-%dT%H:%M:%SZ",
).strftime("%Y-%m-%d")
for t in collection.extra_fields["cube:dimensions"]["time"]["values"]
for t in collection.extra_fields["cube:dimensions"]["time"][
"values"
]
]
elif intervals := temporal_extent.intervals:
start_date = intervals[0][0]
Expand Down Expand Up @@ -1157,7 +1161,9 @@ def web_map_tile_service( # noqa: C901

colormap = get_dependency_params(
dependency=self.colormap_dependency,
query_params={"colormap": req["colormap"]} if "colormap" in req else layer.get("render") or {},
query_params={"colormap": req["colormap"]}
if "colormap" in req
else layer.get("render") or {},
)

content, media_type = render_image(
Expand Down

0 comments on commit 418b25a

Please sign in to comment.