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 auto updates #26

Merged
merged 2 commits into from
Sep 3, 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: docformatter
args: [--in-place, --make-summary-multi-line, --close-quotes-on-newline, --wrap-summaries, "88"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.3
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -19,7 +19,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/quintenroets/package-dev-tools
rev: v0.6.3
rev: v0.6.8
hooks:
- id: infer-missing-annotations
- repo: local
Expand All @@ -39,7 +39,7 @@ repos:
always_run: true
fail_fast: true
- repo: https://github.com/quintenroets/package-dev-tools
rev: v0.6.3
rev: v0.6.8
hooks:
- id: check-coverage
- id: check-shields
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import PropertyMock, patch

import pytest

from revnets.context import context as context_
from revnets.context.context import Context
from revnets.models import Config, Evaluation, HyperParameters, Path
Expand All @@ -22,7 +23,7 @@ def _mocked_assets_path() -> Iterator[None]:
yield


@pytest.fixture()
@pytest.fixture
def test_context(
context: Context,
_mocked_assets_path: None, # noqa: PT019
Expand Down
6 changes: 3 additions & 3 deletions tests/evaluations/test_evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from typing import cast

import pytest
from torch.nn import Sequential

from revnets import evaluations, pipelines, reconstructions
from revnets.context import Context
from revnets.evaluations import analysis, attack, outputs, weights
from revnets.evaluations.evaluate import format_percentage
from revnets.networks import mininet
from revnets.pipelines import Pipeline
from torch.nn import Sequential

from tests.evaluations import verifier
from tests.evaluations.verifier import Standardization

Expand Down Expand Up @@ -40,7 +40,7 @@
)


@pytest.fixture()
@pytest.fixture
def pipeline() -> Pipeline:
return pipelines.mininet.Pipeline()

Expand Down
2 changes: 1 addition & 1 deletion tests/evaluations/test_standardize.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from types import ModuleType

import pytest

from revnets import networks
from revnets.models import Activation

from tests.evaluations.verifier import Standardization, Verifier

standardizations = (
Expand Down
3 changes: 2 additions & 1 deletion tests/evaluations/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from typing import cast

from hypothesis import given, strategies
from torch import nn

from revnets.standardization.utils import (
extract_layer,
extract_rnn_layers,
extract_scale_isomorphism_after_max_pool,
)
from revnets.standardization.weights import rnn
from torch import nn


@given(
Expand Down
3 changes: 2 additions & 1 deletion tests/evaluations/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from typing import cast

import torch
from torch.nn import Module, Sequential

from revnets import standardization
from revnets.context import context
from revnets.models import Activation
Expand All @@ -18,7 +20,6 @@
extract_internal_layers,
)
from revnets.standardization.weights import feedforward
from torch.nn import Module, Sequential


class Standardization(Enum):
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli_entry_points.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import MagicMock, patch

from package_dev_utils.tests.args import no_cli_args

from revnets.cli import entry_point, launch


Expand Down
1 change: 1 addition & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import TYPE_CHECKING

import pytest

from revnets import data

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import torch

from revnets.main.main import Experiment

gpu_available = torch.cuda.is_available()
Expand Down
1 change: 1 addition & 0 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import TYPE_CHECKING

import pytest

from revnets import pipelines

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_reconstructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import pytest
from pytorch_lightning.core.optimizer import LightningOptimizer
from torch import nn

from revnets import reconstructions
from revnets.pipelines.mininet import Pipeline
from revnets.reconstructions import Reconstructor, queries
from revnets.training.reconstructions import Network
from revnets.training.reconstructions.callbacks import LearningRateScheduler
from torch import nn

reconstruction_modules = (
reconstructions.empty,
Expand Down