Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #223

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
# list of supported hooks: https://pre-commit.com/hooks.html
- id: trailing-whitespace
Expand All @@ -14,18 +14,18 @@ repos:
# python code formatting/linting
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.286"
rev: "v0.8.6"
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.10.0
hooks:
- id: black
args: [--line-length, "100"]
# yaml formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types: [yaml]
1 change: 1 addition & 0 deletions pvnet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""PVNet"""

__version__ = "3.0.64"
1 change: 1 addition & 0 deletions pvnet/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Custom callbacks
"""

from lightning.pytorch import Trainer
from lightning.pytorch.callbacks import BaseFinetuning, EarlyStopping, LearningRateFinder
from lightning.pytorch.trainer.states import TrainerFn
Expand Down
1 change: 1 addition & 0 deletions pvnet/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Data parts"""

from .utils import BatchSplitter
1 change: 1 addition & 0 deletions pvnet/data/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Data module for pytorch lightning """

from datetime import datetime

from lightning.pytorch import LightningDataModule
Expand Down
1 change: 1 addition & 0 deletions pvnet/data/pv_site_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Data module for pytorch lightning """

import glob

from ocf_datapipes.batch import BatchKey, batch_to_tensor, stack_np_examples_into_batch
Expand Down
1 change: 1 addition & 0 deletions pvnet/data/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils common between Wind and PV datamodules"""

from ocf_datapipes.batch import BatchKey, unstack_np_batch_into_examples
from torch.utils.data import IterDataPipe, functional_datapipe

Expand Down
1 change: 1 addition & 0 deletions pvnet/data/wind_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Data module for pytorch lightning """

import glob

from ocf_datapipes.batch import BatchKey, batch_to_tensor, stack_np_examples_into_batch
Expand Down
1 change: 1 addition & 0 deletions pvnet/load_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Load a model from its checkpoint directory """

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions pvnet/models/base_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base model for all PVNet submodels"""

import json
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/baseline/single_value.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Average value model"""

import torch
from ocf_datapipes.batch import BatchKey
from torch import nn
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/ensemble.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Model which uses mutliple prediction heads"""

from typing import Optional

import torch
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/encoders/basic_blocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic blocks for image sequence encoders"""

from abc import ABCMeta, abstractmethod

import torch
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/encoders/encoders3d.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Encoder modules for the satellite/NWP data based on 3D concolutions.
"""

from typing import List, Union

import torch
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/linear_networks/basic_blocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic blocks for the lienar networks"""

from abc import ABCMeta, abstractmethod
from collections import OrderedDict

Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/linear_networks/networks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Linear networks used for the fusion model"""

from torch import nn, rand

from pvnet.models.multimodal.linear_networks.basic_blocks import (
Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/multimodal_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base model class for multimodal model and unimodal teacher"""

from ocf_datapipes.batch import BatchKey, NWPBatchKey
from torchvision.transforms.functional import center_crop

Expand Down
1 change: 1 addition & 0 deletions pvnet/models/multimodal/site_encoders/basic_blocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic blocks for PV-site encoders"""

from abc import ABCMeta, abstractmethod

from torch import nn
Expand Down
1 change: 1 addition & 0 deletions pvnet/training.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Training"""

import os
import shutil
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions pvnet/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils"""

import logging
import warnings
from collections.abc import Sequence
Expand Down
1 change: 1 addition & 0 deletions scripts/save_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
```
if wanting to override these values for example
"""

# This is needed to get multiprocessing/multiple workers to behave
try:
import torch.multiprocessing as mp
Expand Down
1 change: 1 addition & 0 deletions scripts/save_concurrent_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
```

"""

# This is needed to get multiprocessing/multiple workers to behave
try:
import torch.multiprocessing as mp
Expand Down
Loading