diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9bd2dc7..f4acc412 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,10 +5,12 @@ repos: rev: 23.7.0 hooks: - id: black + exclude: ^(scripts/|experiment/) - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: - id: isort + exclude: ^(scripts/|experiment/) args: ["--profile", "black"] # - repo: https://github.com/pycqa/flake8 # rev: 5.0.4 diff --git a/neuralprocesses/data/antarctica.py b/neuralprocesses/data/antarctica.py index 1fda64ab..f82735f5 100644 --- a/neuralprocesses/data/antarctica.py +++ b/neuralprocesses/data/antarctica.py @@ -3,11 +3,12 @@ import netCDF4 as nc import numpy as np import pandas as pd -import torch from lab import B from plum import convert from wbml.data.eeg import load_full as load_eeg +import torch + from ..aggregate import Aggregate, AggregateInput from ..dist import AbstractDistribution, UniformContinuous, UniformDiscrete from .data import DataGenerator, apply_task diff --git a/neuralprocesses/tensorflow/nn.py b/neuralprocesses/tensorflow/nn.py index d22ec4c6..fc414dbc 100644 --- a/neuralprocesses/tensorflow/nn.py +++ b/neuralprocesses/tensorflow/nn.py @@ -3,10 +3,10 @@ import lab.tensorflow as B import numpy as np -import tensorflow as tf from plum import convert import neuralprocesses as nps +import tensorflow as tf from .. import _dispatch from ..util import compress_batch_dimensions, is_framework_module diff --git a/neuralprocesses/torch/nn.py b/neuralprocesses/torch/nn.py index 6ef7e9e8..36792e18 100644 --- a/neuralprocesses/torch/nn.py +++ b/neuralprocesses/torch/nn.py @@ -3,11 +3,11 @@ import lab.torch as B import numpy as np -import torch from plum import convert from wbml.util import inv_perm import neuralprocesses as nps +import torch from .. import _dispatch from ..util import is_framework_module diff --git a/tests/gnp/gnp.py b/tests/gnp/gnp.py index 1d0f2558..aea74b24 100644 --- a/tests/gnp/gnp.py +++ b/tests/gnp/gnp.py @@ -1,8 +1,8 @@ import lab.torch as B import pytest -import torch import neuralprocesses.gnp as gnp +import torch # noinspection PyUnresolvedReferences from .util import context_set, target_set diff --git a/tests/gnp/util.py b/tests/gnp/util.py index 60d38b54..ade8484a 100644 --- a/tests/gnp/util.py +++ b/tests/gnp/util.py @@ -1,6 +1,7 @@ import lab.torch as B import numpy.testing import pytest + import torch __all__ = ["approx", "context_set", "target_set"] diff --git a/tests/util.py b/tests/util.py index 21fdb298..276bcca1 100644 --- a/tests/util.py +++ b/tests/util.py @@ -3,12 +3,12 @@ import lab as B import pytest -import tensorflow as tf -import torch from numpy.testing import assert_allclose from plum import Dispatcher import neuralprocesses +import tensorflow as tf +import torch __all__ = ["approx", "nps", "generate_data", "remote_xfail", "remote_skip"] diff --git a/train.py b/train.py index 72a488d5..af0e844e 100644 --- a/train.py +++ b/train.py @@ -5,15 +5,15 @@ import warnings from functools import partial +import experiment as exp import lab as B import numpy as np -import torch import wbml.out as out from matrix.util import ToDenseWarning from wbml.experiment import WorkingDirectory -import experiment as exp import neuralprocesses.torch as nps +import torch __all__ = ["main"]