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

Migrate np.dot to @ Operator #687

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
markov test update
HumphreyYang committed Jan 11, 2023
commit 8745cbd3dcbf912a4448c6153aa6ef6d1b9010fa
4 changes: 2 additions & 2 deletions quantecon/markov/tests/test_core.py
Original file line number Diff line number Diff line change
@@ -225,12 +225,12 @@ def test_left_eigen_vec(self):
stationary_distributions = self.stationary

if self.n_stat_dists == 1:
assert_allclose(np.dot(stationary_distributions, mc.P),
assert_allclose(stationary_distributions @ mc.P,
stationary_distributions, atol=self.TOL)
else:
for i in range(self.n_stat_dists):
curr_v = stationary_distributions[i, :]
assert_allclose(np.dot(curr_v, mc.P), curr_v, atol=self.TOL)
assert_allclose(curr_v @ mc.P, curr_v, atol=self.TOL)


def test_simulate_shape():
2 changes: 1 addition & 1 deletion quantecon/markov/tests/test_gth_solve.py
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ def __call__(self, x):

class StationaryDistLeftEigenVec(AddDescription):
def __call__(self, A, x):
assert_allclose(np.dot(x, A), x, atol=TOL)
assert_allclose(x @ A, x, atol=TOL)


class StationaryDistEqualToKnown(AddDescription):