-
Notifications
You must be signed in to change notification settings - Fork 154
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
351 bug check for chance information sets in mixed behavior profiles #377
351 bug check for chance information sets in mixed behavior profiles #377
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.
A few really minor things.
Yes please if you could squash and rebase.
For ChangeLog, you can just add a brief line noting this under the 16.1.0a4 changes that are already listed there.
src/pygambit/tests/test_behav.py
Outdated
|
||
def test_infoset_value_with_chance_player_infoset(self): | ||
"""Test to ensure that infoset_value called with an infoset of the chance player | ||
raises a ValueError""" |
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.
Style for triple-quoted strings that are over more than one line usually put the closing triple quote on its own line.
src/pygambit/behav.pxi
Outdated
return self._payoff(self.game._resolve_player(player, 'payoff')) | ||
resolved_player = self.game._resolve_player(player, 'payoff') | ||
if resolved_player.is_chance: | ||
raise ValueError("It is not possible to call payoff for the chance player") |
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.
I would suggest saying "payoff() is not defined for the chance player". After all it's possible to call the function (the calling code just did so!). It's just that it's not a well-defined concept. Similar comment on the other functions.
src/pygambit/tests/test_behav.py
Outdated
@@ -1,5 +1,4 @@ | |||
import unittest | |||
|
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.
The space between the imports was intentional. The general pattern is
imports of standard library
<blank line>
imports of third-party modules
<blank line>
imports of modules from this package
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.
Understood, thanks.
Actually, I did not remove a blank link. I included the unittest import, along with inheriting from unittest.TestCase, which was not done only for test_behav.py and test_exten.py when I created my branch. I see that you also fixed this for test_behav.py and moved test_exten.py to pytest.
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.
I see in the changelog: "Migrated to pytest for testing of pygambit."
There's a few that have not been converted: test_behav.py, test_nash.py, test_game_resolve_functions.py, test_file.py.
…w value errors when called with the chance player
5457a20
to
fc9734a
Compare
I have implemented the discussed changes and believe the code in the final commit is good to be merged now; happy to rebase if you suggest that, and to a changelog entry, but would need some guidance on the latter..