-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
TEST: Increase coverage on game_theory #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I only have minor comments.
unflattened_actions = [[1/3, 1/3, 1/3], [1/2, 1/2]] | ||
flattened_actions = [1/3, 1/3, 1/3, 1/2, 1/2] | ||
test_obj = _flatten_action_profile(unflattened_actions, [0, 3, 5]) | ||
assert_allclose(test_obj, flattened_actions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be assert_array_equal
?
from quantecon.game_theory import Player, NormalFormGame, mclennan_tourky | ||
from quantecon.game_theory.mclennan_tourky import _best_response_selection, \ | ||
_flatten_action_profile, \ | ||
_is_epsilon_nash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be something like
from quantecon.game_theory.mclennan_tourky import (
_best_response_selection, _flatten_action_profile, _is_epsilon_nash
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @oyamad I didn't know you could use (
like this.
test_obj = _best_response_selection([1/3, 1/3, 1/3, 1/2,1/2], g) | ||
expected_output = np.array([0., 1., 0., 0., 1.]) | ||
|
||
assert_allclose(test_obj, expected_output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be assert_array_equal
?
@oyamad This is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Adds tests to increase the coverage on game_theory