No project description provided
Project description
cython-extensions-sc2
API Documentation - for a full list of included functions.
cython-extensions-sc2
is a library designed for the python-sc2 API.
Its purpose is to offer optimized Cython alternatives for commonly used functions,
along with additional useful custom functions.
Note: This library is included for ares-sc2
users by default, no further setup is required.
This library also supports python-sc2
and sharpy-sc2
bots, see Getting Started below.
Example speedups, results may vary depending on machine and exact scenario. This is by no means a list of all functionality offered.
function | speedup |
---|---|
units.closest_to |
6.85 - 13x speedup depending on scenario |
distance_to |
3 to 7x speedup depending on scenario |
position.center |
2x speedup |
already_pending for units |
6.62x speedup |
units.in_attack_range |
2.05x speedup |
units.sorted_by_distance_to |
8.62x speedup |
unit.is_facing |
9.1x speedup |
Point2.towards |
14.29x speedup |
Tip: use cy_distance_to_squared
where possible for extra 1.3x speedup.
Getting started
To quickly get up and running locally (for python versions 3.10, 3.11, 3.12), install cython-extensions-sc2
with:
pip install cython-extensions-sc2
Shipping to ladder
When shipping to ladder, grab ubuntu-latest_python3.11.zip
from releases in this repo
and extract cython_extensions
directory within the zip to the root of your bot's directory, like so:
MyBot
└───cython_extensions
│ └───cython-extensions library files
└───your bot files and directories
Alternative local setup
If you already have a python-sc2
, or sharpy-sc2
development environment setup,
then cython-extensions
should work out the box with your bot without the need to install extra requirements. Simply check out the releases on this
repo and download the correct zip
for your system.
For example a Windows user should download windows-latest_python3.11.zip
.
Inside this zip you will find a cython_extensions
directory, this should be placed in your bot's root directory
like so:
MyBot
└───cython_extensions
│ └───cython-extensions library files
└───your bot files and directories
Start using cython-extensions-sc2
For ease of use all cython functions are importable via the main module, for example:
from cython_extensions import cy_distance_to, cy_attack_ready, cy_closest_to
note: in this project all library functions have a cy_
prefix to prevent confusion with python alternatives.
Contributor / Cloning the project
- Install poetry
- Run
poetry install
This will set up a new environment, install all required dependencies and compile the cython code for your system.
If you modify the cython code, run poetry build
to compile it.
Contributing
Contributors are very welcome! There are many missing alternative python-sc2
functions, and if you're
into optimization, the existing functions could likely be improved.
Please use conventional commits if you choose to contribute, it helps the automatic releases detect a new version and generates an accurate changelog.
Example git messages:
feat: add new cython function
fix: fixed buggy function
test: add new test
ci: update github workflow
docs: add new docs
chore: add dependency
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 370.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da7bc4b52a043244bb541fbc43df36912688f678a32a0e3aad4ed5a5f4c2ab4 |
|
MD5 | 085f25b683203dc1405048329811afe9 |
|
BLAKE2b-256 | 12a2d204b96ebafea506640c45e8bd8bdfc45db457207e74c226006e7fd64e4b |
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.12, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b66734b1b72cb38f417deb8b1f0e02fbec46a187f83c342ccfec156f118c7082 |
|
MD5 | 8969f6ba24f605718e0dbf0842662138 |
|
BLAKE2b-256 | d85d898ae9fb9f81975d27de982f3b5f63807459475c73c31932ab0b2b2d90b0 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-musllinux_1_1_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-musllinux_1_1_i686.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.12, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c7f4b3569d502cb827a7268ffc2e97fd640e4255179b4771dbe7d768ac03de |
|
MD5 | 5eff7e7a14b7e123a3f28f37460b184b |
|
BLAKE2b-256 | 47320879e11ba6c2de0778368fe6c6bc3b6f047187e36b2cd7fdc837f252536a |
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c0e81d989241ef49f3976ae04bc8aaa033e3e7cfb3edf90078a8f3de4093b14 |
|
MD5 | fc40a039bb51192e7af648a0bf1e4a72 |
|
BLAKE2b-256 | 8d4664dcec4aaf29e7107943e29c4db915d6f80e5eaca079304a81841aa5002d |
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e243efef90475ed97fe2b479db998aa047e554447fad460598570b5a7ed832f |
|
MD5 | 6bd93da184d20a3373959bd01ef6e54b |
|
BLAKE2b-256 | b08acd8c4963d9632826c9d2f93f7a6c70fb51cbfbcf6b7e63ea0a7a9372cd09 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp312-cp312-macosx_14_0_arm64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp312-cp312-macosx_14_0_arm64.whl
- Upload date:
- Size: 488.0 kB
- Tags: CPython 3.12, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac337cf90859b2f7927a5308718c7f1cb8f29e81cd0e8ca40500ee954de659f |
|
MD5 | 0b5773340a83d8528ddb951545a9152d |
|
BLAKE2b-256 | f80be58c2e1170495680e88983750afa1437258186fb262cdc6cec6035738cbc |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 376.2 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93a61da9f9dd0b0dc693e014fd12d17af5b5fb7b79c548b9ce5e5e5e9836befa |
|
MD5 | cd246f6c0dd18546f3330b09ea2b38e6 |
|
BLAKE2b-256 | b507dbbb02845f025453b1b694f814407e9ea180c23daf06b6ebe84806195378 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a842c3381e8043be82e1c7ed80dcb2719a03c50d2868cda3737da4f64a3cba7 |
|
MD5 | 45c0945ba915c50a53a5a6849816cd1c |
|
BLAKE2b-256 | f0b3a3b8cd1a654cfe313b5ace939a0ecb8b38b5da935f6a53de75ff5e4bebdd |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-musllinux_1_1_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-musllinux_1_1_i686.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.11, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71120bd5a2eb293791f3922756c96b7e1b5c69ddea1de25aa6315cde2533cfb5 |
|
MD5 | 1a846e9d4177a1eb376748429878f00a |
|
BLAKE2b-256 | b822d19710ab6040a93243455429b2a445e70528afc69037bd5ee01e1c637879 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e090f496d3f52a6ea926c3723361572c02d8f1a3f894bc0975b3c1f86a020efc |
|
MD5 | c07376fd749cf4d18bf8b440a3080dc5 |
|
BLAKE2b-256 | 033d86da5def28e7bd5327d1e49ec178a5d30cd60e5e3dca827f04544bf70fc8 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99083285928c3521eb4ed6dafae171a2ed7c0d84971421a7cedcabfc0241262e |
|
MD5 | 48b643c40e7ac7794ffd9a42c7504a9d |
|
BLAKE2b-256 | 79ab326aa74ef8f52bd9ad5b18d1c523251be0f8c1319cbdd4692ce28dab5ee6 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp311-cp311-macosx_14_0_arm64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp311-cp311-macosx_14_0_arm64.whl
- Upload date:
- Size: 503.4 kB
- Tags: CPython 3.11, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65a3c905cef9356147e8dc4581131ac1d51df36f9e9158a800fb345144dfdfd9 |
|
MD5 | 26f6e904d381f1c5dbbab863c3139b59 |
|
BLAKE2b-256 | ccdac35bdef9124ad6b6dcd4ae369e09daf8b903d8b6456d6751876f1f60ca73 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 376.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b915704bf85bb2fdffc724e1a8a14be74b110ae4a615cff31637a058250a37e2 |
|
MD5 | 9669751556c2228bbcd2c26414bd42a5 |
|
BLAKE2b-256 | 71691eb93a5b03273ceade6f690bff2860bd533e1fd56da035728a2c98166b13 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe9004c831ecc42ebcd02be29ba7927615aea3793d23ae873cfd24f9c9b1f0ad |
|
MD5 | b7468b6208f06a2f6d5c868551d049a9 |
|
BLAKE2b-256 | 4ef070d187064c5157e9d4f9f42bca545f72b9dd4da4a7baefa7e813a1c5008d |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-musllinux_1_1_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-musllinux_1_1_i686.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.10, musllinux: musl 1.1+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8db53370ad97a79fc2ea88e5cb922c86db64a28ced02cb9cedb097390da6e32 |
|
MD5 | ad180e49ec146484495e5e74e89ee93a |
|
BLAKE2b-256 | 72f1cf6fbff879a31c7ad991205fa840dc0b04b2b8f7779acf126bd4b2a6037a |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e43e557bbd549d342ab34b5c5055173ec3e3f827e8573a5f5c04e40a8c9628aa |
|
MD5 | 69db984aa7ea1dec31c97896e20fa610 |
|
BLAKE2b-256 | d441d3248bf38b2bac6f8faac2d16a65130b18923a75cf05457f56ecea0af016 |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 938a8febcf1ae6f4dcc764a6f619535e73a84c361530cc1f271a795e3b744c20 |
|
MD5 | 1cf07856a18da35e6f0e126a5713c93f |
|
BLAKE2b-256 | 75cba082fce1fc6be8f1ac6b973304bebd36aba173f5aa5622bd23c1a5b9a6fb |
File details
Details for the file cython_extensions_sc2-0.4.5-cp310-cp310-macosx_14_0_arm64.whl
.
File metadata
- Download URL: cython_extensions_sc2-0.4.5-cp310-cp310-macosx_14_0_arm64.whl
- Upload date:
- Size: 503.5 kB
- Tags: CPython 3.10, macOS 14.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afdb0dc42db696bd3be2bb04984e03b9592a261e190c10d0f1f60baed736f8b3 |
|
MD5 | b5a304acc35431692d8478fa0908c821 |
|
BLAKE2b-256 | 4637c119c57831a613e2d3f895913e6fcaf83ce10e3d2d6063221f26141c9bc8 |