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.4.tar.gz (4.6 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.4-cp313-cp313-win_amd64.whl (8.7 kB view details)

Uploaded CPython 3.13Windows x86-64

seamless_entropy-0.2.4-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.4-cp313-cp313-manylinux_2_39_aarch64.whl (14.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

seamless_entropy-0.2.4-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.4-cp312-cp312-manylinux_2_39_aarch64.whl (14.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

seamless_entropy-0.2.4-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.4-cp311-cp311-manylinux_2_39_aarch64.whl (14.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

seamless_entropy-0.2.4-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.4-cp310-cp310-manylinux_2_39_aarch64.whl (12.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

seamless_entropy-0.2.4-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.4.tar.gz.

File metadata

  • Download URL: seamless_entropy-0.2.4.tar.gz
  • Upload date:
  • Size: 4.6 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.4.tar.gz
Algorithm Hash digest
SHA256 0a5fd13e2f66311cb9f6e599fa8026a8cab8a127dfc3753fc6cec8ade7f40928
MD5 43503b9f12f6784d8921cc4aa00831cf
BLAKE2b-256 ca9cac4fcc21ec728a5122018ed8a972812690ecfde3bd58a95f7e56e6f1a472

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 249e17dc32040255da6cac74eee867178211860665a1c06728be4e28a61bd386
MD5 74602d78909e16ead0899e28904a4a72
BLAKE2b-256 f27e9a4379f139d111fdb6b0b95abb1afeb8422b9c9bc9bf64402033e8e9abdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 75ad1eea0cb6c1e6879570c6e22a0230a451c67fec0a13e10d2bfb9adcab16eb
MD5 a742c0a2c879c99608a781f9736709b3
BLAKE2b-256 9bfa9026a376592d5d70962a3d1a3ea258a2ba078d2bf36d790ed82b2050fa24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 40777cf0582cc913bb0587ed83f275aa2a56053aaa425e7a7f9dd8927890af84
MD5 335d4bbaaf910b33b85ad96aa8857beb
BLAKE2b-256 133530dea13d719178e9dda7284c0bb3cccdbaf82fd2f00c60749b1078a3075c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d47ec6ee57662aae6dc52c2a85858383d1f36670ff0ff76c438a126845b34d8e
MD5 8cfbf71b71cf2cf2ea74ab9e3f59d00c
BLAKE2b-256 87383b393f5a349f1f136b7eea74dff9751989b51f5c9a66b1445acf9e98273c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c3a4288c8d9a7e3ac66289f7c772b629bfe447c2ea451ca920abc65a585ec7f2
MD5 8655674e8fdb09f68a24cb31767d3b02
BLAKE2b-256 77e6736dfcfc6c57cb123518ccad201021043d17a88b17704425b416915190f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a6f6fb9a432aec50a1e859981e2ff14a2edf012016a0f1f8879ebe020d220e07
MD5 5f640aaa887cfa4c9386dbfeac421856
BLAKE2b-256 18b56c9c7268d95f122c74766f956c83f28ebbaa17615654503e3696a8f49687

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 b10638308ed31ec652ce71a55c6d75a96cd6550e693445feadc1c9fab4ec9fdc
MD5 818f7f1f9dd03893f623e81a50e69ce5
BLAKE2b-256 71bd21dec4636569cec4260232aa924b1156403e9a2086e9998a7ef32ddd4401

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 048ae24f17a3449dcf567fcfff77a3da7eb87764e361f4df56bff3464c675c06
MD5 d67294e017bceca7850ec05a7d14f895
BLAKE2b-256 2eec1386d5449374c9e5375e672b323cd9e2a92051741e47196851b17f168f3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 bba617a2807edcce49578a571c297aac54450b4b53eae9f084ecde319736ae7c
MD5 a6123dcb1a49b8136b06499c9a8fa78b
BLAKE2b-256 5d991604ea3116bdebf30c195e4a7245bc2a63da30fd12ae7fcc67104c25a0b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cddea11456c224080170e755a91421c61c92f9b9ddc0d9f7cbfc429fe85661e6
MD5 002ff02ebd70dcf07f9f91aba333ccae
BLAKE2b-256 6010ed3606693c40aaf22e55a2fdb07a294dd5a5cccccfbcd088b6ee5bf648f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 dafeec3b6c93188bb283e1e0a6b14fccc3913a9e90719c52ccae020efde9b038
MD5 d23f37bfaba2f0f1601ef36ffefdb40a
BLAKE2b-256 17d1ae97fb25e7d16df03ff3aae89bcb5c5d73cbe1270f8a68cc3221bfe3036b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 645ba66447e8637eae6888b18fa548652039a0199c90aa11e1b047c7a934081f
MD5 f0c473c5753bb44cf293cbc316b6fc39
BLAKE2b-256 fb14c722b19617c3428dd5b82fcdfc675614aba81d48513f75cc5df28dafc213

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 036c1681bbe23793387b8c16f19c0a4f786d49cb5d77f789aa5568f6cba9da58
MD5 22796d591c53c6eb830ae1d65b1e3c66
BLAKE2b-256 759f75aa55fc241cbd61483632bf784dfd5d32dc230bf61fc4c66ea5bbac77da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f9d876c29331e2a2b821d76fc157565b27be95d00f5322218ec873dcbb653109
MD5 7736fbe73080f608273641f389657f8d
BLAKE2b-256 6ef9abac392220af2151402f93360368de10b6ea3aad247f287495cb34fe8e1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 25ce16b13058ddafafefaae3ed98d34237ae31ea19e50956690f07f8b7b445f1
MD5 46ffdbda18f9b55535ca5e2b56332d74
BLAKE2b-256 54dae505414e69fc715db6bbe790462329e7903aa93b8de2e258a3f1f7e60ac7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7c7313725a5de3f562c0e78d1b2ba9ec08d2816c39822f49d8aff90b3e6c01c4
MD5 e1113b1d5e46ae7bf743fded90cd9f70
BLAKE2b-256 9c6d5aab650cb2766833ce6abe3dc1ac363a0baffbcd8e9529a47817921c6381

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp310-cp310-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 33e8b784df637fe41cfdfa2a4b38c8ca25bf69b4f1bacf0b454faf75db6492b2
MD5 4bdf67bf1bdf46e9df4148cfe1bf6103
BLAKE2b-256 2ac5078b6b7c6620dd769f7c4b32ed9d3d72c8c5e5573431f66c05f33ffb5926

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 b98e1395fac63910e911ee785797a2cc3c4f43f5fb78379b63341f3da2f1a8ec
MD5 3b5a1285425419381a13b7c09c78f1f0
BLAKE2b-256 04e70a87e3962fc6fc88d23eb91e8e67dab5955b8b3b973ac5eab43823536210

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.4-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e0ff907a571ce9971527977a77433bee50f9632d75f22bd6abcc1e41b277f209
MD5 4da4cf8f7c9f1d9c178f641d2d794f87
BLAKE2b-256 16718db5709b523c7f075662f56de3bd34260943fbaf43a2cc7bd43cdeb7091d

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