提交 4fbf5546 authored 作者: sentient07's avatar sentient07

Made code compliant with pep8 and added flake8-future-import to travis.yml

上级 24648eee
...@@ -37,6 +37,7 @@ install: ...@@ -37,6 +37,7 @@ install:
- source activate pyenv - source activate pyenv
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pydot; fi - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install pydot; fi
- pip install . --no-deps - pip install . --no-deps
- pip install flake8-future-import
# command to run tests # command to run tests
env: env:
......
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
from theano.configdefaults import short_platform from theano.configdefaults import short_platform
def test_short_platform(): def test_short_platform():
for r, p, a in [ # (release, platform, answer) for r, p, a in [ # (release, platform, answer)
('3.2.0-70-generic', ('3.2.0-70-generic',
......
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import unittest
import numpy
import itertools
import theano import theano
from theano.tensor.nnet.tests import test_abstract_conv from theano.tensor.nnet.tests import test_abstract_conv
......
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import unittest
import numpy
import itertools
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
......
from __future__ import absolute_import, print_function, division
import numpy import numpy
from theano import config, function, tensor from theano import config, function, tensor
from theano.sandbox import multinomial from theano.sandbox import multinomial
......
...@@ -9,7 +9,7 @@ what you are doing! ...@@ -9,7 +9,7 @@ what you are doing!
If you want to use a scalar variable in a Theano graph, If you want to use a scalar variable in a Theano graph,
you probably want to use theano.tensor.[c,z,f,d,b,w,i,l,]scalar! you probably want to use theano.tensor.[c,z,f,d,b,w,i,l,]scalar!
""" """
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function, division
from itertools import chain from itertools import chain
import math import math
......
from __future__ import division from __future__ import absolute_import, print_function, division
import theano import theano
import theano.tensor as T import theano.tensor as T
......
from __future__ import absolute_import, print_function, division
import theano import theano
import theano.tensor as T import theano.tensor as T
import unittest import unittest
......
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
from nose.plugins.skip import SkipTest from theano.sparse.utils import hash_from_sparse
import numpy from theano.sparse.tests.test_basic import as_sparse_format
import theano.sparse import theano.sparse
if not theano.sparse.enable_sparse: if not theano.sparse.enable_sparse:
raise SkipTest('Optional package sparse disabled') raise SkipTest('Optional package sparse disabled')
from theano.sparse.utils import hash_from_sparse from nose.plugins.skip import SkipTest
from theano.sparse.tests.test_basic import as_sparse_format import numpy
def test_hash_from_sparse(): def test_hash_from_sparse():
......
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function, division
import theano import theano
from theano.scalar import Composite from theano.scalar import Composite
from theano.scalar import add, sub, true_div, mul from theano.scalar import add, sub, true_div, mul
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Tests for block sparse dot Tests for block sparse dot
""" """
from __future__ import absolute_import, print_function, division from __future__ import absolute_import, print_function, division
import unittest
import numpy import numpy
from numpy.random import randn from numpy.random import randn
......
...@@ -22,7 +22,7 @@ __contact__ = "Saizheng Zhang <saizhenglisa..at..gmail.com>" ...@@ -22,7 +22,7 @@ __contact__ = "Saizheng Zhang <saizhenglisa..at..gmail.com>"
# too complex to do with the C code # too complex to do with the C code
# - "closing bracket does not match indentation of opening bracket's line" # - "closing bracket does not match indentation of opening bracket's line"
# ignored by default by pep8 # ignored by default by pep8
ignore = ('E501', 'E123', 'E133') ignore = ('E501', 'E123', 'E133', 'FI12', 'FI14', 'FI15', 'FI50', 'FI51', 'FI53')
whitelist_flake8 = [ whitelist_flake8 = [
"compat/six.py", # This is bundled code that will be deleted, don't fix it "compat/six.py", # This is bundled code that will be deleted, don't fix it
...@@ -30,8 +30,21 @@ whitelist_flake8 = [ ...@@ -30,8 +30,21 @@ whitelist_flake8 = [
"tests/__init__.py", "tests/__init__.py",
"compile/__init__.py", "compile/__init__.py",
"compile/profiling.py", "compile/profiling.py",
"compile/sandbox/__init__.py",
"compile/tests/__init__.py",
"compile/tests/test_builders.py",
"compile/tests/test_misc.py",
"compile/tests/test_monitormode.py",
"compile/tests/test_function_module.py",
"compile/tests/test_shared.py",
"compile/tests/test_ops.py",
"compile/tests/test_pfunc.py",
"compile/tests/test_debugmode.py",
"compile/tests/test_profiling.py",
"typed_list/__init__.py", "typed_list/__init__.py",
"typed_list/tests/__init__.py",
"tensor/__init__.py", "tensor/__init__.py",
"tensor/tests/__init__.py",
"tensor/tests/test_subtensor.py", "tensor/tests/test_subtensor.py",
"tensor/tests/test_utils.py", "tensor/tests/test_utils.py",
"tensor/tests/test_nlinalg.py", "tensor/tests/test_nlinalg.py",
...@@ -62,6 +75,7 @@ whitelist_flake8 = [ ...@@ -62,6 +75,7 @@ whitelist_flake8 = [
"tensor/signal/tests/test_conv.py", "tensor/signal/tests/test_conv.py",
"tensor/signal/tests/test_downsample.py", "tensor/signal/tests/test_downsample.py",
"tensor/nnet/__init__.py", "tensor/nnet/__init__.py",
"tensor/nnet/tests/__init__.py",
"tensor/nnet/tests/test_conv.py", "tensor/nnet/tests/test_conv.py",
"tensor/nnet/tests/test_neighbours.py", "tensor/nnet/tests/test_neighbours.py",
"tensor/nnet/tests/test_nnet.py", "tensor/nnet/tests/test_nnet.py",
...@@ -69,8 +83,12 @@ whitelist_flake8 = [ ...@@ -69,8 +83,12 @@ whitelist_flake8 = [
"tensor/nnet/tests/test_conv3d.py", "tensor/nnet/tests/test_conv3d.py",
"tensor/nnet/tests/speed_test_conv.py", "tensor/nnet/tests/speed_test_conv.py",
"tensor/nnet/tests/test_sigm.py", "tensor/nnet/tests/test_sigm.py",
"tensor/signal/__init__.py",
"tensor/signal/tests/__init__.py",
"scalar/__init__.py", "scalar/__init__.py",
"scalar/tests/__init__.py",
"scalar/tests/test_basic.py", "scalar/tests/test_basic.py",
"sandbox/__init__.py",
"sandbox/tests/test_theano_object.py", "sandbox/tests/test_theano_object.py",
"sandbox/tests/test_scan.py", "sandbox/tests/test_scan.py",
"sandbox/tests/test_neighbourhoods.py", "sandbox/tests/test_neighbourhoods.py",
...@@ -91,6 +109,7 @@ whitelist_flake8 = [ ...@@ -91,6 +109,7 @@ whitelist_flake8 = [
"sandbox/cuda/GpuConvTransp3D.py", "sandbox/cuda/GpuConvTransp3D.py",
"sandbox/cuda/nvcc_compiler.py", "sandbox/cuda/nvcc_compiler.py",
"sandbox/cuda/neighbours.py", "sandbox/cuda/neighbours.py",
"sandbox/cuda/tests/__init__.py",
"sandbox/cuda/tests/walltime.py", "sandbox/cuda/tests/walltime.py",
"sandbox/cuda/tests/test_gradient.py", "sandbox/cuda/tests/test_gradient.py",
"sandbox/cuda/tests/test_neighbours.py", "sandbox/cuda/tests/test_neighbours.py",
...@@ -110,6 +129,7 @@ whitelist_flake8 = [ ...@@ -110,6 +129,7 @@ whitelist_flake8 = [
"sandbox/cuda/tests/test_extra_ops.py", "sandbox/cuda/tests/test_extra_ops.py",
"sandbox/cuda/tests/test_gemmcorr3d.py", "sandbox/cuda/tests/test_gemmcorr3d.py",
"sandbox/cuda/tests/test_viewop.py", "sandbox/cuda/tests/test_viewop.py",
"sandbox/gpuarray/tests/__init__.py",
"sandbox/scan_module/scan_utils.py", "sandbox/scan_module/scan_utils.py",
"sandbox/scan_module/scan.py", "sandbox/scan_module/scan.py",
"sandbox/scan_module/scan_op.py", "sandbox/scan_module/scan_op.py",
...@@ -118,6 +138,7 @@ whitelist_flake8 = [ ...@@ -118,6 +138,7 @@ whitelist_flake8 = [
"sandbox/scan_module/tests/test_scan.py", "sandbox/scan_module/tests/test_scan.py",
"sandbox/linalg/ops.py", "sandbox/linalg/ops.py",
"sandbox/linalg/__init__.py", "sandbox/linalg/__init__.py",
"sandbox/linalg/tests/__init__.py",
"sandbox/linalg/tests/test_linalg.py", "sandbox/linalg/tests/test_linalg.py",
"sandbox/gpuarray/__init__.py", "sandbox/gpuarray/__init__.py",
"scan_module/scan_utils.py", "scan_module/scan_utils.py",
...@@ -126,15 +147,26 @@ whitelist_flake8 = [ ...@@ -126,15 +147,26 @@ whitelist_flake8 = [
"scan_module/scan_op.py", "scan_module/scan_op.py",
"scan_module/scan_perform_ext.py", "scan_module/scan_perform_ext.py",
"scan_module/__init__.py", "scan_module/__init__.py",
"scan_module/tests/__init__.py",
"scan_module/tests/test_scan.py", "scan_module/tests/test_scan.py",
"scan_module/tests/test_scan_opt.py", "scan_module/tests/test_scan_opt.py",
"misc/__init__.py",
"misc/tests/__init__.py",
"misc/tests/test_may_share_memory.py",
"misc/tests/test_pycuda_theano_simple.py",
"misc/tests/test_gnumpy_utils.py",
"misc/tests/test_pycuda_utils.py",
"misc/tests/test_cudamat_utils.py",
"misc/tests/test_pycuda_example.py",
"misc/hooks/reindent.py", "misc/hooks/reindent.py",
"misc/hooks/check_whitespace.py", "misc/hooks/check_whitespace.py",
"sparse/__init__.py", "sparse/__init__.py",
"sparse/tests/__init__.py",
"sparse/tests/test_utils.py", "sparse/tests/test_utils.py",
"sparse/tests/test_opt.py", "sparse/tests/test_opt.py",
"sparse/tests/test_basic.py", "sparse/tests/test_basic.py",
"sparse/tests/test_sp2.py", "sparse/tests/test_sp2.py",
"sparse/sandbox/__init__.py",
"sparse/sandbox/test_sp.py", "sparse/sandbox/test_sp.py",
"sparse/sandbox/sp2.py", "sparse/sandbox/sp2.py",
"sparse/sandbox/truedot.py", "sparse/sandbox/truedot.py",
...@@ -142,7 +174,10 @@ whitelist_flake8 = [ ...@@ -142,7 +174,10 @@ whitelist_flake8 = [
"gof/unify.py", "gof/unify.py",
"gof/__init__.py", "gof/__init__.py",
"gof/sandbox/equilibrium.py", "gof/sandbox/equilibrium.py",
"d3viz/__init__.py" "d3viz/__init__.py",
"d3viz/tests/__init__.py",
"gof/tests/__init__.py",
] ]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论