Skip to main content

No project description provided

Project description

Testing Deploy Documentation

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.

For bot authors who have a working development environment for python-sc2 or sharpy-sc2, there are no additional requirements. Simply check out the releases, download the appropriate zip for your system, and place the cython_extensions folder in your bot's root directory. Each release includes a binary that is compatible with the ai-arena ladder, making it ready for deployment.

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

Note: currently only python 3.11 is supported unless you clone the project and compile it yourself, more versions will be supported in the future.

To quickly get up and running locally, install with:

pip install cython-extensions-sc2

But 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.

Bot developer

If you already have a python-sc2, or sharpy-sc2 development environment setup, then cython-extensions should work out the box with your bot. Simply check out the releases on this repo and download the correct zip for your system.

release

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

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

  1. Install poetry
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cython_extensions_sc2-0.4.4-cp312-cp312-win_amd64.whl (370.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_i686.whl (2.7 MB view details)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (2.7 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cython_extensions_sc2-0.4.4-cp312-cp312-macosx_14_0_arm64.whl (488.0 kB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cython_extensions_sc2-0.4.4-cp311-cp311-win_amd64.whl (376.2 kB view details)

Uploaded CPython 3.11 Windows x86-64

cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_i686.whl (2.7 MB view details)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (2.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cython_extensions_sc2-0.4.4-cp311-cp311-macosx_14_0_arm64.whl (503.4 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cython_extensions_sc2-0.4.4-cp310-cp310-win_amd64.whl (376.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_i686.whl (2.5 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (2.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

cython_extensions_sc2-0.4.4-cp310-cp310-macosx_14_0_arm64.whl (503.5 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6cf90f739ec8faf849c9fc7e75de458b4459ccf306122d3f8385ec15ffdd39d4
MD5 6c25c48029893988e1df2186c5813c40
BLAKE2b-256 d12fde0e05994d245df1dbef65ffffc6f317a1b48df86af19440de9a0a112b70

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 78d09f736b4d64236dc856ba3d5206496cb43a10db973a0873232abf67a607bd
MD5 bd0346f1472428e902d0e3553540873b
BLAKE2b-256 f83e1ce5b173171ff1fb26250a0f017b40514ae9607e90a8d92ee8a797b22f1e

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 7ebdcb66e5911b387f5e3fac9851c3bc2f5693984ad057d6115ef17497ddd03f
MD5 771aef8117f0da51d3ef4a75ddf667a2
BLAKE2b-256 14a1b3533a3d10aa30ff6258c9d7165c07e1f4b0a631b276ea0773f1e64c69b8

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8030d0c7b9d4c13897fb0859f15bce0bb35c392e98c2f034d6f87435cf2a0734
MD5 9c44c4b1f6b4ec8b7cdf9299abab533a
BLAKE2b-256 303940d8ea0be39a2d3d47cf3543d2135aa66b4a723f8415c04e829f904e6ae3

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8bacb79b0b1241233156788f31506e4496179925a34be17475c6d8745dc93587
MD5 0f5814bf8904ef8a154ee82b55f0ef9c
BLAKE2b-256 aa98c9310360f091bebcdbc92200442ece352adee89d0707f53e6a33dd154920

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 496df689ce4d48e6ef0ee66ea7901f27b7c1e1629acdfbc2f6cabfe8a3d41e14
MD5 998a2ff1d24aec244467a3bbae7600cd
BLAKE2b-256 10b16a38aa1ced4c5a20564463ee61b0be2d6deea691370ff9f3d8a35f3419cb

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7b236f5681e1407cb1ad9e0f73c105d90690fbe634a22b65995e01360ad1ecf9
MD5 aa1ca55d1fb3654a91491891c1f33529
BLAKE2b-256 4c5a7ff2fd2a1a3adab963a87b1b0f816b46d750b6a68483a341a730c830873d

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 648f4b14c4b97e07d8fe158b4d5b8f6c23c13c1070efb7032eaf83ac30577c12
MD5 23a44d31f20ca4fbe61e118f695e6563
BLAKE2b-256 82f74af68bc50c61e80802aedc2c08a698a96abeb752a6073e6af02704268c94

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 03d2727b5b09770ce5b6cb562df5ab6884e4dbabe30eb2d9a7c91fd7f519c256
MD5 5086c69745b2ecb03b0b282361f9e695
BLAKE2b-256 0b1b39213d2e7ae3c0eff538b8e3b38c8739818a7075289c8dfa9e1deb65009a

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df0580f8fe2a2147facfacdd0ae63337e5dc48a2fc417cc2534b4d1fb884ce79
MD5 3dba6dedc2a732bd7f28957eb2fef066
BLAKE2b-256 48b6e9fac19e5ba9be6903ac792985a9d37a114b9881e8a4e646abb72408767b

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 cdd8534a3b90956048c5eaef2ce47871cd52a6cf638c58ec83f0b4d836b18821
MD5 0826f89b68bbcb272f1ad6d007f71f1e
BLAKE2b-256 6e5fa4c9af30d3e478f5a3773561dc794da78966b4d48c7e860bd3c8781a62e1

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4b39f03ee3669266b030a3883bd2f61f61eec48736143d2422750eed22f4962b
MD5 4972afe323f11d1180402e6f2d05ac22
BLAKE2b-256 4ed5d681a15a87cec8d2cc29ddf5224971f518b7dec06a6203c745c7e57021f4

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0061749cbdb00d12a81fd4fb3e9bda1cdff9c051f918f1ed635da281add36312
MD5 e5ed70d4cf5670a1c78e54932e89cb8d
BLAKE2b-256 ac3cb48ce66c1834522e96ef87b685c408211c2d60e9513ab8b18e54750bfb9a

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 bde5854cf23a7a0c5e2eb3ee6358628357482956c82f5afb79a50aee03efd6fb
MD5 06c02099961afa79cf8d8fbe3ebdeb52
BLAKE2b-256 f3bc5fa63b1392e158e7f3d627ca35108a5b0ee473e44fa9b673bca609509cc3

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 a6e563a3232479c8a4b7b9d127fc03634679462dccf685a9500cf5acd4b85335
MD5 2d798c75fc133b0f41f1eb77653f693c
BLAKE2b-256 795fdaa3d1f909de8a9db5da236bdf0f1cf17293bf7571f828dc3c49f949dd84

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fdf65c21303003edd3bc65fdc5950a6f82a79a790e1206d1c9b6930e3e7d0333
MD5 1f77cb8ae3b3b059889e3cf1c35973d0
BLAKE2b-256 71d010cffc04c2dfc605b1843e49031343821a8c5e396ffcff6633036824e3be

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 91ed9297a8aa373b18e8b5bee99cbbda89b7a3911fc22dde2cba81c59eb1766d
MD5 b654b7ade1f1f35286a8a1b71c9f8559
BLAKE2b-256 7ba6e1e6be522e0454d568331e90f553bdbd70610d2679daff92712e5a3c272f

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.4-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 95af607807ca7d8cf042b62674df9ef1aae55cf1101668fa5a40ea5675373835
MD5 fc2ca88f88716227ef0f075b2349b3d1
BLAKE2b-256 6f55e6e292d2bcd7d93808aa5df273a190a76f2089c40f7d082e838e79db56ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page