Skip to content

Commit

Permalink
Apply isort to tests.compile sub-package
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonwillard committed Oct 22, 2020
1 parent c4d699c commit 6f838fe
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 47 deletions.
14 changes: 5 additions & 9 deletions tests/compile/test_builders.py
@@ -1,21 +1,17 @@
from functools import partial

import numpy as np
import pytest

import theano
import theano.tensor as tt

from tests import unittest_tools
from theano import config, shared

from theano.gradient import DisconnectedType
from theano.gof.null_type import NullType
from theano.compile import function

from theano.tensor.shared_randomstreams import RandomStreams

from theano.compile.builders import OpFromGraph

from tests import unittest_tools
from theano.gof.null_type import NullType
from theano.gradient import DisconnectedType
from theano.tensor.shared_randomstreams import RandomStreams


class TestOpFromGraph(unittest_tools.InferShapeTester):
Expand Down
11 changes: 3 additions & 8 deletions tests/compile/test_debugmode.py
@@ -1,19 +1,14 @@
import sys

import numpy as np

import pytest
from six import reraise

import theano
import theano.tensor

from six import reraise

from theano import config
from theano import gof
from theano.compile import debugmode

from tests import unittest_tools as utt
from theano import config, gof
from theano.compile import debugmode


def test_debugmode_basic():
Expand Down
2 changes: 1 addition & 1 deletion tests/compile/test_function.py
@@ -1,10 +1,10 @@
import six.moves.cPickle as pickle
import os
import shutil
import tempfile

import numpy as np
import pytest
import six.moves.cPickle as pickle

import theano
from theano.compile.io import In
Expand Down
13 changes: 6 additions & 7 deletions tests/compile/test_function_module.py
@@ -1,19 +1,18 @@
import copy
import six.moves.cPickle as pickle
import time

import numpy as np
import pytest
import time
import six.moves.cPickle as pickle

import theano
import theano.tensor as tt
import theano.gpuarray

import theano.tensor as tt
from theano import config, gof
from theano.compat import exc_message
from theano.compile import UnusedInputError, function
from theano.compile.io import In, Out
from theano.compile import function
from theano.compile import UnusedInputError
from theano.gof import MissingInputError
from theano.compat import exc_message


def PatternOptimizer(p1, p2, ign=True):
Expand Down
2 changes: 1 addition & 1 deletion tests/compile/test_misc.py
@@ -1,8 +1,8 @@
import numpy as np

from theano import tensor
from theano.compile.pfunc import pfunc
from theano.compile.sharedvalue import shared
from theano import tensor
from theano.tensor.nnet import sigmoid


Expand Down
3 changes: 1 addition & 2 deletions tests/compile/test_mode.py
Expand Up @@ -2,8 +2,7 @@

import theano
import theano.tensor as tt

from theano.compile.mode import Mode, AddFeatureOptimizer
from theano.compile.mode import AddFeatureOptimizer, Mode
from theano.gof.toolbox import NoOutputFromInplace


Expand Down
4 changes: 2 additions & 2 deletions tests/compile/test_nanguardmode.py
Expand Up @@ -3,12 +3,12 @@
"""

import logging
import pytest

import numpy as np
import pytest

import theano
import theano.tensor as tt

from theano.compile.nanguardmode import NanGuardMode


Expand Down
10 changes: 5 additions & 5 deletions tests/compile/test_ops.py
Expand Up @@ -3,15 +3,15 @@
"""


import numpy as np
import pickle
import theano

from theano import function
from theano.tensor import dmatrix, dvector
from theano.compile import as_op
import numpy as np

import theano
from tests import unittest_tools as utt
from theano import function
from theano.compile import as_op
from theano.tensor import dmatrix, dvector


# This is for test_pickle, since the function still has to be
Expand Down
10 changes: 3 additions & 7 deletions tests/compile/test_pfunc.py
@@ -1,14 +1,10 @@
import pytest
import numpy as np
import pytest

import theano
from theano.tensor import dmatrix, iscalar, lscalar, dmatrices
from theano import tensor

from theano.compile import In
from theano.compile import pfunc
from theano.compile import shared
from theano.compile import config
from theano.compile import In, config, pfunc, shared
from theano.tensor import dmatrices, dmatrix, iscalar, lscalar


def data_of(s):
Expand Down
3 changes: 1 addition & 2 deletions tests/compile/test_profiling.py
Expand Up @@ -2,11 +2,10 @@


import numpy as np
from six.moves import StringIO

import theano
import theano.tensor as tt

from six.moves import StringIO
from theano.ifelse import ifelse


Expand Down
4 changes: 1 addition & 3 deletions tests/compile/test_shared.py
Expand Up @@ -2,10 +2,8 @@
import pytest

import theano
from theano.compile.sharedvalue import SharedVariable, generic, shared
from theano.tensor import Tensor, TensorType
from theano.compile.sharedvalue import shared
from theano.compile.sharedvalue import SharedVariable
from theano.compile.sharedvalue import generic


class TestSharedVariable:
Expand Down

0 comments on commit 6f838fe

Please sign in to comment.