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

Feat: add mmr for Players and Observers #190

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ def __init__(self, uid, init_data):
#: This is deprecated because it doesn't actually work.
self.recorder = None

#: The user's mmr at the time of the game
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is mmr and why does the reader need to guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MMR stands for Matchmaking Rating, indicating the skill level on SC2 ladder. I assume this is a common abbreviation like APM under sc2 context, but now I dont know whether we should explain it in comment or not.

#: Currently, there are three cases observed for a user that does not have a current mmr:
#: 1. The user has no 'scaled_rating' key in their init_data,
#: 2. The user has a None value for their 'scaled_rating' key, or
#: 3. The user has a negative rating, often -36400.
#: For ease of use, this property will return None in both cases.
if (
"scaled_rating" in init_data
and init_data["scaled_rating"] is not None
and init_data["scaled_rating"] > 0
):
self.mmr = init_data["scaled_rating"]
else:
self.mmr = None
NumberPigeon marked this conversation as resolved.
Show resolved Hide resolved

@property
def url(self):
"""
Expand Down