From 2ad31a0627955aad67087bd16d9160c79270db9d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:43:43 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.2.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.2.2) - [github.com/psf/black: 23.11.0 → 24.2.0](https://github.com/psf/black/compare/23.11.0...24.2.0) - [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.1.0...v4.0.0-alpha.8) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf5b5dfc..53544c0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,18 +14,18 @@ repos: # python code formatting/linting - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: "v0.1.6" + rev: "v0.2.2" hooks: - id: ruff args: [--fix] - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.2.0 hooks: - id: black args: [--line-length, "100"] # yaml formatting - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier types: [yaml] From 10c983778d3a7ce1017fbb92f7d22d7259a5d034 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:44:28 +0000 Subject: [PATCH 2/2] [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