Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#206)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.9 → v0.3.5](astral-sh/ruff-pre-commit@v0.1.9...v0.3.5)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Apr 1, 2024
1 parent 1fe4fdf commit 97b6a0f
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 7 deletions.
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

0 comments on commit 97b6a0f

Please sign in to comment.