Skip to content

Commit

Permalink
v2.0.0b4 (#349)
Browse files Browse the repository at this point in the history
* removed bomb plant bug

* fix logic

* fixing deps

* empty instead of rowcheck

* update demoparser2, fix warning

* fix a ruff warning

* revert to 0.27

* updated event parse loop

* fixed server_cvar issue
  • Loading branch information
pnxenopoulos authored Aug 13, 2024
1 parent 6748bb6 commit 5407d51
Show file tree
Hide file tree
Showing 10 changed files with 628 additions and 556 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"] # Add 3.12 when pxr updates
python-version: ["3.10", "3.11", "3.12"] # Add 3.12 when pxr updates
timeout-minutes: 15
steps:
- name: Checkout awpy library
Expand Down
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.0b3"
__version__ = "2.0.0b4"
__all__ = ["Demo"]
5 changes: 3 additions & 2 deletions awpy/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"has_defuser",
"has_helmet",
"flash_duration",
"is_strafing",
"accuracy_penalty",
"zoom_lvl",
"ping",
Expand Down Expand Up @@ -179,9 +178,11 @@ def _parse_demo(self) -> None:
self._debug(
f"Found the following game events: {self.parser.list_game_events()}"
)
game_events = self.parser.list_game_events()
game_events = [e for e in game_events if e != "server_cvar"]
self.events = dict(
self.parser.parse_events(
self.parser.list_game_events(),
game_events,
player=self.player_props,
other=self.other_props,
)
Expand Down
2 changes: 1 addition & 1 deletion awpy/parsers/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def parse_rounds(parser: DemoParser, events: dict[str, pd.DataFrame]) -> pd.Data

# Find the bomb plant ticks
bomb_planted = events.get("bomb_planted")
if bomb_planted.shape[0] == 0:
if (bomb_planted is None) or (bomb_planted.empty):
return rounds_df

rounds_df["bomb_plant"] = rounds_df.apply(
Expand Down
2 changes: 1 addition & 1 deletion awpy/parsers/ticks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def remove_nonplay_ticks(parsed_df: pd.DataFrame) -> pd.DataFrame:
"is_waiting_for_resume",
"is_match_started",
]:
parsed_df[col] = parsed_df[col].fillna(value=False)
parsed_df.loc[:, col] = parsed_df[col].fillna(value=False)

# Remove records which do not occur in-play
parsed_df = parsed_df[
Expand Down
5 changes: 1 addition & 4 deletions awpy/vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,4 @@ def is_visible(

intersects = _traverse_bvh(bvh, point1, direction, point2)

if intersects:
return False

return True
return not intersects
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.0b3"
release = "2.0.0b4"


# -- General configuration ---------------------------------------------------
Expand Down
1,148 changes: 609 additions & 539 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 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.0b3"
version = "2.0.0b4"
description = "Counter-Strike 2 demo parsing, analysis and visualization"
readme = "README.md"
authors = [
Expand All @@ -27,16 +27,16 @@ homepage = "https://awpycs.com"
repository = "https://github.com/pnxenopoulos/awpy"

[tool.poetry.dependencies]
python = "<3.12,>=3.10"
python = "<3.13,>=3.10"
click = ">=8.1.7"
loguru = ">=0.7.2"
matplotlib = ">=3.9.0"
numpy = "^1.26.4"
pandas = ">=2.2.2"
setuptools = ">=70.1.0"
demoparser2 = ">=0.27.0"
demoparser2 = ">=0.31.0"
tqdm = "^4.66.4"
usd-core = "^24.5"
usd-core = "^24.8"
scipy = "^1.14.0"
pillow = "^10.4.0"

Expand Down
8 changes: 6 additions & 2 deletions tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def hltv_events() -> dict[str, pd.DataFrame]:
Link: https://www.hltv.org/stats/matches/mapstatsid/170716/spirit-vs-mouz
"""
parser = DemoParser("tests/spirit-vs-mouz-m1-vertigo.dem")
game_events = parser.list_game_events()
game_events = [e for e in game_events if e != "server_cvar"]
return dict(
parser.parse_events(
parser.list_game_events(),
game_events,
player=[
"X",
"Y",
Expand Down Expand Up @@ -89,9 +91,11 @@ def faceit_events() -> dict[str, pd.DataFrame]:
Link: https://www.faceit.com/en/cs2/room/1-a568cd9f-8817-4410-a3f3-2270f89135e2
"""
parser = DemoParser("tests/faceit-fpl-1-a568cd9f-8817-4410-a3f3-2270f89135e2.dem")
game_events = parser.list_game_events()
game_events = [e for e in game_events if e != "server_cvar"]
return dict(
parser.parse_events(
parser.list_game_events(),
game_events,
player=[
"X",
"Y",
Expand Down

0 comments on commit 5407d51

Please sign in to comment.