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 #206

Merged
merged 2 commits into from
Apr 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.3.5
hooks:
- id: ruff # Run the linter
args: [ --fix ]
Expand Down
1 change: 1 addition & 0 deletions scripts/pipeline/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
Process Sentinel-2, Sentinel-1, and DEM data for a specified time range,
area of interest, and resolution.
"""

import logging
import os
import random
Expand Down
1 change: 1 addition & 0 deletions scripts/pipeline/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
It includes functions to filter tiles based on cloud coverage and no-data pixels,
and a tiling function that generates smaller tiles from the input stack.
"""

import logging
import subprocess
import tempfile
Expand Down
1 change: 1 addition & 0 deletions src/callbacks_wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- https://wandb.ai/wandb/wandb-lightning/reports/Image-Classification-using-PyTorch-Lightning--VmlldzoyODk1NzY
- https://github.com/ashleve/lightning-hydra-template/blob/wandb-callbacks/src/callbacks/wandb_callbacks.py#L245
"""

import lightning as L
import matplotlib.pyplot as plt
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
LightningDataModule to load Earth Observation data from GeoTIFF files using
rasterio.
"""

import math
import os
import random
Expand Down
12 changes: 6 additions & 6 deletions src/model_clay.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,12 @@ def reconstruct_and_add_encoding(
decoder_patches = torch.zeros(
(B, self.num_patches, self.dim), device=unmasked_patches.device
) # [B GL D]
decoder_patches[
batch_indices, unmasked_indices, :
] = unmasked_patches # [B GL:(1 - mask_ratio) D]
decoder_patches[
batch_indices, masked_indices, :
] = masked_patches # [B GL:mask_ratio D]
decoder_patches[batch_indices, unmasked_indices, :] = (
unmasked_patches # [B GL:(1 - mask_ratio) D]
)
decoder_patches[batch_indices, masked_indices, :] = (
masked_patches # [B GL:mask_ratio D]
)

return decoder_patches # [B GL D]

Expand Down
1 change: 1 addition & 0 deletions src/model_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Code structure adapted from Lightning project seed at
https://github.com/Lightning-AI/deep-learning-project-template
"""

import os
import re

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Checks to ensure that the hooks in callbacks can be triggered and produce the
correct output results.
"""

import tempfile

import lightning as L
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Integration test for the entire data pipeline from loading the data and
pre-processing steps, up to the DataLoader producing mini-batches.
"""

import tempfile

import lightning as L
Expand Down
1 change: 1 addition & 0 deletions src/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Based loosely on Lightning's testing method described at
https://github.com/Lightning-AI/lightning/blob/2.1.0/.github/CONTRIBUTING.md#how-to-add-new-tests
"""

import os
import tempfile

Expand Down
1 change: 1 addition & 0 deletions src/tests/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Based on advanced usage of running LightningCLI from Python at
https://lightning.ai/docs/pytorch/2.1.0/cli/lightning_cli_advanced_3.html#run-from-python
"""

import pytest

from trainer import cli_main
Expand Down
1 change: 1 addition & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Code from https://github.com/lucidrains/vit-pytorch/blob/main/vit_pytorch/simple_vit.py
"""

import torch


Expand Down