From a23a9e0a2baf9a30cc734b6a10382bc778d7f4b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:58:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- experiments/008_24hour_forecast/forecast_24hour.py | 1 + gradboost_pv/__init__.py | 1 + gradboost_pv/app.py | 1 + gradboost_pv/inference/data_feeds.py | 1 + gradboost_pv/inference/models.py | 1 + gradboost_pv/inference/run.py | 1 + gradboost_pv/inference/utils.py | 1 + gradboost_pv/models/base_line.py | 1 + gradboost_pv/models/basic.py | 1 + gradboost_pv/models/pretrained.py | 1 + gradboost_pv/models/quadrant.py | 1 + gradboost_pv/models/region_filtered.py | 1 + gradboost_pv/models/s3.py | 1 + gradboost_pv/models/training.py | 1 + gradboost_pv/models/utils.py | 1 + gradboost_pv/preprocessing/basic.py | 1 + gradboost_pv/preprocessing/pretrained.py | 1 + gradboost_pv/preprocessing/quadrant_downsample.py | 1 + gradboost_pv/preprocessing/region_filtered.py | 1 + gradboost_pv/save.py | 1 + gradboost_pv/utils/logger.py | 1 + gradboost_pv/utils/typing.py | 1 + scripts/inference/mock_setup.py | 1 + scripts/models/grid_search_hyperparams.py | 1 + scripts/models/train/region_filtered_model.py | 1 + scripts/preprocessing/basic.py | 1 + scripts/preprocessing/pretrained.py | 1 + scripts/preprocessing/quadrant_downsample.py | 1 + scripts/preprocessing/uk_region_downsample.py | 1 + setup.py | 1 + tests/conftest.py | 1 + tests/inference/conftest.py | 1 + 32 files changed, 32 insertions(+) diff --git a/experiments/008_24hour_forecast/forecast_24hour.py b/experiments/008_24hour_forecast/forecast_24hour.py index 34be69da..8ef128f5 100644 --- a/experiments/008_24hour_forecast/forecast_24hour.py +++ b/experiments/008_24hour_forecast/forecast_24hour.py @@ -1,4 +1,5 @@ """ Script to load results from the database """ + import json from datetime import timedelta, timezone diff --git a/gradboost_pv/__init__.py b/gradboost_pv/__init__.py index 5d4cc1c5..8c7ef9c3 100644 --- a/gradboost_pv/__init__.py +++ b/gradboost_pv/__init__.py @@ -1,2 +1,3 @@ """Library for NationalBoost model""" + __version__ = "1.0.38" diff --git a/gradboost_pv/app.py b/gradboost_pv/app.py index 32017e94..72c3ac42 100644 --- a/gradboost_pv/app.py +++ b/gradboost_pv/app.py @@ -1,4 +1,5 @@ """Script to simulate data read, model inference and prediction write""" + import logging import os import pathlib diff --git a/gradboost_pv/inference/data_feeds.py b/gradboost_pv/inference/data_feeds.py index 635ba11d..a81d6b4f 100644 --- a/gradboost_pv/inference/data_feeds.py +++ b/gradboost_pv/inference/data_feeds.py @@ -1,4 +1,5 @@ """Datafeeds for model inference""" + import logging import os from dataclasses import dataclass diff --git a/gradboost_pv/inference/models.py b/gradboost_pv/inference/models.py index 126f8d06..ef43156d 100644 --- a/gradboost_pv/inference/models.py +++ b/gradboost_pv/inference/models.py @@ -1,4 +1,5 @@ """Models used for inference""" + import logging from abc import ABC, abstractmethod from dataclasses import dataclass, field diff --git a/gradboost_pv/inference/run.py b/gradboost_pv/inference/run.py index d1b0c6e4..07bb8d25 100644 --- a/gradboost_pv/inference/run.py +++ b/gradboost_pv/inference/run.py @@ -1,4 +1,5 @@ """Model inference pipeline""" + import logging from pathlib import Path from typing import Dict diff --git a/gradboost_pv/inference/utils.py b/gradboost_pv/inference/utils.py index b75cf9c6..9fbfd32f 100644 --- a/gradboost_pv/inference/utils.py +++ b/gradboost_pv/inference/utils.py @@ -1,4 +1,5 @@ """ functions to filter forecasts on the sun """ + import logging from datetime import datetime, timezone from typing import List diff --git a/gradboost_pv/models/base_line.py b/gradboost_pv/models/base_line.py index e2c6cfd2..7776ae95 100644 --- a/gradboost_pv/models/base_line.py +++ b/gradboost_pv/models/base_line.py @@ -1,4 +1,5 @@ """Baseline NWP model with no NWP data""" + from typing import Tuple import numpy as np diff --git a/gradboost_pv/models/basic.py b/gradboost_pv/models/basic.py index 3d0083ed..44f97746 100644 --- a/gradboost_pv/models/basic.py +++ b/gradboost_pv/models/basic.py @@ -1,4 +1,5 @@ """Basic Model with single point downsampling""" + from pathlib import Path from typing import Tuple diff --git a/gradboost_pv/models/pretrained.py b/gradboost_pv/models/pretrained.py index 2c49179e..81f93613 100644 --- a/gradboost_pv/models/pretrained.py +++ b/gradboost_pv/models/pretrained.py @@ -1,4 +1,5 @@ """Model built from pre-trained CNN passthrough""" + from pathlib import Path from typing import Tuple diff --git a/gradboost_pv/models/quadrant.py b/gradboost_pv/models/quadrant.py index d590ffee..094749e5 100644 --- a/gradboost_pv/models/quadrant.py +++ b/gradboost_pv/models/quadrant.py @@ -1,4 +1,5 @@ """Quadrant model - 4 point geospatial downsampling""" + from pathlib import Path from typing import Tuple diff --git a/gradboost_pv/models/region_filtered.py b/gradboost_pv/models/region_filtered.py index 4ac4fe33..a61698ff 100644 --- a/gradboost_pv/models/region_filtered.py +++ b/gradboost_pv/models/region_filtered.py @@ -1,4 +1,5 @@ """Model using geospatial masking""" + from pathlib import Path from typing import Tuple diff --git a/gradboost_pv/models/s3.py b/gradboost_pv/models/s3.py index 149eb1cd..ffc881d0 100644 --- a/gradboost_pv/models/s3.py +++ b/gradboost_pv/models/s3.py @@ -1,4 +1,5 @@ """S3 Interaction Utilities""" + import logging import os from io import BytesIO diff --git a/gradboost_pv/models/training.py b/gradboost_pv/models/training.py index 74a5e5f6..12fd0d5e 100644 --- a/gradboost_pv/models/training.py +++ b/gradboost_pv/models/training.py @@ -1,4 +1,5 @@ """Functions for model training""" + import dataclasses import json from dataclasses import dataclass diff --git a/gradboost_pv/models/utils.py b/gradboost_pv/models/utils.py index 0921369f..cb535496 100644 --- a/gradboost_pv/models/utils.py +++ b/gradboost_pv/models/utils.py @@ -1,4 +1,5 @@ """Model utilities""" + import logging from pathlib import Path from typing import Callable, Tuple, Union diff --git a/gradboost_pv/preprocessing/basic.py b/gradboost_pv/preprocessing/basic.py index c6c83fbd..d7193910 100644 --- a/gradboost_pv/preprocessing/basic.py +++ b/gradboost_pv/preprocessing/basic.py @@ -1,4 +1,5 @@ """Basic NWP Preprocessing""" + from pathlib import Path from typing import Optional diff --git a/gradboost_pv/preprocessing/pretrained.py b/gradboost_pv/preprocessing/pretrained.py index bd941eee..1a53b971 100644 --- a/gradboost_pv/preprocessing/pretrained.py +++ b/gradboost_pv/preprocessing/pretrained.py @@ -1,4 +1,5 @@ """Process NWP data with pretrained model""" + from math import ceil, floor from pathlib import Path from typing import Callable, Iterable, Iterator, Optional, Tuple diff --git a/gradboost_pv/preprocessing/quadrant_downsample.py b/gradboost_pv/preprocessing/quadrant_downsample.py index 348689f8..138b6a9f 100644 --- a/gradboost_pv/preprocessing/quadrant_downsample.py +++ b/gradboost_pv/preprocessing/quadrant_downsample.py @@ -1,4 +1,5 @@ """Quadrant downsampling preprocessing""" + from pathlib import Path from typing import Optional diff --git a/gradboost_pv/preprocessing/region_filtered.py b/gradboost_pv/preprocessing/region_filtered.py index 4efb4e6e..9ec1a62d 100644 --- a/gradboost_pv/preprocessing/region_filtered.py +++ b/gradboost_pv/preprocessing/region_filtered.py @@ -1,4 +1,5 @@ """Preprocess NWP data using geospatial mask""" + import itertools import logging import multiprocessing as mp diff --git a/gradboost_pv/save.py b/gradboost_pv/save.py index fddc7171..2b5f93a7 100644 --- a/gradboost_pv/save.py +++ b/gradboost_pv/save.py @@ -1,4 +1,5 @@ """ Function to save results to datbase """ + import logging import pandas as pd diff --git a/gradboost_pv/utils/logger.py b/gradboost_pv/utils/logger.py index 9a0cb5fa..b1fd1ec2 100644 --- a/gradboost_pv/utils/logger.py +++ b/gradboost_pv/utils/logger.py @@ -1,4 +1,5 @@ """Configure logging""" + import logging logging_config = dict( diff --git a/gradboost_pv/utils/typing.py b/gradboost_pv/utils/typing.py index e429d8b5..10670906 100644 --- a/gradboost_pv/utils/typing.py +++ b/gradboost_pv/utils/typing.py @@ -1,4 +1,5 @@ """Basic types used in package""" + from typing import Union import numpy as np diff --git a/scripts/inference/mock_setup.py b/scripts/inference/mock_setup.py index 5fac9d05..7c7dc195 100644 --- a/scripts/inference/mock_setup.py +++ b/scripts/inference/mock_setup.py @@ -1,4 +1,5 @@ """Script to simulate data read, model inference and prediction write""" + from argparse import ArgumentParser from pathlib import Path from typing import Callable, Tuple diff --git a/scripts/models/grid_search_hyperparams.py b/scripts/models/grid_search_hyperparams.py index 70f231cc..15073039 100644 --- a/scripts/models/grid_search_hyperparams.py +++ b/scripts/models/grid_search_hyperparams.py @@ -1,4 +1,5 @@ """Script for Hyperparameter gridsearch""" + import pickle from argparse import ArgumentParser from pathlib import Path diff --git a/scripts/models/train/region_filtered_model.py b/scripts/models/train/region_filtered_model.py index b0460645..815fb371 100644 --- a/scripts/models/train/region_filtered_model.py +++ b/scripts/models/train/region_filtered_model.py @@ -1,4 +1,5 @@ """Model training script""" + import logging from argparse import ArgumentParser, BooleanOptionalAction from pathlib import Path diff --git a/scripts/preprocessing/basic.py b/scripts/preprocessing/basic.py index e4ed4cf3..3efe1629 100644 --- a/scripts/preprocessing/basic.py +++ b/scripts/preprocessing/basic.py @@ -1,4 +1,5 @@ """Script to process using Basic downsampling""" + from argparse import ArgumentParser from pathlib import Path diff --git a/scripts/preprocessing/pretrained.py b/scripts/preprocessing/pretrained.py index f90e3c5a..7c166339 100644 --- a/scripts/preprocessing/pretrained.py +++ b/scripts/preprocessing/pretrained.py @@ -1,4 +1,5 @@ """Script for preprocessing NWP with pretrained CNN""" + from argparse import ArgumentParser from math import ceil from pathlib import Path diff --git a/scripts/preprocessing/quadrant_downsample.py b/scripts/preprocessing/quadrant_downsample.py index 31772b7c..6e6cfb00 100644 --- a/scripts/preprocessing/quadrant_downsample.py +++ b/scripts/preprocessing/quadrant_downsample.py @@ -1,4 +1,5 @@ """Script to perform quadrant downsampling of NWP data.""" + from argparse import ArgumentParser from pathlib import Path diff --git a/scripts/preprocessing/uk_region_downsample.py b/scripts/preprocessing/uk_region_downsample.py index dc1ae68c..91b21c8c 100644 --- a/scripts/preprocessing/uk_region_downsample.py +++ b/scripts/preprocessing/uk_region_downsample.py @@ -1,4 +1,5 @@ """Script for processing raw NWP data""" + import datetime as dt import itertools from argparse import ArgumentParser diff --git a/setup.py b/setup.py index 8ef11a22..1ac38ce1 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """ Usual setup file for package """ + # read the contents of your README file from pathlib import Path diff --git a/tests/conftest.py b/tests/conftest.py index 5891b265..bb1451a4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """ Configure and load test NWP/PV data """ + from pathlib import Path from typing import List diff --git a/tests/inference/conftest.py b/tests/inference/conftest.py index 813a7e21..e07efddb 100644 --- a/tests/inference/conftest.py +++ b/tests/inference/conftest.py @@ -1,4 +1,5 @@ """Generate s3 client, and model configs for testing""" + from pathlib import Path import pytest