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

Adds MVP info #253

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Adds MVP info #253

wants to merge 20 commits into from

Conversation

agsalguero
Copy link

No description provided.

Copy link
Collaborator

@JanEricNitschke JanEricNitschke left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your contribution.

Looks very good to me already. I just added some small comments.

I also see that the python part is failing the linting.

We have established a fairly thorough formatting/linting/testing process using black, ruff, pyright, pylint and pytest.

https://github.com/pnxenopoulos/awpy/blob/main/.github/workflows/build.yml

Some of these checks you can very easily do locally via pre-commit:
https://github.com/pnxenopoulos/awpy/blob/main/.pre-commit-config.yaml
https://pre-commit.com/

For the others you would have to manually install pyright and pylint or use the CI to check if the pass.

It would be great if you could adjust your code so that it passes all of the linting steps.

awpy/parser/parse_demo.go Outdated Show resolved Hide resolved
awpy/parser/parse_demo.go Outdated Show resolved Hide resolved
awpy/parser/parse_demo.go Outdated Show resolved Hide resolved
awpy/types.py Outdated Show resolved Hide resolved
Copy link
Owner

@pnxenopoulos pnxenopoulos left a comment

Choose a reason for hiding this comment

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

Really great work on this one! I appreciate the edits on the notebooks as well. I only have a few small comments that need to be addressed, then we can merge this one into main:

  • in the GameRound struct, change MVPName, MVPSteamID, and MVPReason to be pointers by using *
  • in the awpy types file, use lowercase casing (e.g. mvpName) for the new columns

with those changes, this new feature will be complete

pnxenopoulos
pnxenopoulos previously approved these changes Sep 2, 2023
Copy link
Collaborator

@JanEricNitschke JanEricNitschke left a comment

Choose a reason for hiding this comment

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

I added some comments.

The main point is whether we should have the mvp name and steamid nullable or not. I feel that we do.

player_statistics: dict[str, PlayerStatistics],
round_statistics: RoundStatistics,
) -> None:
if "mvpName" in game_round:
Copy link
Collaborator

Choose a reason for hiding this comment

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

That check should be unnecessary since we per type definition a "GameRound" should always have that key.

But it probably does make sense to leave this in to allow the stat extraction of old json files that were produced with a previous version.

round_statistics: RoundStatistics,
) -> None:
if "mvpName" in game_round:
player_key = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could probably make use of _get_actor_key

awpy/parser/parse_demo.go Show resolved Hide resolved
awpy/types.py Show resolved Hide resolved
@JanEricNitschke
Copy link
Collaborator

What is with the golangci-lint binary file?

@JanEricNitschke
Copy link
Collaborator

Tests fail because the manual game_rounds do not include that key:

def test_suicides(self):

It might actually make sense to keep that check to not break on old parsed jsons.

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.

3 participants