Skip to content

TEST: Increase coverage on game_theory - #343

Merged
mmcky merged 8 commits into
QuantEcon:masterfrom
QBatista:tests_increase_coverage
Oct 1, 2017
Merged

mmcky merged 8 commits into
QuantEcon:masterfrom
QBatista:tests_increase_coverage

Conversation

@QBatista

Copy link
Copy Markdown
Member

Adds tests to increase the coverage on game_theory

@coveralls

Copy link
Copy Markdown

Coverage Status

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

@oyamad oyamad left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member Author

@oyamad This is ready.

@oyamad oyamad left a comment

Copy link
Copy Markdown
Member

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

mmcky commented Oct 1, 2017

Copy link
Copy Markdown
Contributor

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