-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add TeamRatingSystem
and Rating
traits
#10
Conversation
Hi, thanks for your PR! This makes a lot of sense to me, one of the main features of this crate is supposed to be switching and comparing between rating systems easily and fast. I think it looks quite good so far, and I would be happy to merge, but I think if we were to do it, we should probably implement it for every rating system and also every type of algorithm (1v1, Team v Team, etc.). This means to also include I would be more than happy to work on doing that, but I can only start working on it properly this weekend. So please feel free to add to this in whichever way you like in the meantime. |
@jspspike Would you be okay with me adding the traits I described above to this existing PR? |
@atomflunder Sure feel free to implement them, you could add directly to this branch. I think your proposals make sense, I guess the concern would be for edge cases where there isn't an uncertainty how to handle those cases. My opinion would be to omit |
My thought process on this was to add a disclaimer in the documentation, and just return 0 for the cases where there is no uncertainty value. To be honest I think both approaches are not 100% optimal, but I personally would prefer adding it. We can always change that later though, if it does end up confusing. |
- RatingSystem - RatingPeriodSystem - MultiTeamRatingSystem
@jspspike I added the traits, let me know what you think and if you spot any mistakes. This should be fairly straightforward to add to the other algorithms from here on out, the hardest part is probably the design choices. Edit: Oh and ignore that code coverage report obviously for now. |
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.
One small change, otherwise it looks good to me
src/lib.rs
Outdated
fn rating(&self) -> f64; | ||
/// A value for the uncertainty of a players rating. | ||
/// If the algorithm does not include an uncertainty value, this will return `0.0` instead. | ||
fn uncertainty(&self) -> f64; |
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 think an option makes more sense here
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.
Yeah, I think you are right, this makes a lot more sense.
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #10 +/- ##
===========================================
- Coverage 100.00% 94.27% -5.73%
===========================================
Files 13 13
Lines 7533 7987 +454
===========================================
- Hits 7533 7530 -3
- Misses 0 457 +457
☔ View full report in Codecov by Sentry. |
@jspspike So if you are okay with it, I would merge this, probably add some more tests and then make a new release for it. Thank you again for your contribution! |
@atomflunder Looks good to me, thanks for taking the time and adding these traits |
commit 65176ab Author: atomflunder <[email protected]> Date: Sun Jun 4 21:30:29 2023 +0200 Bump version to 0.25 commit 5432b61 Author: atomflunder <[email protected]> Date: Sun Jun 4 21:27:42 2023 +0200 Fix some new clippy lints commit be3a6df Author: atomflunder <[email protected]> Date: Sun Jun 4 21:21:07 2023 +0200 Add tests for traits commit 1276e87 Merge: 398d621 73ecde9 Author: atomflunder <[email protected]> Date: Sun Jun 4 20:33:50 2023 +0200 Merge pull request #10 from jspspike/master Add `TeamRatingSystem` and `Rating` traits commit 73ecde9 Author: atomflunder <[email protected]> Date: Sun Jun 4 20:26:53 2023 +0200 Use option return type for uncertainty method commit be3f64a Author: atomflunder <[email protected]> Date: Sat Jun 3 12:17:12 2023 +0200 Add traits for remaining algorithms commit 8da48e3 Author: atomflunder <[email protected]> Date: Fri Jun 2 22:35:42 2023 +0200 Add remaining traits for TrueSkill algorithm - RatingSystem - RatingPeriodSystem - MultiTeamRatingSystem commit 03bb12b Author: jspspike <[email protected]> Date: Wed May 31 13:40:21 2023 -0500 Add TeamRatingSystem trait commit 398d621 Author: atomflunder <[email protected]> Date: Fri May 19 18:40:41 2023 +0200 Update docs commit f6e0e38 Author: atomflunder <[email protected]> Date: Thu Mar 9 15:09:19 2023 +0100 Update TrueSkill documentation links
Each rating system has gone through the trouble having a similar or same interface so I thought it would be beneficial to add traits for the rating system and rating type. This way users could use the crate without having to specify the rating system and easily switch between different ones.
This PR only impls for trueskill at the moment