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

351 bug check for chance information sets in mixed behavior profiles #377

Conversation

rahulsavani
Copy link
Member

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..

@rahulsavani rahulsavani requested a review from tturocy October 9, 2023 12:37
@rahulsavani rahulsavani linked an issue Oct 9, 2023 that may be closed by this pull request
Copy link
Member

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


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

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.

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

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.

@@ -1,5 +1,4 @@
import unittest

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

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
@rahulsavani rahulsavani force-pushed the 351-bug-check-for-chance-information-sets-in-mixed-behavior-profiles branch from 5457a20 to fc9734a Compare October 11, 2023 14:06
@tturocy tturocy merged commit 34fad92 into master Oct 11, 2023
@tturocy tturocy deleted the 351-bug-check-for-chance-information-sets-in-mixed-behavior-profiles branch October 12, 2023 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Check for chance information sets in mixed behavior profiles
2 participants