Fix types for numpy 1.20.0 upgrade

This commit is contained in:
Matthias
2021-01-31 11:21:23 +01:00
parent 92721db583
commit 5724371a4f
4 changed files with 6 additions and 39 deletions

View File

@@ -9,7 +9,6 @@ from pathlib import Path
from typing import Any
from typing.io import IO
import numpy as np
import rapidjson
@@ -28,20 +27,6 @@ def shorten_date(_date: str) -> str:
return new_date
############################################
# Used by scripts #
# Matplotlib doesn't support ::datetime64, #
# so we need to convert it into ::datetime #
############################################
def datesarray_to_datetimearray(dates: np.ndarray) -> np.ndarray:
"""
Convert an pandas-array of timestamps into
An numpy-array of datetimes
:return: numpy-array of datetime
"""
return dates.dt.to_pydatetime()
def file_dump_json(filename: Path, data: Any, is_zip: bool = False, log: bool = True) -> None:
"""
Dump JSON data into a file