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

2.0.0b5 #351

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion awpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

from awpy.demo import Demo

__version__ = "2.0.0b4"
__version__ = "2.0.0b5"
__all__ = ["Demo"]
15 changes: 15 additions & 0 deletions awpy/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathlib import Path
from typing import Optional

import pandas as pd
from demoparser2 import DemoParser # pylint: disable=E0611
from loguru import logger

Expand All @@ -31,6 +32,9 @@
"X",
"Y",
"Z",
"velocity_X",
"velocity_Y",
"velocity_Z",
"pitch",
"yaw",
"last_place_name",
Expand Down Expand Up @@ -167,6 +171,17 @@ def _debug(self, msg: str) -> None:
if self.verbose:
logger.debug(msg)

@property
def players(self) -> pd.DataFrame:
"""Get the players in the demo.

Returns: pd.DataFrame of the players, their steam IDs and rounds.
"""
if self.ticks is not None:
ticks_not_parsed_error_msg = "Ticks are not parsed!"
raise ValueError(ticks_not_parsed_error_msg)
return self.ticks[["steamid", "name", "round", "team_name"]].drop_duplicates()

def _parse_demo(self) -> None:
"""Parse the demo header and file."""
if not self.parser:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "2.0.0b4"
release = "2.0.0b5"


# -- General configuration ---------------------------------------------------
Expand Down
Loading