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

Fix all F401 unused imports #467

Merged
merged 8 commits into from
Jan 2, 2019
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ branches:
- master

install:
- pip install -U pip nose coveralls coverage numpy scipy pandas numba sympy ipython statsmodels
- pip install -U pip nose coveralls coverage numpy scipy pandas numba sympy ipython statsmodels flake8
- pip install tables
- python setup.py install

script:
- flake8 --select F401 quantecon
- nosetests --with-coverage -a "!slow" --cover-package=quantecon

after_success:
Expand Down
1 change: 1 addition & 0 deletions quantecon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Import the main names to top level.
"""
Expand Down
2 changes: 1 addition & 1 deletion quantecon/arma.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""
import numpy as np
from numpy import conj, pi
from numpy import conj
from .util import check_random_state


Expand Down
1 change: 1 addition & 0 deletions quantecon/game_theory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Game Theory SubPackage

Expand Down
1 change: 1 addition & 0 deletions quantecon/game_theory/game_generators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
game_theory.game_generators

Expand Down
2 changes: 1 addition & 1 deletion quantecon/game_theory/tests/test_repeated_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import numpy as np
from numpy.testing import assert_allclose
from quantecon.game_theory import Player, NormalFormGame, RepeatedGame
from quantecon.game_theory import NormalFormGame, RepeatedGame


class TestAS():
Expand Down
1 change: 1 addition & 0 deletions quantecon/markov/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Markov Chain SubPackge API
"""
Expand Down
1 change: 0 additions & 1 deletion quantecon/markov/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
import numpy as np
import scipy.sparse
from numba import jit

from .core import MarkovChain
from .ddp import DiscreteDP
Expand Down
2 changes: 0 additions & 2 deletions quantecon/markov/tests/test_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_allclose
from quantecon.markov import tauchen, rouwenhorst
#from quantecon.markov.approximation import rouwenhorst

Expand Down
2 changes: 1 addition & 1 deletion quantecon/markov/tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from numpy.testing import (
assert_array_equal, assert_raises, assert_array_almost_equal_nulp
)
from nose.tools import eq_, ok_, raises
from nose.tools import eq_, ok_

from quantecon.markov import (
random_markov_chain, random_stochastic_matrix, random_discrete_dp
Expand Down
1 change: 1 addition & 0 deletions quantecon/optimize/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Initialization of the optimize subpackage
"""
Expand Down
2 changes: 1 addition & 1 deletion quantecon/optimize/scalar_maximization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from numba import jit, njit
from numba import njit

@njit
def brent_max(func, a, b, args=(), xtol=1e-5, maxiter=500):
Expand Down
1 change: 1 addition & 0 deletions quantecon/random/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
Random SubPackage
=================
Expand Down
1 change: 1 addition & 0 deletions quantecon/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
"""
namespace for quantecon.tests

Expand Down
1 change: 0 additions & 1 deletion quantecon/tests/test_arma.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_array_equal
Expand Down
3 changes: 0 additions & 3 deletions quantecon/tests/test_dle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
"""

import sys
import os
import unittest
import numpy as np
from scipy.linalg import LinAlgError
from numpy.testing import assert_allclose
from numpy import dot
from quantecon.dle import DLE

ATOL = 1e-10
Expand Down
2 changes: 0 additions & 2 deletions quantecon/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

"""

import sys
import os
import unittest
import pandas as pd
import numpy as np
from numpy.testing import assert_allclose
Expand Down
2 changes: 0 additions & 2 deletions quantecon/tests/test_gridtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_performance_C():
# print(prod.shape)

# compute the same produce using numpy:
import numpy

t3 = time.time()
for i in range(100):
Expand Down Expand Up @@ -108,7 +107,6 @@ def test_performance_F():
# print(prod.shape)

# compute the same produce using numpy:
import numpy

t3 = time.time()
for i in range(100):
Expand Down
1 change: 0 additions & 1 deletion quantecon/tests/test_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_allclose
Expand Down
2 changes: 0 additions & 2 deletions quantecon/tests/test_lqcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

"""
import sys
import os
import unittest
import numpy as np
from scipy.linalg import LinAlgError
from numpy.testing import assert_allclose
from numpy import dot
from quantecon.lqcontrol import LQ
Expand Down
1 change: 0 additions & 1 deletion quantecon/tests/test_lqnash.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_allclose
Expand Down
1 change: 0 additions & 1 deletion quantecon/tests/test_lss.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_allclose
Expand Down
4 changes: 0 additions & 4 deletions quantecon/tests/test_matrix_eqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
Tests for quantecon.util

"""
from collections import Counter
import unittest
import numpy as np
from numpy.testing import assert_allclose
from nose.plugins.attrib import attr
import pandas as pd
from quantecon import matrix_eqn as qme


Expand Down
5 changes: 1 addition & 4 deletions quantecon/tests/test_quadsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Tests for quadsums.py

"""
import sys
import os
import unittest
import numpy as np
from numpy.testing import assert_allclose
from quantecon.quadsums import var_quadratic_sum, m_quadratic_sum
Expand Down Expand Up @@ -63,4 +60,4 @@ def test_m_matsum():
test_simplesum()
test_identitysum()
test_m_simplesum()
test_m_identitysum
test_m_identitysum
2 changes: 0 additions & 2 deletions quantecon/tests/test_rank_nullspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

"""
import sys
import os
import unittest
import numpy as np
from numpy.linalg import matrix_rank as np_rank
from numpy.testing import assert_allclose
from quantecon.rank_nullspace import rank_est, nullspace


Expand Down
2 changes: 0 additions & 2 deletions quantecon/tests/test_robustlq.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

"""
import sys
import os
import unittest
import numpy as np
from scipy.linalg import LinAlgError
from numpy.testing import assert_allclose
from quantecon.lqcontrol import LQ
from quantecon.robustlq import RBLQ
Expand Down
3 changes: 2 additions & 1 deletion quantecon/util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# flake8: noqa
"""
API for QuantEcon Utilities
"""

from .array import searchsorted
from .notebooks import fetch_nb_dependencies
from .random import check_random_state
from .timing import tic, tac, toc, loop_timer
from .timing import tic, tac, toc, loop_timer
1 change: 0 additions & 1 deletion quantecon/util/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

"""

import numpy as np
from numba import jit

# ----------------- #
Expand Down
1 change: 0 additions & 1 deletion quantecon/util/notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""

import os
import warnings

#-Remote Structure-#
REPO = "https://github.com/QuantEcon/QuantEcon.notebooks"
Expand Down
2 changes: 1 addition & 1 deletion quantecon/util/tests/test_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time
from sys import platform
from numpy.testing import assert_allclose
from nose.tools import eq_, ok_
from nose.tools import ok_
from quantecon.util import tic, tac, toc, loop_timer


Expand Down