Repository: lightly-ai/lightly (branch: ersi-lig-3910-update-mae-benchmark-code)
Commit date: 2024-01-08T18:10:33Z

Workflow file: .github/workflows/test_code_format.yml (Code Format Check)
name: Code Format Check

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  test:
    name: Check
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
    - name: Checkout Code
      uses: actions/checkout@v3
    - name: Hack to get setup-python to work on nektos/act
      run: |
        if [ ! -f "/etc/lsb-release" ] ; then
          echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
        fi
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: "3.7"
    - uses: actions/cache@v2
      with:
        path: ${{ env.pythonLocation }}
        key: cache_v2_${{ env.pythonLocation }}-${{ hashFiles('requirements/**') }}
    - name: Install Dependencies and lightly
      run: pip install -e '.[all]'
    - name: Run Format Check
      run: |
        make format-check
    - name: Run Type Check
      run: |
        make type-check

env:
  PIP_INDEX_URL: http://localhost:8629/2024-01-08
  UV_INDEX_URL: http://localhost:8629/2024-01-08


Failed build logs:
step_name: Check/7_Run Format Check.txt
log: ##[group]Run make format-check
[36;1mmake format-check[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.7.17/x64
  PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib/pkgconfig
  Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.7.17/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.7.17/x64/lib
##[endgroup]
⚫ Checking code format...
isort --check-only --diff .
ERROR: /home/runner/work/lightly/lightly/docs/source/getting_started/benchmarks/imagenette_benchmark.py Imports are incorrectly sorted and/or formatted.
--- /home/runner/work/lightly/lightly/docs/source/getting_started/benchmarks/imagenette_benchmark.py:before	2024-01-08 18:14:31.536514
+++ /home/runner/work/lightly/lightly/docs/source/getting_started/benchmarks/imagenette_benchmark.py:after	2024-01-08 18:16:08.310119
@@ -61,8 +61,8 @@
 """
 import copy
 import os
+import sys
 import time
-import sys
 
 import numpy as np
 import pytorch_lightning as pl
@@ -94,7 +94,12 @@
     VICRegLoss,
 )
 from lightly.models import modules, utils
-from lightly.models.modules import heads, masked_autoencoder, masked_autoencoder_timm, memory_bank
+from lightly.models.modules import (
+    heads,
+    masked_autoencoder,
+    masked_autoencoder_timm,
+    memory_bank,
+)
 from lightly.transforms import (
     BYOLTransform,
     BYOLView1Transform,
Skipped 2 files
make: *** [Makefile:45: format-check] Error 1
##[error]Process completed with exit code 2.


Changed files:
docs/source/getting_started/benchmarks/imagenette_benchmark.py

Fix diff:
diff --git a/docs/source/getting_started/benchmarks/imagenette_benchmark.py b/docs/source/getting_started/benchmarks/imagenette_benchmark.py
index 6dfecb1f..4858e8cf 100644
--- a/docs/source/getting_started/benchmarks/imagenette_benchmark.py
+++ b/docs/source/getting_started/benchmarks/imagenette_benchmark.py
@@ -61,8 +61,8 @@ Results (4.5.2023):
 """
 import copy
 import os
-import time
 import sys
+import time
 
 import numpy as np
 import pytorch_lightning as pl
@@ -75,7 +75,9 @@ from pytorch_lightning.loggers import TensorBoardLogger
 try:
     from timm.models import vision_transformer
 except ImportError:
-    print("TIMM is not available. Please install in order to run this benchmark for MAE.")
+    print(
+        "TIMM is not available. Please install in order to run this benchmark for MAE."
+    )
     sys.exit(1)
 
 from lightly.data import LightlyDataset
@@ -94,7 +96,12 @@ from lightly.loss import (
     VICRegLoss,
 )
 from lightly.models import modules, utils
-from lightly.models.modules import heads, masked_autoencoder, masked_autoencoder_timm, memory_bank
+from lightly.models.modules import (
+    heads,
+    masked_autoencoder,
+    masked_autoencoder_timm,
+    memory_bank,
+)
 from lightly.transforms import (
     BYOLTransform,
     BYOLView1Transform,