Skip to content

Commit

Permalink
beta5, players prop, demoparser upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pnxenopoulos committed Sep 16, 2024
1 parent 5407d51 commit d982127
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
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"]
14 changes: 14 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 Down Expand Up @@ -167,6 +168,19 @@ 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 not self.ticks:
ticks_not_parsed_error_msg = "Ticks are not parsed!"
raise ValueError(ticks_not_parsed_error_msg)
return self.ticks[
["steam_id", "name", "round_num", "side"]
].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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "awpy"
version = "2.0.0b4"
version = "2.0.0b5"
description = "Counter-Strike 2 demo parsing, analysis and visualization"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -34,7 +34,7 @@ matplotlib = ">=3.9.0"
numpy = "^1.26.4"
pandas = ">=2.2.2"
setuptools = ">=70.1.0"
demoparser2 = ">=0.31.0"
demoparser2 = ">=0.32.2"
tqdm = "^4.66.4"
usd-core = "^24.8"
scipy = "^1.14.0"
Expand Down

0 comments on commit d982127

Please sign in to comment.