* Mypy: Initial support

 * Add to pre-commit (currently installs own deps, could maybe changed
   to poetry venv in the future to reuse environment and don't need
   duplicated types deps).
 * Add type hints.

* Mypy: Add missing annotations
This commit is contained in:
Dominique Lasserre
2024-11-26 22:28:05 +01:00
committed by GitHub
parent 2a163569bc
commit 1163ddb4ac
31 changed files with 637 additions and 531 deletions

View File

@@ -13,7 +13,7 @@ Key features:
import json
import os
import shutil
from datetime import datetime, timedelta
from datetime import date, datetime, timedelta
from pathlib import Path
from typing import Any, Optional
@@ -273,9 +273,7 @@ def get_working_dir() -> Path:
return working_dir
def get_start_enddate(
prediction_hours: int, startdate: Optional[datetime] = None
) -> tuple[str, str]:
def get_start_enddate(prediction_hours: int, startdate: Optional[date] = None) -> tuple[str, str]:
"""Calculate the start and end dates based on the given prediction hours and optional start date.
Args: