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.3-cp312-cp312-win_amd64.whl (368.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

cython_extensions_sc2-0.4.3-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.3-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.3-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.3-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.3-cp312-cp312-macosx_14_0_arm64.whl (487.7 kB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cython_extensions_sc2-0.4.3-cp311-cp311-win_amd64.whl (374.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

cython_extensions_sc2-0.4.3-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.3-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.3-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.3-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.3-cp311-cp311-macosx_14_0_arm64.whl (503.2 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cython_extensions_sc2-0.4.3-cp310-cp310-win_amd64.whl (375.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

cython_extensions_sc2-0.4.3-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.3-cp310-cp310-musllinux_1_1_i686.whl (2.6 MB view details)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

cython_extensions_sc2-0.4.3-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.3-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.3-cp310-cp310-macosx_14_0_arm64.whl (503.4 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 587e7970be1be276a7c348ea36d0763832abe327113d3a572b76608233c05faf
MD5 c5cb9dca628823871171900b9fbfdf2e
BLAKE2b-256 0a96fb19d0903b0f996137a98e78be31d8f52171f8bdfa51c6de3c69cca98b1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 36ef021d010d060de55861b79b2efae9e665d478ea0fb3bf1530c31449c18705
MD5 0472b0fb3b19c4671a8b9c44309be4fa
BLAKE2b-256 a5b52d04372e574f7ecb6dd458f02e6d921a18c788e2289563011c59e0ad03ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 784821323bfdcd5d8263826555313056847dfea707517c4b0e53c3bc6dc9ea8a
MD5 f7685bb25734cab18da4725aafb3494b
BLAKE2b-256 52606744fa78803c35b77c54602e9ad432df6fcce98926bb0b9e9b22fcff6d71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ef231221cb82f1a5436cf4ef47df04d977e6fb13738242961bc051a16801b28
MD5 2913289f9a40157c7e939e7bacd5e724
BLAKE2b-256 27e55c832dfb58263c8fd9be41313d0d54122c4a34e773f46de1e9f49786b84c

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.3-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.3-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 63e0061baaaf461e8f042d927c7167873a0aeb72fefe0233b0e166beb8da46bb
MD5 9575e1ff3c1b4b0a456217e1ba34b70e
BLAKE2b-256 7e74ebf9c233e65946628198a0a3e6c932c1be278c83eed8b99b5d312c9187ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4f013556a24b0d19fc070c95beb2deff221a763c437828d283720d32d1979395
MD5 08f2ca036b957c99602deac9db1d266c
BLAKE2b-256 ddc45de4c0a2d620cb5bbd839a3bdda9064f1edcba2519ec26aa84ad0a5d9689

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 89903ed0464f1af667155c1e9438bcf31f10e1049e3e6a28c435694b7097f7a0
MD5 c00690f3e3908a49993a51c4f0a26096
BLAKE2b-256 46271ce0b421911d238c452d093d71819971253288ea03c55c3dc641e6c4b815

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 324f41f28302440a5941006f4cf80f54720ba6dd400a31ed76407c2e65b8e77e
MD5 d794a1acda91a61a7ac35b64082d9819
BLAKE2b-256 4ba71a11f40e01a02bc8914dc026e78410fceb05dbe1e322d7df674caee4d148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 d61062834d0ba81b529d49e5b58d04131c66d2815e3d40c796f05d09c5b648c1
MD5 66aa50d62c050177ce9949dc83eb10dd
BLAKE2b-256 11706d87bff4fe5b4d0e2fdbd34a5469bddf11e217cf6c0e9b21dd7ac4ce3396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5017d44c8bb6862ebd2d1b9eff89695c008f478ecb1007d5dba99fbf0f4fa020
MD5 b968527820386cc356ce8f901d3709da
BLAKE2b-256 2b655a19c21bbc8e3c764051aabdcff81c2b9cc80b29c48f757e0d61052c7453

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.3-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.3-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 380cd9b24b790ade2899528c31f902a7435a96d6f47aece2c5a4ff1d310cf248
MD5 c14d97c8d6c32067b426609fb271fc0e
BLAKE2b-256 71975a452cecd7621f54b171a8d2fac805ed74cea50f698619a70b7a2d560a55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3c0ae662a2fe3631172c65ed6108ae37596678fefca2c24d7017ebe1ca91a058
MD5 fd48d33b301f9cd97118ea9923470ba7
BLAKE2b-256 c4424dcd9862187ee108806fefba0df2435d3aae2d74783e8897a5992d918a0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 07082dbe55dd6c36466972b9aa2f4b06fc4a79d42a30cc89de6e203eb528dacd
MD5 a39d8f5d48ffe2d61eccde0d6037e227
BLAKE2b-256 dc1114f82517986da5e26059179007b6e06462e7cf5cd2a2ffb53eea781dcb83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 feabcac27a34d545fa4a92f15384bf6707e9924f98e1d3c86a6a348b426436d4
MD5 22c511641e5bd9ef0ef668299c25d2b7
BLAKE2b-256 a22fc765c97131a98d08e48164856e3ee79b80b6fd4af07d953d490633108219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 7b8155ab2c444b06fe3384d720c76e48f4d4e37ac8ca87a7ed9c12e5791af787
MD5 a75bbb610fa594dad7e31aad19304686
BLAKE2b-256 b1ecd7322fa52d77a124bb1fe3f91fddd9ab307f4db4211bde8ef86a93d2790f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 79cc6fe286144f640f8073aa44799cdf652ae0cc18c9716a5396c6efd2d6eaab
MD5 ea67d240a2d9c29224c7889ff1a1b105
BLAKE2b-256 8bb7098802859b4ec60172a9147441e56d75a619c7c0b5cc7902ac22e294a39a

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.3-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.3-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 40a767101fd00093494900f2fdb00694008a87ef3746be4123c10e28baa34aae
MD5 be5766daa829455c9fd504c11f3b4695
BLAKE2b-256 3f11bacfb463c805562546d0e5bdae7a688fca87158ce53b4a3b6053aaa413a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 544bca8cf1d38ebc62f9ad358cd98a576fc2a84bc957863df79c115d33357c3a
MD5 5a53b8e50e1587e1e8dc7f3f23f5f78b
BLAKE2b-256 75e2bdac9726106efe6cf606e76634f9cf869f3cd6dc6dd7a9fa9c2085cebe85

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