Skip to content

Commit

Permalink
MAINT: Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed May 10, 2022
1 parent 554bc2b commit 0961efd
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 29 deletions.
13 changes: 7 additions & 6 deletions quantecon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
from ._filter import hamilton_filter
from ._lqnash import nnash
from ._ivp import IVP
from .lss import LinearStateSpace
from .matrix_eqn import solve_discrete_lyapunov, solve_discrete_riccati
from .quadsums import var_quadratic_sum, m_quadratic_sum
from ._lss import LinearStateSpace
from ._matrix_eqn import solve_discrete_lyapunov, solve_discrete_riccati
from ._quadsums import var_quadratic_sum, m_quadratic_sum
from ._rank_nullspace import rank_est, nullspace
from ._robustlq import RBLQ
#->Propose Delete From Top Level
#Promote to keep current examples working
from .markov import MarkovChain, random_markov_chain, random_stochastic_matrix, \
Expand All @@ -51,8 +53,7 @@
#Imports that are deprecated and will be removed in further versions
from . import (ecdf, arma, compute_fp, discrete_rv, dle, estspec, filter,
graph_tools, gridtools, inequality, ivp, kalman, lae,
lqcontrol, lqnash)
lqcontrol, lqnash, lss, matrix_eqn, quadsums, rank_nullspace,
robustlq)
#<-
from .rank_nullspace import rank_est, nullspace
from .robustlq import RBLQ
from .util import searchsorted, fetch_nb_dependencies, tic, tac, toc
6 changes: 3 additions & 3 deletions quantecon/_dle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""

import numpy as np
from .lqcontrol import LQ
from .matrix_eqn import solve_discrete_lyapunov
from .rank_nullspace import nullspace
from ._lqcontrol import LQ
from ._matrix_eqn import solve_discrete_lyapunov
from ._rank_nullspace import nullspace

class DLE(object):
r"""
Expand Down
4 changes: 2 additions & 2 deletions quantecon/_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from textwrap import dedent
import numpy as np
from scipy.linalg import inv
from quantecon.lss import LinearStateSpace
from quantecon.matrix_eqn import solve_discrete_riccati
from ._lss import LinearStateSpace
from ._matrix_eqn import solve_discrete_riccati


class Kalman:
Expand Down
2 changes: 1 addition & 1 deletion quantecon/_lqcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from textwrap import dedent
import numpy as np
from scipy.linalg import solve
from .matrix_eqn import solve_discrete_riccati, solve_discrete_riccati_system
from ._matrix_eqn import solve_discrete_riccati, solve_discrete_riccati_system
from .util import check_random_state
from .markov import MarkovChain

Expand Down
2 changes: 1 addition & 1 deletion quantecon/lqcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __getattr__(name):
f"'{name}'."
)

warnings.warn(f"Please use `{name}` from the `quantecon` namespace, the"
warnings.warn(f"Please use `{name}` from the `quantecon` namespace, the "
"`quantecon.lqcontrol` namespace is deprecated. You can use"
f" the following instead:\n `from quantecon import {name}`.",
category=DeprecationWarning, stacklevel=2)
Expand Down
3 changes: 1 addition & 2 deletions quantecon/tests/test_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"""
import numpy as np
from numpy.testing import assert_allclose
from quantecon.lss import LinearStateSpace
from quantecon import Kalman
from quantecon import LinearStateSpace, Kalman


class TestKalman:
Expand Down
3 changes: 1 addition & 2 deletions quantecon/tests/test_lqnash.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"""
import numpy as np
from numpy.testing import assert_allclose
from quantecon import nnash
from quantecon import LQ
from quantecon import nnash, LQ


class TestLQNash:
Expand Down
2 changes: 1 addition & 1 deletion quantecon/tests/test_lss.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, assert_, assert_raises
from quantecon.lss import LinearStateSpace
from quantecon import LinearStateSpace


class TestLinearStateSpace:
Expand Down
2 changes: 1 addition & 1 deletion quantecon/tests/test_lyapunov.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.matrix_eqn import solve_discrete_lyapunov
from quantecon import solve_discrete_lyapunov


def test_dlyap_simple_ones():
Expand Down
9 changes: 4 additions & 5 deletions quantecon/tests/test_matrix_eqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"""
import numpy as np
from numpy.testing import assert_allclose
from quantecon import matrix_eqn as qme
from quantecon import solve_discrete_lyapunov


def test_solve_discrete_lyapunov_zero():
'Simple test where X is all zeros'
A = np.eye(4) * .95
B = np.zeros((4, 4))

X = qme.solve_discrete_lyapunov(A, B)
X = solve_discrete_lyapunov(A, B)

assert_allclose(X, np.zeros((4, 4)))

Expand All @@ -22,7 +22,7 @@ def test_solve_discrete_lyapunov_B():
A = np.ones((2, 2)) * .5
B = np.array([[.5, -.5], [-.5, .5]])

X = qme.solve_discrete_lyapunov(A, B)
X = solve_discrete_lyapunov(A, B)

assert_allclose(B, X)

Expand All @@ -32,8 +32,7 @@ def test_solve_discrete_lyapunov_complex():
[ 1, 0]])
B = np.eye(2)

X = qme.solve_discrete_lyapunov(A, B)
X = solve_discrete_lyapunov(A, B)

assert_allclose(np.dot(np.dot(A, X), A.conj().transpose()) - X, -B,
atol=1e-15)

2 changes: 1 addition & 1 deletion quantecon/tests/test_quadsum.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.quadsums import var_quadratic_sum, m_quadratic_sum
from quantecon import var_quadratic_sum, m_quadratic_sum


def test_var_simplesum():
Expand Down
2 changes: 1 addition & 1 deletion quantecon/tests/test_rank_nullspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import numpy as np
from numpy.linalg import matrix_rank as np_rank
from quantecon.rank_nullspace import rank_est, nullspace
from quantecon import rank_est, nullspace


class TestRankNullspace:
Expand Down
2 changes: 1 addition & 1 deletion quantecon/tests/test_ricatti.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, assert_raises
from quantecon.matrix_eqn import solve_discrete_riccati
from quantecon import solve_discrete_riccati
import pytest


Expand Down
4 changes: 2 additions & 2 deletions quantecon/tests/test_robustlq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""
import numpy as np
from numpy.testing import assert_allclose, assert_
from quantecon.lqcontrol import LQ
from quantecon.robustlq import RBLQ
from quantecon import LQ
from quantecon import RBLQ


class TestRBLQControl:
Expand Down

0 comments on commit 0961efd

Please sign in to comment.