Skip to content

Commit

Permalink
I hate np.datetime64 type.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed Dec 12, 2023
1 parent 3e9acd6 commit 0df2c6d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datacube_ows/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
import datetime
import logging
import numpy as np

Check failure on line 8 in datacube_ows/utils.py

View workflow job for this annotation

GitHub Actions / flake8

'numpy as np' imported but unused
from functools import wraps
from time import monotonic
from typing import Any, Callable, List, Optional, TypeVar
Expand Down Expand Up @@ -100,10 +101,7 @@ def group_by_solar(pnames: Optional[List[str]] = None) -> "datacube.api.query.Gr
sort_key = base_sort_key
# Wrap solar_day so we consistently get a datetime.
# (Don't know why I have to disable pylint for GHA check - passes fine locally.)
solar_day_py = lambda x: datetime.datetime.fromtimestamp(
(solar_day(x).astype(int) * 1e-9), # pylint: disable=too-many-function-args
tz=datetime.timezone.utc
)
solar_day_py = lambda x: solar_day(x).tolist()
return GroupBy(
dimension='time',
group_by_func=solar_day_py,
Expand Down

0 comments on commit 0df2c6d

Please sign in to comment.