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

TEST: Increase coverage on game_theory #343

Merged
merged 8 commits into from
Oct 1, 2017

Conversation

QBatista
Copy link
Member

Adds tests to increase the coverage on game_theory

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 94.047% when pulling 917b473 on QBatista:tests_increase_coverage into ecbf2b2 on QuantEcon:master.

Copy link
Member

@oyamad oyamad left a 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)
Copy link
Member

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
Copy link
Member

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
)

Copy link
Contributor

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)
Copy link
Member

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?

@mmcky mmcky added the in-work label Sep 28, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.5%) to 94.094% when pulling cf32a4b on QBatista:tests_increase_coverage into ecbf2b2 on QuantEcon:master.

@QBatista
Copy link
Member Author

@oyamad This is ready.

Copy link
Member

@oyamad oyamad left a 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.

@oyamad oyamad added ready and removed in-work labels Sep 30, 2017
@mmcky
Copy link
Contributor

mmcky commented Oct 1, 2017

Thanks @QBatista and @oyamad

@mmcky mmcky merged commit 21c1a94 into QuantEcon:master Oct 1, 2017
@QBatista QBatista deleted the tests_increase_coverage branch October 10, 2018 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants