An osu ctb gamemode star/pp calculator made in python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Giuseppe Guerra afde5add21 Use bigger step for bezier sliders that have too many points 3 months ago
osu Fix merge conflicts 1 year ago
osu_parser Use bigger step for bezier sliders that have too many points 3 months ago
.gitignore Cythonized everything 1 year ago
LICENSE Added bezier curve object 1 year ago
README.md Replaced imports to work as a Python package, update README 1 year ago
__init__.py Replaced imports to work as a Python package, update README 1 year ago
constants.pyx Cythonized everything 1 year ago
ppCalc.pyx Cythonized everything 1 year ago
reanimate.osu Fixed slider duration, endpoint and tick placements 1 year ago
sample.py Replaced imports to work as a Python package, update README 1 year ago
setup.py Cythonized everything 1 year ago
test.osu Fixed Easy & HardRock mods not being applied correctly 1 year ago

README.md

Cythonized catch-the-pp

An osu ctb gamemode star/pp calculator made in Cython.
Original repo: catch-the-pp by Sunpy.
Note: This repo is meant to be used as a Python package, not as a standalone program!

Changes

  • Cythonized all files, functions, classes and methods (with static typing as well)
  • Replaced math.pow with **, this gives a bit of extra speed
  • Replaced imports
  • Minor code cleaning

Performance

These are the execution times after running pp calculation (with beatmap parsing and difficulty calculation as well) on reanimate.osu 100 times
Pure Python version: Min: 0.7986021041870117 s, Max: 0.932903528213501 s, Avg: 0.8350819730758667 s
Cythonized version: Min: 0.22933077812194824 s, Max: 0.25774192810058594 s, Avg: 0.23836223363876344 s

Compiling & Usage

$ git clone ... catch_the_pp
$ cd catch_the_pp
$ python3.6 setup.py build_ext --inplace
...
$ cd ..
$ python3.6 -m catch_the_pp.sample
Calculation:
Stars: 1.9046727418899536, PP: 42.187660217285156, MaxCombo: 1286
$ python3.6
>>> from catch_the_pp.osu_parser.beatmap import Beatmap
>>> from catch_the_pp.osu.ctb.difficulty import Difficulty
>>> from catch_the_pp.ppCalc import calculate_pp
>>> beatmap = Beatmap("catch_the_pp/test.osu")
>>> difficulty = Difficulty(beatmap=beatmap, mods=0)
>>> difficulty.star_rating
1.9046727418899536
>>> calculate_pp(diff=difficulty, accuracy=1, combo=beatmap.max_combo, miss=0)
42.187660217285156

Note: You must clone the repo in a folder that has no dashes in its name, because Python modules cannot have dashes in their name! In this example, catch_the_pp was used.