From d656c1cb1f6e440a7302f680de8b4626787d5663 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:47:55 +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/pre-commit/pre-commit-hooks: v4.4.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.6.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.263 → v0.6.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.263...v0.6.8) - [github.com/psf/black: 23.3.0 → 24.8.0](https://github.com/psf/black/compare/23.3.0...24.8.0) - [github.com/pre-commit/mirrors-prettier: v3.0.0-alpha.9-for-vscode → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.0-alpha.9-for-vscode...v4.0.0-alpha.8) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f0273b..dc6596c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: # list of supported hooks: https://pre-commit.com/hooks.html - id: trailing-whitespace @@ -12,20 +12,20 @@ repos: - id: detect-private-key # python code formatting/linting - - repo: https://github.com/charliermarsh/ruff-pre-commit + - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: "v0.0.263" + rev: "v0.6.8" hooks: - id: ruff args: [--fix] - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 24.8.0 hooks: - id: black args: [--line-length, "100"] # yaml formatting - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.9-for-vscode + rev: v4.0.0-alpha.8 hooks: - id: prettier types: [yaml] From 4a99122283db92d70ff0fae88dbcc66c55b1a54d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:49:32 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pseudo_labeller/model/__init__.py | 1 + pseudo_labeller/model/idam.py | 13 +++++-------- setup.py | 1 + 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pseudo_labeller/model/__init__.py b/pseudo_labeller/model/__init__.py index 85016a7..ab94d34 100644 --- a/pseudo_labeller/model/__init__.py +++ b/pseudo_labeller/model/__init__.py @@ -1,2 +1,3 @@ """Models""" + from pseudo_labeller.model.idam import PsuedoIrradienceForecastor diff --git a/pseudo_labeller/model/idam.py b/pseudo_labeller/model/idam.py index 5dd9e5e..d70214e 100644 --- a/pseudo_labeller/model/idam.py +++ b/pseudo_labeller/model/idam.py @@ -1,4 +1,5 @@ """Psuedo-irradience forecastor/labeller""" + import einops import torch import torch.nn as nn @@ -68,7 +69,7 @@ def __init__( in_channels=input_channels, out_channels=conv3d_channels, kernel_size=(kernel_size, kernel_size, kernel_size), - padding=(1,0,0), + padding=(1, 0, 0), ) ) for i in range(0, num_layers): @@ -77,7 +78,7 @@ def __init__( in_channels=conv3d_channels, out_channels=conv3d_channels, kernel_size=(kernel_size, kernel_size, kernel_size), - padding=(1,0,0), + padding=(1, 0, 0), ) ) @@ -95,9 +96,7 @@ def __init__( # Small head model to convert from latent space to PV generation for training # Input is per-pixel input data, this will be # reshaped to the same output steps as the latent head - self.pv_meta_input = nn.Linear( - pv_meta_input_channels, out_features=hidden_dim - ) + self.pv_meta_input = nn.Linear(pv_meta_input_channels, out_features=hidden_dim) # Output is forecast steps channels, each channel is a timestep # For labelling, this should be 1, forecasting the middle @@ -142,7 +141,5 @@ def forward(self, x: torch.Tensor, pv_meta: torch.Tensor = None, output_latents: x = torch.cat([x, pv_meta], dim=1) # Get pv_meta_output x = self.pv_meta_output(x) - x = F.relu( - self.pv_meta_output2(x) - ) # Generation can only be positive or 0, so ReLU + x = F.relu(self.pv_meta_output2(x)) # Generation can only be positive or 0, so ReLU return x diff --git a/setup.py b/setup.py index 3f1900f..0e40cc0 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