From 64bf438847553ba0e8b18438e6ad312f3f5e5eaf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:32:49 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- graph_weather/__init__.py | 1 + graph_weather/models/__init__.py | 1 + graph_weather/models/analysis.py | 1 + graph_weather/models/forecast.py | 1 + graph_weather/models/layers/assimilator_decoder.py | 1 + graph_weather/models/layers/assimilator_encoder.py | 1 + graph_weather/models/layers/decoder.py | 1 + graph_weather/models/layers/encoder.py | 1 + graph_weather/models/layers/graph_net_block.py | 1 + graph_weather/models/layers/processor.py | 1 + graph_weather/models/losses.py | 1 + setup.py | 1 + train/pl_graph_weather.py | 1 + train/run_fulll.py | 1 + 14 files changed, 14 insertions(+) diff --git a/graph_weather/__init__.py b/graph_weather/__init__.py index 82f9a13c..1758fd49 100644 --- a/graph_weather/__init__.py +++ b/graph_weather/__init__.py @@ -1,3 +1,4 @@ """Main import for the complete models""" + from .models.analysis import GraphWeatherAssimilator from .models.forecast import GraphWeatherForecaster diff --git a/graph_weather/models/__init__.py b/graph_weather/models/__init__.py index be71b526..a18cda87 100644 --- a/graph_weather/models/__init__.py +++ b/graph_weather/models/__init__.py @@ -1,4 +1,5 @@ """Models""" + from .layers.assimilator_decoder import AssimilatorDecoder from .layers.assimilator_encoder import AssimilatorEncoder from .layers.decoder import Decoder diff --git a/graph_weather/models/analysis.py b/graph_weather/models/analysis.py index d5550136..d44abc11 100644 --- a/graph_weather/models/analysis.py +++ b/graph_weather/models/analysis.py @@ -1,4 +1,5 @@ """Model for forecasting weather from NWP states""" + import torch from huggingface_hub import PyTorchModelHubMixin diff --git a/graph_weather/models/forecast.py b/graph_weather/models/forecast.py index 0ed7a992..267bc950 100644 --- a/graph_weather/models/forecast.py +++ b/graph_weather/models/forecast.py @@ -1,4 +1,5 @@ """Model for forecasting weather from NWP states""" + from typing import Optional import torch diff --git a/graph_weather/models/layers/assimilator_decoder.py b/graph_weather/models/layers/assimilator_decoder.py index 80c51e8d..938011e6 100644 --- a/graph_weather/models/layers/assimilator_decoder.py +++ b/graph_weather/models/layers/assimilator_decoder.py @@ -13,6 +13,7 @@ more complex dynamics) """ + import einops import h3 import numpy as np diff --git a/graph_weather/models/layers/assimilator_encoder.py b/graph_weather/models/layers/assimilator_encoder.py index 226bff69..ac372740 100644 --- a/graph_weather/models/layers/assimilator_encoder.py +++ b/graph_weather/models/layers/assimilator_encoder.py @@ -21,6 +21,7 @@ """ + from typing import Tuple import einops diff --git a/graph_weather/models/layers/decoder.py b/graph_weather/models/layers/decoder.py index b5aec39c..31bf197d 100644 --- a/graph_weather/models/layers/decoder.py +++ b/graph_weather/models/layers/decoder.py @@ -13,6 +13,7 @@ more complex dynamics) """ + import torch from graph_weather.models.layers.assimilator_decoder import AssimilatorDecoder diff --git a/graph_weather/models/layers/encoder.py b/graph_weather/models/layers/encoder.py index 916a6523..04312afb 100644 --- a/graph_weather/models/layers/encoder.py +++ b/graph_weather/models/layers/encoder.py @@ -21,6 +21,7 @@ """ + from typing import Tuple import einops diff --git a/graph_weather/models/layers/graph_net_block.py b/graph_weather/models/layers/graph_net_block.py index 8ef5efc0..4be21121 100644 --- a/graph_weather/models/layers/graph_net_block.py +++ b/graph_weather/models/layers/graph_net_block.py @@ -4,6 +4,7 @@ This code is taken from https://github.com/CCSI-Toolset/MGN which is available under the US Government License """ + from typing import Optional, Tuple import torch diff --git a/graph_weather/models/layers/processor.py b/graph_weather/models/layers/processor.py index 07dd0ff4..9ed8b381 100644 --- a/graph_weather/models/layers/processor.py +++ b/graph_weather/models/layers/processor.py @@ -7,6 +7,7 @@ and its immediate neighbors. There are residual connections between each round of processing. """ + import torch from graph_weather.models.layers.graph_net_block import GraphProcessor diff --git a/graph_weather/models/losses.py b/graph_weather/models/losses.py index 5e5d27ec..5f183eb7 100644 --- a/graph_weather/models/losses.py +++ b/graph_weather/models/losses.py @@ -1,4 +1,5 @@ """Weather loss functions""" + import numpy as np import torch diff --git a/setup.py b/setup.py index 792b847f..03cb03c1 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Setup""" + from pathlib import Path from setuptools import find_packages, setup diff --git a/train/pl_graph_weather.py b/train/pl_graph_weather.py index 40ed7f21..d2588435 100644 --- a/train/pl_graph_weather.py +++ b/train/pl_graph_weather.py @@ -1,4 +1,5 @@ """PyTorch Lightning training script for the weather forecasting model""" + import click import datasets import numpy as np diff --git a/train/run_fulll.py b/train/run_fulll.py index cebf7f71..0acac1a3 100644 --- a/train/run_fulll.py +++ b/train/run_fulll.py @@ -1,4 +1,5 @@ """Training script for training the weather forecasting model""" + import json import os import sys