From c6c466b30e2fbc5182d27c07dead40ba0d52a214 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 23:07:33 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- snow_today_webapp_ingest/cli.py | 1 + snow_today_webapp_ingest/data_classes.py | 1 + snow_today_webapp_ingest/ingest/cogs.py | 1 + snow_today_webapp_ingest/ingest/swe_json.py | 1 + snow_today_webapp_ingest/types_/plot.py | 4 ++-- .../types_/subregion_hierarchy.py | 11 +++++++---- snow_today_webapp_ingest/util/field_transformers.py | 1 + 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/snow_today_webapp_ingest/cli.py b/snow_today_webapp_ingest/cli.py index 26db57b3..d6cc8a41 100644 --- a/snow_today_webapp_ingest/cli.py +++ b/snow_today_webapp_ingest/cli.py @@ -3,6 +3,7 @@ NOTE: imports are done in functions to avoid needing to evaluate code within those imports when doing `--help`. """ + from pathlib import Path from shutil import rmtree from tempfile import mkdtemp diff --git a/snow_today_webapp_ingest/data_classes.py b/snow_today_webapp_ingest/data_classes.py index 5c6041c3..217f5d18 100644 --- a/snow_today_webapp_ingest/data_classes.py +++ b/snow_today_webapp_ingest/data_classes.py @@ -4,6 +4,7 @@ TODO: Better name! "Data types" isn't much better. "Data kinds"? """ + import re from dataclasses import dataclass from functools import partial diff --git a/snow_today_webapp_ingest/ingest/cogs.py b/snow_today_webapp_ingest/ingest/cogs.py index 8fa84b1a..0775d129 100644 --- a/snow_today_webapp_ingest/ingest/cogs.py +++ b/snow_today_webapp_ingest/ingest/cogs.py @@ -1,4 +1,5 @@ """Convert non-CO GeoTIFFs to Cloud-Optimized GeoTIFFs.""" + import subprocess from pathlib import Path from pprint import pformat diff --git a/snow_today_webapp_ingest/ingest/swe_json.py b/snow_today_webapp_ingest/ingest/swe_json.py index c264d726..267de37d 100644 --- a/snow_today_webapp_ingest/ingest/swe_json.py +++ b/snow_today_webapp_ingest/ingest/swe_json.py @@ -5,6 +5,7 @@ CRITICAL: This code currently only expects and handles a single region of SWE data. """ + import csv import io from pathlib import Path diff --git a/snow_today_webapp_ingest/types_/plot.py b/snow_today_webapp_ingest/types_/plot.py index 86d5ac3b..8e461251 100644 --- a/snow_today_webapp_ingest/types_/plot.py +++ b/snow_today_webapp_ingest/types_/plot.py @@ -51,13 +51,13 @@ class PlotData(BaseModel): year_to_date: PlotPointColumn = Field( description="Observed values for the current water year to date", ) - min: PlotPointColumn = Field( # noqa: A003 + min: PlotPointColumn = Field( description=( "Observed values for the minimum water year (as specified in" " `metadata.minYear`)" ), ) - max: PlotPointColumn = Field( # noqa: A003 + max: PlotPointColumn = Field( description=( "Observed values for the maximum water year (as specified in" " `metadata.maxYear`)" diff --git a/snow_today_webapp_ingest/types_/subregion_hierarchy.py b/snow_today_webapp_ingest/types_/subregion_hierarchy.py index 21a2a69c..c35dfe20 100644 --- a/snow_today_webapp_ingest/types_/subregion_hierarchy.py +++ b/snow_today_webapp_ingest/types_/subregion_hierarchy.py @@ -15,10 +15,13 @@ class SubRegionsHierarchyCollectionRegionsIndex(RootModel): class SubRegionsHierarchyCollectionRegion(BaseModel): # TODO: Will this output as {} or null? - collections: None | dict[ - SubRegionCollectionIdentifier, - SubRegionsHierarchyCollectionRegionsIndex, - ] = None + collections: ( + None + | dict[ + SubRegionCollectionIdentifier, + SubRegionsHierarchyCollectionRegionsIndex, + ] + ) = None class SubRegionsHierarchyCollection(BaseModel): diff --git a/snow_today_webapp_ingest/util/field_transformers.py b/snow_today_webapp_ingest/util/field_transformers.py index 42d61b8e..01796b12 100644 --- a/snow_today_webapp_ingest/util/field_transformers.py +++ b/snow_today_webapp_ingest/util/field_transformers.py @@ -2,6 +2,7 @@ Currently for SWE JSON only. """ + import math