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.

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.

python-sc2 function cython 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
has_creep 4 - 5x speedup
in_pathing_grid 4 - 5x 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, 3.13), install cython-extensions-sc2 with:

pip install cython-extensions-sc2

Shipping to ladder

When shipping to ladder, grab ubuntu-latest_python3.12.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.

release

For example a Windows user should download windows-latest_python3.1.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 if you do not already have it installed.

Then to setup a full development environment run: poetry install --with dev,test,docs,semver

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.

Jupyter Notebooks

Run poetry run jupyter notebook to open jupyter notebook in the environment. See the notebooks directory for examples. Use template_notebook.ipynb as a starting point for your own notebooks.

Run Test Bot

Edit the map in bot_test.py and run with: poetry run python tests/bot_test.py

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

If you're not sure about the file name format, learn more about wheel file names.

cython_extensions_sc2-0.7.1-cp313-cp313-win_amd64.whl (414.3 kB view details)

Uploaded CPython 3.13Windows x86-64

cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_i686.whl (3.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

cython_extensions_sc2-0.7.1-cp312-cp312-win_amd64.whl (415.6 kB view details)

Uploaded CPython 3.12Windows x86-64

cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_i686.whl (3.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

cython_extensions_sc2-0.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.7.1-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (3.5 MB view details)

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

cython_extensions_sc2-0.7.1-cp312-cp312-macosx_15_0_arm64.whl (556.2 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

cython_extensions_sc2-0.7.1-cp312-cp312-macosx_10_13_x86_64.whl (594.6 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

cython_extensions_sc2-0.7.1-cp311-cp311-win_amd64.whl (424.5 kB view details)

Uploaded CPython 3.11Windows x86-64

cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_i686.whl (3.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

cython_extensions_sc2-0.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cython_extensions_sc2-0.7.1-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (3.5 MB view details)

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

cython_extensions_sc2-0.7.1-cp311-cp311-macosx_15_0_arm64.whl (561.4 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

cython_extensions_sc2-0.7.1-cp311-cp311-macosx_10_9_x86_64.whl (611.1 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

File details

Details for the file cython_extensions_sc2-0.7.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0b99772e4cfd4f161fba770421254e81fd916cb0eb6cf273673787be4fb8ff95
MD5 e6df96a7fa36e81eef53061cef620985
BLAKE2b-256 455c583f00fac1a2e1044de9288339ac0343cddf3fa7bd1803fafc1d710c81af

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ecfaed48a2cb821ea0bd5a69b22249ed91bb99f43878267120bb82a25c60b65b
MD5 7ef6a246105cc03396da5d9faa812236
BLAKE2b-256 e0b3b9b55c38cb47c32c9207525c6199205ed474ee9a99057cc28abf727b1a5b

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7a34954801927d89964381b0bad0ae8cb9dce820dda3309187d2c0c3fd2acf4c
MD5 5ea5f2d153a1fee82c5682233b2a6331
BLAKE2b-256 ffb84f819149ce0133a967f64911656354729400b57dff3d3f62d4a434c688fe

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35aac3eea12f198f1c369e774a4389450d43e79f78cddbf73cbb3e321bcf47fa
MD5 896f058a595ac86618f6a30de5c2ef60
BLAKE2b-256 91bf31ba6772e9b5d42d3ec4c61494c90d05e5bd3da2f8c8ff38e873a5ad6f39

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp313-cp313-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6818802024dfa21072fced49b8dbbd701be562098eb41491cf9faba22842ff9f
MD5 d0c0f2ce18b15556afb136e1946167ea
BLAKE2b-256 eda3c04ead3792af27daf43260e812515fd8cbbb64c73e602abafbb1bbaa19cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 232a1dec4625ce6a598a1b7ae1fc886abe6e4f7bcd425c52ee9d9819cb21aa36
MD5 396615a9750cd8a6e76fa3d5aa373a54
BLAKE2b-256 78f2620175dbf4c6eab4f5c2c1bc4e5dfd13e73d99558aa764c0c751302b8d50

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 31da4aacd65b5e2085e69e0317c63331138d516d9542c59434885ecb18e4dce8
MD5 8ea84714dd3e4e819818a2274d66614e
BLAKE2b-256 f1c5cab873031c4cf30e8cff8d2d8e98f0a20c54ef97a2b08145dd11d097bf0b

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 979716a60fe9af7eb1b35008ea0f7d1750c90b142a530f9044553582b2be0832
MD5 a8aa7e9f1cb0e0d634d15e7850abeeca
BLAKE2b-256 b0a6998f07fb1b46de3fbf3ed095e15e6a5994e1c772b831009630e3d454d7cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 193bdf748c616056bf0bebd36828c0f47a9cea9eadeea12ca834e0a81a800e6f
MD5 0a80839623d81adecfb68513fe5589f6
BLAKE2b-256 32be2bd0b44b4088a5ef9a124dda1238b56c0946c595282ca238f7b71183bb87

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-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.7.1-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8b1355ebaf767ef60ad1359aabec76d4a2234b699648aeccdc87bf45bff5153d
MD5 487e90faa60dfb77bec619b801c29161
BLAKE2b-256 a603f6fdba380c12d30058176d92826c6fcfd633d5d9a80b8583c1c3bf299fa1

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 896be87473526adcaac2b74f6649a7775ad2aaffd1be3085fdb99c1dc4f18c1d
MD5 96aedab322535ca50dfb25ddcbb389aa
BLAKE2b-256 95b83b8926541a465a9c698dcc6eb691994023fb8fbe840a80c4de861d16cd50

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6d49367922394020562cfe43f9cf53bfc518c9ea08cdd73bbe99d5033c230195
MD5 96fff03890b03192da66b2451182d874
BLAKE2b-256 dbe7ffae26de04f6caa5df624bfdaba847b001dfff8b1446d60169d791771c13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 396ff895284bf57cecae4a34d81fd26152005bb404e2c8df969bc7062afc2a18
MD5 9c3965542a761cb287b2e47f9027ce13
BLAKE2b-256 595fb1236edbe37b9ca17fb26156324c8a8c5665473ead923445175fc0b199f1

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e2b9dca291dcc5e7474e1751f92dd1856e0f461b1b6e9b3c7c8abd93c24dec1f
MD5 0ebe2e341d86cfe06815081b1528eb9d
BLAKE2b-256 5ae4572b7b46c6eeae96eb862b3b0aa2563cb215f80bd5d32cc8783e031f367f

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 017caf82cf77e90df97d0df2a4e383ca83f2969d3676f8d2656e2909c3d074b3
MD5 bba3f7470d0fb6026857975b544c470c
BLAKE2b-256 4ee0ae7c86111593da78f887a98f0a9684cdd74c89ca621372d0724061f3eef5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 519b54f97ef00720582c9a5898e7cb5e19b0f8afa5977732e986bf09dda99801
MD5 2c2b3308aa322f2137f7eac360af0c57
BLAKE2b-256 c4d221b1f2d0d140839a480d9a54c0380aab8c09dbcea970716a4e0b879d30be

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-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.7.1-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3aad2cd9208a6544a5350927a28c3194bd1fefd4bd03ead24b10c2d77e0eede9
MD5 c1817f95c2773395681c6129731713cb
BLAKE2b-256 328b8321cd350088a6e347a75dee04266beebb2d7314835321e1a54f3ecb7bcf

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 eb3123c79b7a60219b805b9d10be131f66dd0db68d6d3e05523d5fa98d49cfa8
MD5 fd64aca763a67124e6da586b932b4b2a
BLAKE2b-256 2f087183bcc0d6b441238fd416a6aa5fe386df65fea50650ce797d68329297f7

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.7.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.7.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b18aeeb7624ef98d15bfc95559c2f77b30dc62da205b1cde8cc4a1d6b3060f82
MD5 a71f941c55dea955245a1f1ca75870ed
BLAKE2b-256 f34e2afe0bf1b5bb0f0f0432c80de9aa07ab51d863b04cf45642dd09600e3e9c

See more details on using hashes here.

Supported by

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