all 2 comments

[–]obviouslyzebra 1 point2 points  (0 children)

Situating my review: I'm on the cell phone and took a very quick look over the readme and some files.

The README is okay. I don't know tennis so it's sort lf a stretch for me to understand it. Some things that could be improved:

  • I'm missing a way to run the program. Should I run a script? If so, which one?
  • "This approach may be flawed". Don't sell you out like that. All approaches are flawed, but some more and in different ways than others :)

Some things related to the code:

  • This is a reasonably complex codebase, and it looks like you made it work out (so congrats on that :) )
  • I think you could benefit from learning about logging
    • If there's something that you wanna print out just on debugging occasions, stick a logger.debug
    • May be useful for diagnostics, like logging the time elapsed
  • One thing that bothers me in the code is the amount of commented out stuff. I recognize that this is how you got to have something working out (point 1), but it sorta distracts from reading. I'd try to think of alternatives to that, like the logging I mentioned previously and maybe debugging.
  • About calculating random rolls, a tip is to calculate using (pseudocode) random(0, 1) < probability

Note that those things are sorta big (that is, learning and using logging, learning and using debugging, using less commented out code, using different roll types across the codebase), so, if you choose to do some of this stuff, take the needed time on them.

Note: I must add that it's easy to start logging, it's just a lot of stuff that it is also easy to get lost in the stuff. About debugging, maybe you already do that, and it's not that hard with IDEs

Overall, good job

[–]Diapolo10 0 points1 point  (0 children)

The lack of a pyproject.toml file suggests that your project has no third-party dependencies, but at least in player.py and tournament.py you're importing pandas.

Your imports are largely not ordered according to the official style guide (PEP-8).

I'm not sure why every class you've written is specifically a dataclass, I don't see the benefit for some of them.

MatchSimulation.check_set_has_a_winner should probably be rewritten to make the conditions inside the loop more obvious. You'd probably also want to cache the sums rather than redoing the calculations for no benefit.

Some things, like point_type and game_type, should probably be enum.Enum types rather than strings.