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

Imitation Dynamics and Regret Minimization models added to the repo #229

Conversation

sandeepvshenoy
Copy link
Contributor

This PR has the following changes.

Modified File
game.py -> Modified the file to add two new function calls within the code regret_minimization and imitation_dynamics

New Files
The following new files are added to attach the above functions and their corresponding test files into the repo
src/nashpy/egt/imitation_dynamics.py
src/nashpy/algorithms/regret_minimization.py

tests/unit/test_regret_minimization.py
tests/unit/test_imitation_dynamics.py

@drvinceknight
Copy link
Owner

This all looks like a good potential contribution. Nice work.

Can you how imitation dynamics is a different algorithm than fictitious play?

I'd like you to add some documentation.:

In docs/text-book add two new files (1 for each of these algorithms). Please follow the style of some of the earlier chapters like: https://nashpy.readthedocs.io/en/stable/text-book/support-enumeration.html

Also indocs/how add clear and to the point instructions on how to use the two new algorithms (you can take a look at the other how to guides to see examples of what are required).

The docs are currently failing because the formatting is not quite right. The format is checked using black. After installing black you can run it on the code base using python -m black src/ and python -m black tests/.

@drvinceknight
Copy link
Owner

The test suite is still failing at black:

 py310: commands[0]> python -m black --check src/
  would reformat /home/runner/work/Nashpy/Nashpy/src/nashpy/game.py
  
  Oh no! 💥 💔 💥
  1 file would be reformatted, 22 files would be left unchanged.

Check the black version: black==24.3.0

@sandeepvshenoy
Copy link
Contributor Author

The test suite is still failing at black:

 py310: commands[0]> python -m black --check src/
  would reformat /home/runner/work/Nashpy/Nashpy/src/nashpy/game.py
  
  Oh no! 💥 💔 💥
  1 file would be reformatted, 22 files would be left unchanged.

Check the black version: black==24.3.0

Reformatted using black version 24.3.0

Copy link
Owner

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in our call right now:

  • Let's get the CI passing :)
  • Also if you could move the modules to the learning dir that would be great.

@sandeepvshenoy
Copy link
Contributor Author

As discussed in our call right now:

  • Let's get the CI passing :)
  • Also if you could move the modules to the learning dir that would be great.

The local tox has passed all the checks; I have also moved the functions under the learning folder. Thanks.
I am afraid to add the exercise examples; I need a little more time. I assure you that I will look into that and create a new PR once I am free from the 2nd of April.

@drvinceknight drvinceknight merged commit a3fb697 into drvinceknight:main Mar 25, 2024
14 checks passed
@drvinceknight
Copy link
Owner

Thanks for the contribution @sandeepvshenoy 👍

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.

2 participants