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

add win probability feature to awpy2 #327

Open
wants to merge 164 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
ef530d6
new awpy
pnxenopoulos Oct 14, 2023
20b9487
fix
pnxenopoulos Oct 17, 2023
4afdda8
get ticks
pnxenopoulos Oct 20, 2023
1d2d32b
add major events
pnxenopoulos Oct 23, 2023
80e3df7
added docs
pnxenopoulos Oct 24, 2023
aff54fb
save
pnxenopoulos Oct 25, 2023
367ba8c
save
pnxenopoulos Oct 27, 2023
ac89fcc
start tests
pnxenopoulos Oct 27, 2023
a213614
black and tests
pnxenopoulos Oct 27, 2023
a712274
reworking tests, linting
pnxenopoulos Oct 30, 2023
f57cc6a
new cicd without go checking
pnxenopoulos Oct 30, 2023
ca2c8fc
black formatter
pnxenopoulos Oct 30, 2023
4f76fe4
make ruff happy
pnxenopoulos Oct 30, 2023
f1725b5
make pyright happy
pnxenopoulos Oct 30, 2023
6f26274
just for tests to pass
pnxenopoulos Oct 30, 2023
05356a6
weapon fire and flash
pnxenopoulos Nov 3, 2023
208595c
better exceptions
pnxenopoulos Nov 3, 2023
a7d966b
readme
pnxenopoulos Nov 3, 2023
3ff0b8f
more readme changes
pnxenopoulos Nov 3, 2023
342981f
more readme
pnxenopoulos Nov 3, 2023
5b3059f
Readme
pnxenopoulos Nov 3, 2023
b48e364
test rm
pnxenopoulos Nov 3, 2023
1b40f6e
center
pnxenopoulos Nov 3, 2023
df91c2b
more readme fix
pnxenopoulos Nov 3, 2023
4cd24ed
Shrink
pnxenopoulos Nov 3, 2023
1d55ad4
style test
pnxenopoulos Nov 3, 2023
a02859e
maybe
pnxenopoulos Nov 3, 2023
8e7a301
no table
pnxenopoulos Nov 3, 2023
9b787aa
testing
pnxenopoulos Nov 3, 2023
c29e203
Spelling
pnxenopoulos Nov 3, 2023
71b16ba
markdown
pnxenopoulos Nov 3, 2023
b262ae2
ok, you win gh
pnxenopoulos Nov 3, 2023
853c02c
condense
pnxenopoulos Nov 3, 2023
11cd5a5
add 3.10, 3.9
pnxenopoulos Nov 3, 2023
0c0085d
keep workin on stats
pnxenopoulos Nov 15, 2023
84f9181
start of stats module
pnxenopoulos Nov 16, 2023
433eeaa
fix casing
pnxenopoulos Nov 16, 2023
b0276c7
Added sides, kast first pass
pnxenopoulos Nov 18, 2023
eaf0ef2
mucking about
pnxenopoulos Jan 21, 2024
d583a51
continued refactors
pnxenopoulos Jan 22, 2024
875976b
r e f a c t o r
pnxenopoulos Jan 23, 2024
bf41fb7
fixin
pnxenopoulos Jan 23, 2024
22e1b81
more stable
pnxenopoulos Jan 23, 2024
b3b7c5d
save, wip
pnxenopoulos Jan 24, 2024
c8565f6
slim
pnxenopoulos Jan 27, 2024
9a9acf4
fix imports
pnxenopoulos Jan 27, 2024
564b5c5
Reduce imports
pnxenopoulos Jan 27, 2024
842426a
will this delete the cache?
pnxenopoulos Jan 27, 2024
2d32b87
Again
pnxenopoulos Jan 27, 2024
5dd6e59
Remvoe sphinx
pnxenopoulos Jan 27, 2024
3e7f13b
fixing imports
pnxenopoulos Jan 27, 2024
51a34f1
Another fix
pnxenopoulos Jan 27, 2024
2107f0c
vibing
pnxenopoulos Jan 28, 2024
84c2fec
fixin
pnxenopoulos Feb 4, 2024
169bc9d
update dev dependencie
pnxenopoulos Feb 4, 2024
43c4038
fixing rounds
pnxenopoulos Feb 4, 2024
1dbfe86
format
pnxenopoulos Feb 4, 2024
4f194b3
tests, docs
pnxenopoulos Feb 5, 2024
3728464
lintin
pnxenopoulos Feb 5, 2024
7fcc1d3
better readme
pnxenopoulos Feb 5, 2024
3eea116
more readme edits
pnxenopoulos Feb 5, 2024
8dc5033
added faceit demo
pnxenopoulos Feb 6, 2024
e8b6d99
lint
pnxenopoulos Feb 6, 2024
0d2c516
make ruff happy
pnxenopoulos Feb 6, 2024
67dc787
add assist count
pnxenopoulos Feb 6, 2024
24cd882
ruff
pnxenopoulos Feb 6, 2024
b0de5f8
r e o r g
pnxenopoulos Feb 6, 2024
9e13f34
update for eugene
pnxenopoulos Feb 8, 2024
69b958d
i love programming
pnxenopoulos Feb 8, 2024
ebbb251
black
pnxenopoulos Feb 8, 2024
ca5ca93
more formatting
pnxenopoulos Feb 8, 2024
18e8c07
fix test
pnxenopoulos Feb 8, 2024
07a1c97
Awpy2 round parsing (#320)
pnxenopoulos Feb 15, 2024
0ade703
fix column names
pnxenopoulos Feb 15, 2024
a2e9eca
fix to keyerror
pnxenopoulos Feb 15, 2024
f591f07
add round id parsing
pnxenopoulos Feb 17, 2024
2eb8dba
fix
pnxenopoulos Feb 17, 2024
62bde67
fixin
pnxenopoulos Feb 17, 2024
dbb4387
Readme and reqs
pnxenopoulos Feb 17, 2024
abafc89
00_Parsing_a_CS2_Demofile Notebook for Awpy2 Branch (#321)
adisujithkumar Feb 18, 2024
176f188
add bomb plant to round info
pnxenopoulos Feb 18, 2024
4d94417
lint
pnxenopoulos Feb 18, 2024
c94c121
fixin
pnxenopoulos Feb 18, 2024
e061a2a
fix readme
pnxenopoulos Feb 18, 2024
ac6db3a
fix tests
pnxenopoulos Feb 18, 2024
32bd15e
new new
pnxenopoulos Feb 21, 2024
a150ba0
converter tests
pnxenopoulos Feb 21, 2024
1dd194c
fix
pnxenopoulos Feb 21, 2024
88a555a
keep testing parsers
pnxenopoulos Feb 21, 2024
4c584f0
add clan name
pnxenopoulos Feb 21, 2024
5f167aa
kill and damage test on new hltv
pnxenopoulos Feb 21, 2024
cf13609
fix error
pnxenopoulos Feb 21, 2024
12646a2
fix test
pnxenopoulos Feb 21, 2024
cc0bc33
fix lint
pnxenopoulos Feb 21, 2024
16f3f25
rework Demo
pnxenopoulos Feb 22, 2024
18fcc35
change to new demoparser version
pnxenopoulos Mar 3, 2024
060e760
added basic rounds
pnxenopoulos Mar 7, 2024
e9dff48
update python reqs, fix bugs, add logging
pnxenopoulos Mar 24, 2024
0d4927e
Cleaning damages_df (#324)
hojlund123 Mar 26, 2024
c6b558f
adr, begin kast, round number, version
pnxenopoulos Mar 26, 2024
82d6414
fix ruff
pnxenopoulos Mar 26, 2024
c7956eb
fix demo version
pnxenopoulos Mar 26, 2024
c5604c8
remove version
pnxenopoulos Mar 26, 2024
703c2d7
fixing bugs
pnxenopoulos Mar 28, 2024
d1bffc5
Merge branch 'awpy2' of https://github.com/pnxenopoulos/awpy into awpy2
pnxenopoulos Mar 28, 2024
f006be7
fix
pnxenopoulos Mar 28, 2024
e8db2a6
removed map_bombsites
pnxenopoulos Mar 28, 2024
37de290
stats module, impact and rating
pnxenopoulos Mar 29, 2024
2e23f15
test release
pnxenopoulos Apr 3, 2024
47609bb
maybe
pnxenopoulos Apr 3, 2024
82ca3c1
testing actions
pnxenopoulos Apr 3, 2024
7287443
Test push
pnxenopoulos Apr 3, 2024
449ed99
fix python versions
pnxenopoulos Apr 3, 2024
b0c6957
on push
pnxenopoulos Apr 3, 2024
d3f4303
fix artifact names
pnxenopoulos Apr 3, 2024
e213e21
better workflow
pnxenopoulos Apr 3, 2024
42bcb39
Spelling
pnxenopoulos Apr 3, 2024
11656e3
mov e to token
pnxenopoulos Apr 3, 2024
7695e16
test repository
pnxenopoulos Apr 3, 2024
d4c14d1
actions env
pnxenopoulos Apr 3, 2024
1cbfd88
Test
pnxenopoulos Apr 3, 2024
4e496d1
test new flow
pnxenopoulos Apr 3, 2024
2bc8383
rc
pnxenopoulos Apr 3, 2024
baacda6
push
pnxenopoulos Apr 3, 2024
1f34482
version change
pnxenopoulos Apr 3, 2024
fe92f64
will this work
pnxenopoulos Apr 3, 2024
4db1136
testin
pnxenopoulos Apr 3, 2024
5e6c336
no deps
pnxenopoulos Apr 3, 2024
f1f2f4d
actual no deps
pnxenopoulos Apr 3, 2024
1e14d66
better pydantic model
pnxenopoulos Apr 3, 2024
54bf297
Fix formatting
pnxenopoulos Apr 3, 2024
b276964
release workflow
pnxenopoulos Apr 3, 2024
fecf0d8
fix on triggers
pnxenopoulos Apr 3, 2024
d554e32
correct environment
pnxenopoulos Apr 3, 2024
cc23c2a
fix failed tests
pnxenopoulos Apr 3, 2024
0fdd6a9
fix test imports
pnxenopoulos Apr 3, 2024
513f48d
small change
pnxenopoulos Apr 4, 2024
721a0a5
add win probability feature to awpy2
rorybush Apr 9, 2024
5dbe080
move feature matrix to its own function
rorybush Apr 13, 2024
84c3f52
update reqs and readme
pnxenopoulos Apr 18, 2024
a5b531e
Readme center and armor
pnxenopoulos Apr 18, 2024
324acf2
more readme changes
pnxenopoulos Apr 18, 2024
d7b6375
only build on code or test changes
pnxenopoulos Apr 18, 2024
8793ecf
pyproject changes
pnxenopoulos Apr 18, 2024
0666dbf
Armor value
pnxenopoulos Apr 18, 2024
84c2ab8
fixing armor, adding demo code
pnxenopoulos Apr 18, 2024
f8d32de
fixing img
pnxenopoulos Apr 18, 2024
efae1f2
img md
pnxenopoulos Apr 18, 2024
03d784f
more img md
pnxenopoulos Apr 18, 2024
967adcd
forget gif
pnxenopoulos Apr 18, 2024
b54bfed
Merge remote-tracking branch 'upstream/awpy2' into awpy2
rorybush Apr 18, 2024
df80fba
refactored code following feedback
rorybush Apr 19, 2024
2a32735
add armor to feature matrix
rorybush Apr 19, 2024
6447549
add mock win probability function implementation
rorybush Apr 19, 2024
be1d366
add mock T_win_probability
rorybush Apr 20, 2024
df0a1b7
add mock weights
rorybush Apr 20, 2024
6baea08
add initial tests for win prob module
rorybush Apr 22, 2024
dc7ff6c
functions now return a pandas dataframe instead of a list
rorybush Jun 23, 2024
69ed57c
functions now return a pandas df instead of a List
rorybush Jun 27, 2024
1187326
Awpy 2 (#301)
pnxenopoulos Jun 3, 2024
aaff927
remove generate random weights function
rorybush Jun 27, 2024
0c1651d
fix tests
rorybush Jul 2, 2024
5d0883b
refactor tests
rorybush Jul 2, 2024
714eb7c
add sklearn randomforestclassifier
rorybush Jul 6, 2024
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
29 changes: 13 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ name: build
on:
push:
branches: [main, dev]
paths:
- 'awpy/**'
- 'tests/**'
- 'pyproject.toml'
pull_request:
branches: [main]
paths:
- 'awpy/**'
- 'tests/**'
- 'pyproject.toml'

jobs:
build:
Expand All @@ -15,15 +23,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11"] #, "3.12-dev"]
go-version: ["1.18", "1.19", "1.20"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout awpy library
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache test demos
id: cache-demos
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-demos
with:
Expand All @@ -38,14 +45,8 @@ jobs:
# So do not do that!
restore-keys: cache-test-demos-

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: awpy/parser/go.sum

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -64,13 +65,9 @@ jobs:

- name: Lint with ruff
uses: chartboost/ruff-action@v1
with:
version: 0.0.291

- name: Typecheck with pyright
uses: jakebailey/pyright-action@v1
with:
version: 1.1.329
uses: jakebailey/pyright-action@v2

- name: Thorough check with pylint
run: pylint awpy
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/go_code.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Publish to Test PyPI

on: workflow_dispatch

jobs:
build-and-release:
runs-on: ubuntu-latest
environment:
name: test-release-pypi
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"


- name: Build release distributions
run: |
python -m pip install --upgrade pip build
python -m build

- name: Publish package distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Install package from TestPyPI
run: |
python -m pip install --index-url https://test.pypi.org/simple/ --no-deps awpy
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

on:
push:
tags:
- "release-v*.*.*"

jobs:
build-and-release:
runs-on: ubuntu-latest
environment:
name: prod-release-pypi
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment for poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
poetry config repositories.testpypi https://test.pypi.org/legacy/

- name: Install awpy
run: |
poetry install --no-interaction

- name: Publish to PyPI
run: |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} -vvv
111 changes: 0 additions & 111 deletions .golangci.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,3 @@ repos:
"-rn", # Only display messages
"-sn", # Don't display the score
]
- repo: https://github.com/golangci/golangci-lint
rev: v1.54.2
hooks:
- id: golangci-lint
entry: bash -c 'cd awpy/parser && golangci-lint run --new-from-rev HEAD --fix'
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
Expand Down
42 changes: 7 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Contributing to awpy
# Contributing to Awpy

Hi! We're happy to have you here. Thank you in advance for your contribution to awpy.
Hi! We're happy to have you here. Thank you in advance for your contribution to Awpy.

## Python code

To make sure that awpy code stays readable and works correctly, we are making use of a variety of helpful tools.
To make sure that Awpy code stays readable and works correctly, we are making use of a variety of helpful tools.

We use the following tools:

- [black](https://github.com/psf/black): An uncompromising Python code formatter.
- [ruff](https://github.com/astral-sh/ruff): An extremely fast Python linter, written in Rust.
- [pyright](https://github.com/microsoft/pyright): A static type checker for Python.
- [pylint](https://github.com/pylint-dev/pylint): A static code analyser for Python.
- [pytest](https://docs.pytest.org/en/7.4.x/): A mature full-featured Python testing tool.
- [pytest](https://docs.pytest.org): A mature full-featured Python testing tool.
- [pre-commit](https://pre-commit.com/): A framework for managing and maintaining multi-language pre-commit hooks.

Please install these tools before you open a pull request to ensure that your contributions are easy to review.
Expand All @@ -26,7 +26,7 @@ pre-commit install --install-hooks
After you have made your changes locally, use these tools to surface bugs or code smells by running the following:

```shell
pre-commit run --all-files --show-diff-on-failure # ruff, black, typos, pyright, pylint, golangci-lint
pre-commit run --all-files --show-diff-on-failure # ruff, black, typos, pyright, pylint
coverage run -m pytest --durations=10 # python tests
coverage report -m # produces text-based coverage report
```
Expand All @@ -37,40 +37,12 @@ If you do not have the time or bandwidth, you can omit running the test command

### Testing/Coverage

If you are fixing a bug or adding a new feature make sure to also add [unit tests](https://en.wikipedia.org/wiki/Unit_testing)
that cover the original bug or your new functionality.
If you are new to writing unit tests, look at the aforementioned link, or check out the [tests](tests) directory in awpy to see how our existing tests are built.

## Go code

If you are making changes or additions to the Go code then a look at and run
[golangci-lint](https://github.com/golangci/golangci-lint).

To install it, simply follow the [instructions](https://golangci-lint.run/usage/install/#local-installation) on their website.
To run it do the following:

```
cd awpy/parser # Change into the directory containing the go files
golangci-lint run # Run the linters
```

Additionally, run the Go code tests with:
```
go test -covermode=count -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
go test -fuzz=FuzzConvertRank -fuzztime 30s
go test -fuzz=FuzzDetermineSecond -fuzztime 30s
go test -fuzz=FuzzParseTeamBuy -fuzztime 30s
```

Don't forget to run the Python tests as explained above -- changes in the Go code likely change the JSON output!

If you are adding functionality aim to also add go tests to avoid bug and future regressions.
If you are fixing a bug or adding a new feature make sure to also add [unit tests](https://en.wikipedia.org/wiki/Unit_testing) that cover the original bug or your new functionality. If you are new to writing unit tests, look at the aforementioned link, or check out the [tests](tests) directory in Awpy to see how our existing tests are built.

If you are adding a test that requires a specific demo, please let us know so that we can include them in our set of testing demos.
While developing, you can also edit the [test_data.json](/tests/test_data.json) file to include wherever you are hosting the test demo file.


## Thanks

With all this you are now ready to make contributions to awpy. We are looking forward to them!
With all this you are now ready to make contributions to Awpy. We look forward to your contributions!
Loading