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

Uploaded CPython 3.12 Windows x86-64

cython_extensions_sc2-0.4.2-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.2-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.2-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.2-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.2-cp312-cp312-macosx_12_0_x86_64.whl (506.3 kB view details)

Uploaded CPython 3.12 macOS 12.0+ x86-64

cython_extensions_sc2-0.4.2-cp312-cp312-macosx_12_0_arm64.whl (463.5 kB view details)

Uploaded CPython 3.12 macOS 12.0+ ARM64

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

Uploaded CPython 3.11 Windows x86-64

cython_extensions_sc2-0.4.2-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.2-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.2-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.2-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.2-cp311-cp311-macosx_12_0_x86_64.whl (536.8 kB view details)

Uploaded CPython 3.11 macOS 12.0+ x86-64

cython_extensions_sc2-0.4.2-cp311-cp311-macosx_12_0_arm64.whl (474.3 kB view details)

Uploaded CPython 3.11 macOS 12.0+ ARM64

cython_extensions_sc2-0.4.2-cp310-cp310-win_amd64.whl (375.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

cython_extensions_sc2-0.4.2-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.2-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.2-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.2-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.2-cp310-cp310-macosx_12_0_x86_64.whl (537.4 kB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

cython_extensions_sc2-0.4.2-cp310-cp310-macosx_12_0_arm64.whl (475.0 kB view details)

Uploaded CPython 3.10 macOS 12.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8dd347253dc39a27406b9d1c878ce35832fc5a05afe3c1ce36ccb577b826c618
MD5 506e946a1828df458202e114af43355a
BLAKE2b-256 f7820d4456d37de2316fa09051f71b4b66e1eeb23953c933bafde3985cc276f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 7d8b25951dc5db0915e629c267ba5762b7009ba8f2d4003f715c3e27bac9abeb
MD5 7421d5ce11da80658a1fed0ebb928ce5
BLAKE2b-256 b57bf0d16d2821932bd171fce4ca438633c3be99d71da057098dec0b5d0c255e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 14e496c0dc80d8724430f7b769ae87776df182c262d8b0c3f6945b998d4c06a7
MD5 44b4a637f5351525ba7ae0147bd10876
BLAKE2b-256 7cfb342c86349a9a6a5317d85a55f42ab5f6db4af1056ce348cd3bb88ccf690c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ccdbd623379b4ba1fab6e59bea07b3aec6cf97b5018ba51a11952785fd59a17
MD5 0536b3f723afbc36c78dad635bdf0fbe
BLAKE2b-256 b826a3bfa0bc22b469401a5554d10ecf182f1264aafccba7e0150ff244f72a5f

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-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.2-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a27f6db50d54024ae13e6a9f271d0d9487105e952b56ec2cac320029c510e97f
MD5 921f994a2b59310b071608903e01cfe4
BLAKE2b-256 1c862fc27416b82b9db4fc512ff92919141056484e246504e05b7c418ca84544

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 002dae18a0e3a94eda02528ec1f28aa78d218de14c95b7b41927dc2ca7161f73
MD5 01cdfbbb2dad8efe96a6446d1ced74b6
BLAKE2b-256 4d1a1d041fc7838e8ca5e3f4a9fc0ec878719175f9f2cfdce5318e7624fa1fe8

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f2c73124cefaeebf49e7fbdde930b5831da73c7c3ca9e6f9dfea3fa1cce7bb6b
MD5 620ba49a161ee047d5c81aa0e075f22a
BLAKE2b-256 9801b0571ed1c25d43f746446d3d823b63c678dac86cf3dd917caa806508fd4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4b6601b3c4980d5897ca08af4aa7cdd1fa98eab67b2cadd608937ac24c9b22bb
MD5 f437cf6026cbf10f99d6f444876c193a
BLAKE2b-256 e507d407e3cbff5c1d0a3c4a28467fff309b07bafcc69d992cd991f2ad9f71aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 d5f17dde1e0dbb2d5dbac4a73e54c02f12a02463321b4ca33983536a149ce083
MD5 bebe6d2fa8bc5af9e35f520db4737753
BLAKE2b-256 91d2e9c81080e20db895e91bdc9e99d477c4e3064df7bb0e08486de16b07b297

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 ed9e71eee7a74a314ab0ed5b841e75f7f336009a10efc55eff193b6a2086e502
MD5 7768bd8cff1fdf5679334f7f2842f2ac
BLAKE2b-256 d60b896f65e7cf5cc2046ce6f45a2cae8b7bd078efe0564afb13b44f4b8ef966

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ebcef42d0d7f33da1b343153d082ae378395921259ce4fa737629bbb8fd6515e
MD5 986b4d3a2c72ef37b8828e18b7385a7f
BLAKE2b-256 bbf31ea412e3e504cd3956ae0026e9f41f7c3432b532c3b6f79424b6667d486d

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-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.2-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 a454f3db0f3df1a5de31424555846e2309c6a1c5cc45f30d95c93a0f0e7b002c
MD5 fbb84f1e17c6b82158c3218ff349d52b
BLAKE2b-256 ea35a4edaed8abe4a00f15023396e75d7e3c98614d86498fc5f023819908fa64

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 ba7cf9f3deb5beaba1ad9f7d34bdcdbb5b594bdf28ea73c48fa131e41d861fb3
MD5 49b2c3c80967f2691d4d6fdc781f0155
BLAKE2b-256 683d8d7ae6febd5592bfa562e09851206b808db50449cfc3b8f88c7df4e95417

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp311-cp311-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp311-cp311-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 3df56ceb2f13fe7c452d85f8d48b3d15a7c6970c01ff9a9827f40498d14085d7
MD5 f5d27ceb1326f507935c0d517b245e06
BLAKE2b-256 ee9d673afc08c3d3c4f6405cf08a2cefca53579b000a50f76352f5f599c1dfef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 09df742c451948ff51f12adf9f10201e7feed4d0a099a961c4218d3c6ad07410
MD5 0c0c2d71c55d0780137f91b17af8cbf6
BLAKE2b-256 7269a2064448d83087439750ec50a6b1979a4fb167297cb647f9b22223538386

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 3afec1b8233c1f6b4ef1f60d7223ee066fd69ca9a929046dd7448a5eb6d019fd
MD5 d3d7f29eda35857c8bd907c2142f20a9
BLAKE2b-256 6a2de62a82361e54ff5842b1b99df11fa8edef500327ba6459e83452fa0f0ec7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 5210e11bed7192efad0ab6706d5d76132af55da72e92334a5cb5a448c92f20ed
MD5 c30e10ec820d51288383b634d44bacb4
BLAKE2b-256 a8ed23922765ca90b603cce4c735be046fd0f3530418899ab13ae5885cb48d75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff3df268200e6b710398a4227c6ad78075ec9016137c88df79b521c958a7a3d2
MD5 a5c7b17e81e332d7b7b2de0b7a696bae
BLAKE2b-256 aff8a83428eaaee5f14804291c976ca23cf4a4cf9cf89c7142c632ce1a1028ba

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-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.2-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ac4bd485de9ba55c6afd7d62899f8776fec52a1e7f19382680ae531fc9effb27
MD5 c15077b98ada843cf3dd846df7e5a3f8
BLAKE2b-256 aa22dc4e32fe8952ab5dfbd330d28557ea3f839680fa65ae417de7ddf11fc5c4

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 9e288203c7604f6f1b22a0d90aa99ee339999bc498c86cae7792d732dbb4630b
MD5 6f772e436ee90adfec96a876973a4a86
BLAKE2b-256 73f80ebab63a610d272f90ef7981299d03c99cee4306b297093322f93bd93d43

See more details on using hashes here.

File details

Details for the file cython_extensions_sc2-0.4.2-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for cython_extensions_sc2-0.4.2-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 15db412e968f1d2469e54268e42cfff9759334ee60f966f4dd54bec2e10d9aac
MD5 5006dc0cffb490227b5a599c90d60244
BLAKE2b-256 71a0d72fd2a7685e8183772ee61e32207096ca844e829d67bfaaab64fa337cfd

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