Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 24, 2025
1 parent 97e0557 commit 6b0ae08
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion experiments/india/004_n_training_samples/log-plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Small script to make MAE vs number of batches plot"""
"""Small script to make MAE vs number of batches plot"""

import pandas as df
import plotly.graph_objects as go
Expand Down
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__ = "4.0.1"
4 changes: 2 additions & 2 deletions pvnet/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Custom callbacks
"""
"""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,3 +1,4 @@
"""Data parts"""

from .site_datamodule import SiteDataModule
from .uk_regional_datamodule import DataModule
2 changes: 1 addition & 1 deletion pvnet/data/base_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Data module for pytorch lightning """
"""Data module for pytorch lightning"""

from glob import glob

Expand Down
2 changes: 1 addition & 1 deletion pvnet/data/site_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Data module for pytorch lightning """
"""Data module for pytorch lightning"""

from ocf_data_sampler.sample.site import SiteSample
from ocf_data_sampler.torch_datasets.datasets.site import SitesDataset
Expand Down
2 changes: 1 addition & 1 deletion pvnet/data/uk_regional_datamodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Data module for pytorch lightning """
"""Data module for pytorch lightning"""

from ocf_data_sampler.sample.uk_regional import UKRegionalSample
from ocf_data_sampler.torch_datasets.datasets.pvnet_uk import PVNetUKRegionalDataset
Expand Down
3 changes: 2 additions & 1 deletion 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 """
"""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: 0 additions & 1 deletion pvnet/models/baseline/last_value.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Persistence model"""


import pvnet
from pvnet.models.base_model import BaseModel
from pvnet.optimizers import AbstractOptimizer
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 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
4 changes: 2 additions & 2 deletions pvnet/models/multimodal/encoders/encoders3d.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Encoder modules for the satellite/NWP data based on 3D concolutions.
"""
"""Encoder modules for the satellite/NWP data based on 3D concolutions."""

from typing import List, Union

import torch
Expand Down
3 changes: 1 addition & 2 deletions pvnet/models/multimodal/encoders/encodersRNN.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Encoder modules for the satellite/NWP data based on recursive and 2D convolutional layers.
"""
"""Encoder modules for the satellite/NWP data based on recursive and 2D convolutional layers."""

import torch
from torch import nn
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 torchvision.transforms.functional import center_crop

from pvnet.models.base_model import BaseModel
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
4 changes: 1 addition & 3 deletions pvnet/models/multimodal/site_encoders/encoders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Encoder modules for the site-level PV data.
"""
"""Encoder modules for the site-level PV data."""

import einops
import torch
Expand Down
3 changes: 1 addition & 2 deletions pvnet/optimizers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Optimizer factory-function classes.
"""
"""Optimizer factory-function classes."""

from abc import ABC, abstractmethod

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
3 changes: 1 addition & 2 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Run training
"""
"""Run training"""

import os

Expand Down
1 change: 1 addition & 0 deletions scripts/save_concurrent_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
```
"""

# Ensure this block of code runs only in the main process to avoid issues with worker processes.
if __name__ == "__main__":
import torch.multiprocessing as mp
Expand Down

0 comments on commit 6b0ae08

Please sign in to comment.