Skip to main content

An experimental package intended to test adaptive dependencies for numeric code.

Project description

Seamless entropy

The purpose of this package is to test and demonstrate how to create Python modules which can correctly fallback to supported functionality if dependencies such as C compilation, scipy, numba, etc., are not available.

This packages exports a single function, binary_entropy, which returns the entropy of a probability, expressed in bits (rather than using the natural logarithm, as is customary in most mathematical applications).

>>> from seamless_entropy import binary_entropy
>>> binary_entropy(0.25)
0.5

Choosing an implementation

The package will choose from one of several implementations of this function, depending on the environment

a. at build time, and b. at run time.

For example, if C compilation is supported and enabled, either when building a wheel, or when installing from source, an implementation in a C extension module will be built and used in preference.

If numba is present, either because the package was installed as seamless_entropy[numba], or because it happened to be installed anyway, the Python function will be jitted before use.

If scipy is present, again either by installing seamless_entropy[scipy] or incidentally, an implementation which calls a scipy function will be preferred.

Controlling the build

When building (this can mean either building a redistributable wheel, or installing from source), you can set environment variables to control how the package is built.

  • DISABLE_SPEEDUPS: setting this to '1' means that C code will not be built even if that is supported.
  • REQUIRE_SPEEDUPS: setting this to '1' means that if C code cannot be built, the

TODO

It would be nice to have a Cython implementation. Note that Cython support depends on C support; if Cython is available than native C should work, but not the converse. Thus the Cython implementation should take priority over the C one.

How about configurable order of preference for different platforms?

Installation errors

The aim with this package is to solve in one place all the packaging issues which arise from a package which optionally includes faster and more efficient versions. This technology is intended to be re-used in other packages. It would be nice to make this package as robust as possible on various Python platforms. If you encounter any problems installing or running this package, on any Python setup no matter how weird, please let me know! I would love to know about your environment so that I can make this package work on it.

Project details


Download files

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

Source Distribution

seamless_entropy-0.2.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distributions

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

seamless_entropy-0.2.2-cp313-cp313-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.13Windows x86-64

seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_x86_64.whl (13.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_aarch64.whl (14.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

seamless_entropy-0.2.2-cp313-cp313-macosx_14_0_arm64.whl (6.7 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

seamless_entropy-0.2.2-cp312-cp312-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.12Windows x86-64

seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_x86_64.whl (13.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_aarch64.whl (14.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

seamless_entropy-0.2.2-cp312-cp312-manylinux_2_35_aarch64.whl (13.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

seamless_entropy-0.2.2-cp312-cp312-macosx_14_0_arm64.whl (6.7 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

seamless_entropy-0.2.2-cp311-cp311-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.11Windows x86-64

seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_x86_64.whl (13.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_aarch64.whl (14.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

seamless_entropy-0.2.2-cp311-cp311-manylinux_2_35_aarch64.whl (13.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

seamless_entropy-0.2.2-cp311-cp311-macosx_14_0_arm64.whl (6.7 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

seamless_entropy-0.2.2-cp310-cp310-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.10Windows x86-64

seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_x86_64.whl (12.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_aarch64.whl (12.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ ARM64

seamless_entropy-0.2.2-cp310-cp310-manylinux_2_35_aarch64.whl (12.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

seamless_entropy-0.2.2-cp310-cp310-macosx_14_0_arm64.whl (6.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file seamless_entropy-0.2.2.tar.gz.

File metadata

  • Download URL: seamless_entropy-0.2.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.10.16 Linux/6.8.0-1020-azure

File hashes

Hashes for seamless_entropy-0.2.2.tar.gz
Algorithm Hash digest
SHA256 5aa012ef206de0a24fbccf7ba69af5aec442e9f1b8206dd74832ec7355b21382
MD5 1a379b7429f71183243083cb00e688e0
BLAKE2b-256 68553c18e23b46adb9c312ebdad2e25114f17457645a623679882f2f39003243

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4fa6beaf10b7528afdfe93794e50138ca24db98f70d93bb303d4035069e39bff
MD5 e4654a33f1ceda952044e8e4326a7070
BLAKE2b-256 b5dd9cdf216cc8fdaaf209191596bfe1ad70b1c893f69a94108e4b5df3c92295

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a59ae66474c528d2ab4cc2f4f6e2beb2d932557df22ecef1871a719ced8f2dbe
MD5 6a6c9f61948ff1bfded7ad029510a7fb
BLAKE2b-256 f75611a26c66421854e9cfa37489edeb0fba290e0fb83db9e7c506a107db0f8a

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 6a7bfb8577d7d96001fb220ac955029aaf4e05095faca77c394a240e64ca1a38
MD5 4e5305bf90ddf6b87124eeba41187200
BLAKE2b-256 01d8bbb511cd7a5f1ad521e409e11a540158a474df4d6a933f809697afae5945

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2543b0c51ba2798cc4ff8f42cd98c6ca5c708d30354814c24df2758f375c7054
MD5 c80e1d9f690ae9ccdeb6394f99931c29
BLAKE2b-256 32ecc69d20fd1b380f7950441d121a035efff069cac22487b9eebd07d4de8a86

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 494562167dbe6b0ae2f97a62c760bb17d3b05a227421631cecd13a27b431c721
MD5 2d3132722216e2986110891d709f45ea
BLAKE2b-256 fdd016409a4760d0e057122060309fe1cb402234fe3c4456c51727daf4e0aedb

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ca0553857856e378e998dcb0f42463398936ed97a01b180bdc9daab3d067a493
MD5 ebad4140aba39645fb701e3aca37d7cb
BLAKE2b-256 153e40f9a95ab12bf4793a03577016cfb315a59cbaaeda0fd68b5ecaf4180bb0

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 31095cee9f4af7f509d480f9bfe207b795d30b1222ea58efe96bf9c55c1bdad8
MD5 4f47f75ee52318b63776caeeae5c9af2
BLAKE2b-256 181642aca2d108d47affd23599e716363daca35334e16489cb3c5aafaefb603d

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp312-cp312-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 435459057fe01bf09f31766c2d9b0f355b0b305e30b085f1c042cd15e7122204
MD5 d871c6795d0296c64b59ef8366627653
BLAKE2b-256 beec50f5dc4483eb53600cc32f6b148e6bbc1e6ba6adc570c2a7ebb250c13c59

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 45103506c32c8472f7f5dc733f8ff40d6df3e1eccedc6e0a4ac34da40ad6dd87
MD5 53fe24265f20a2e80fc36aeafa0b0d7d
BLAKE2b-256 43d9732957540bf4eb5b02323e30d27955fd5ecc7cae7122248271c485cb3dbe

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 acfd478771adf60b8be2adeb1a1a4dcc752b53ab042611c4db07579d52f8fbb9
MD5 dc7dc11717ef1fc53827dabdf67f1c67
BLAKE2b-256 972c926a0f378f058818c61462f59d8996725d0bc06b9651c44741106d40017c

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f07ed1401e65830d106ff8daa4a8a61c2b68c2833e2fe532054f28a3d7095d78
MD5 afd58982e1758f8d92900cafa26b6544
BLAKE2b-256 7df95dd9cea04b8eb95bb772ed50f1b2fd0795277d155d50ad17f3fe72a6e9d5

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 5c5031642022a6130817ef2c849baca4d297097bc3f52cdad86ea7dea304d746
MD5 13f916502201c3532f3198d7cec8f759
BLAKE2b-256 b160997a262f00004c08678a9594d12242ee6c30f1ec562341f2e9fa299af700

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp311-cp311-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 1c0444fe9adabcb0b77995edbbecbb0dc581b7ad0d2b4c786727e63b11c4a6e5
MD5 307bee3e4f1f7d1a1ef4952727ad82a3
BLAKE2b-256 9c856aaeed03dd7d373ea88103e53caa37ca71105f1a8f235e43ffd8db5181dc

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ad11d7c2ca7a169eac54092936a83ac727146d64ca805631eee846d77885e146
MD5 97deed877c46f2210902a235cd4fbb12
BLAKE2b-256 182cd185f442d0491d0da9ec59ca009b7ecb3eba0c398a285a1ceaaeae89bfcf

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6ef641b3390c25ca72375204d4b172eb538d4b1ed6f50a5325801548771a8271
MD5 37232f60d28043aff67c19f97b03ad6b
BLAKE2b-256 25f854b3f9830963893cf08ef8dc6aa5a466e657079bd8111ca57bdf7e5886b2

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6d8f38b85d556f152a31e72b33bafdb8a1932a2687cd208d7b933bda5b599b7d
MD5 86cf7f4585f9baada486c15ec69e6f52
BLAKE2b-256 22ce395237cf4da7d1295febb8f6d69ab7e6364236b2a5f7c89ecea5d472bd6d

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp310-cp310-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 78327c8b56790f5f24f8fcf298186d8fcab94952a2b8bbb8f10fc0dd93f92feb
MD5 87bc9863006e152697df3af971194484
BLAKE2b-256 9e35abcbca357f3295239e1c16116581354045c97f55b0d7ad96d91ad8ad5df0

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp310-cp310-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 bb098bf9e3b8b82c6a2dddbd85928dd8dad8eaf3887e2263edad3ae30db4dcdb
MD5 5f554d4d99b56eeb4a1206263f49e410
BLAKE2b-256 0cb0b8c12a0f1ff5371f9d8d770d72ce44cb5fcd99b153a0b5ff297bebb893f7

See more details on using hashes here.

File details

Details for the file seamless_entropy-0.2.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for seamless_entropy-0.2.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ced699beadbc8e6935ded017aa2ee600dce0236340c8a432dd3067ae0769d4ca
MD5 031fe7a8ba59dad476b32bcbdbc38196
BLAKE2b-256 ad8d1252d6bf3d433a187071090004392cdf90f4d6f955ebf3c60566717b0211

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