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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.13macOS 14.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

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

Uploaded CPython 3.12macOS 14.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

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

Uploaded CPython 3.11macOS 14.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.39+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

seamless_entropy-0.2.3-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.3.tar.gz.

File metadata

  • Download URL: seamless_entropy-0.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4f013ab7db572b276504bb0d9a8603edab9406e65fea3befdee655faa47e33dc
MD5 d98cc8324d6f26914a1268cf2875fd0c
BLAKE2b-256 fd51a3df20ae9da3499d60723a0717739ba6916578d286aade1b067576d153e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0e94775ece3eee7831a1fba1c8b6f6a2efd82d65449a556fb17067d5121a97f4
MD5 f9a84e0715cdb34dc30c2003c4fe15bc
BLAKE2b-256 e4d35ec2e2c574e25c50fbc3d1f8c83f34c6954236838444fd262624a528d70a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 537a61887dcac85a5de5ac5dd4736001e08be715e1c3bde75854e027ed62d56d
MD5 03938d8db25b3d25dfa3921021ace35c
BLAKE2b-256 d8a3242cbe6a1ae19dc7482a5dd70406a4233960ffd3a669e0926aa2cc30cc3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp313-cp313-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 03014bdf32d124768205ea6fda9257d06b0c364c3e4dfef3b88f0bbab25530c3
MD5 8c06809aa6203d030622a978abf777af
BLAKE2b-256 4d761a2c706fe31c342bc60067ac9ad5c48bcbef1e1fea8232270ad523c083c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 32a4c5719712d8a77f5782598d82c9fa19d3b086528e6f5467836bf899c8dade
MD5 c0e45e66c97c644809e749b869c0b529
BLAKE2b-256 3c46c03b76b559603ce78ac959210a84f2d9dee9af7acfef3f66c3e166f03e4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9ff984c5d5947abd779af80d02249b70147f232377f19a27502797c9c7a41706
MD5 4d7aa03cc4d80777e41246816f46d8ad
BLAKE2b-256 8f0551c685e2d494530787240340fda44d700b0fe6216ab8143132452ab24f0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e6fa1f0f04ecba0c7c720bc2ed0338759c72b4e8c39c784a9cc901bcdb932112
MD5 ef0fd3cbe5610a90e8c6e3a7372e0f9e
BLAKE2b-256 1097d6b99866c984ad2e84854970921bfe1824e94771c505fc1b2470a95e22cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp312-cp312-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 3df6846e483ac90c522b6e561fe24c16aee207aa6322384bdf599b122a1b4f6f
MD5 4ca3db1f58e56840a890d2dbaa16db21
BLAKE2b-256 b46aa7d6c0a64aa0bf509c2a42af58a7b99e0fce12fef8c0e7178a0d9b9a739e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 2989c8dcc10a9bcfa94b28c811424b26e4e12949444cfde5f5975ebaf17f203e
MD5 7890648a0dbb549808aded0e4775f88b
BLAKE2b-256 a4e25085fe38aecc41c66f9c6c84c28bfb5a17b5258d7bbf2771e972c6b2a8f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 00fea411ad32604e83bd55bf8460c5fea48662d8f1f9c7c26b8168e02c6a88a9
MD5 2c0a3406bd30ffaff17e984003299f36
BLAKE2b-256 3a9fba5e70387f5a6566a863d6514fc9994f2c12bf71edf067e3c8836281438b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8600160a4fcdfeb1bcc02fa5aa94282a36c67f3dc154a49e4c92fd34ede01e19
MD5 30422eef8c3921ca5a93a7dca9d4af27
BLAKE2b-256 e14d6b22ec5ada6b27855f6157c7036b41fc85892742429aa1027733e54d0a85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 dda3ed0eb9066f350b87404e305e84d2c251aba1f8298993e8de61dd66af8d1e
MD5 7d95d51c0c3be2215e05fe827a96a595
BLAKE2b-256 f98664132e929847dbf3f55989b58ecf16dd2fd37ee1e517449dbdadfddb9dbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp311-cp311-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 83e410701f53ab4e5924c6068ee3442fe796ad10230f85131106edbaf467885b
MD5 43be215f6fd10d753c91e05a79f4f685
BLAKE2b-256 64f2d7f624a464290c8645f49e9f69934b4538006884a0a2759efe7d8e1f4c28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 40a8b9d7c24d5bd45e684920cb521229027f3f4bf758a1f18d98d7fa913ecd57
MD5 e76ac959f38f9af4aee3447ff9fe56d9
BLAKE2b-256 25aa5923b9b6447c2c7158d8bb2ad75d2c7a9247dde784d2d76577d909f5c6b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c3a8599bb513416a3413a0ef0a8197215fe08131d648cf5de24bcc1f7764d8c9
MD5 628c27544a9477bfa643d0b5968be652
BLAKE2b-256 bd840acf6da4f24551892e81ad4b4de92355737fb2787a5a366c3e09765172e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9c5cabf08f6fece9145abb2488ced685ba371b7cd4e74ad81df8f293a2a59a47
MD5 cb805a61c945d98c8316c35102927d7a
BLAKE2b-256 ce0dc765bd98e9de7906c4543c10b83d3b7610e4cbc5adeceb5d2902d0d24d71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3110b39a579e5c45cbf3c4e3b33dcf9f3393faa0bc36f3071d91b04955ee13c4
MD5 2c22b2b5b382c57d801722b446feab4a
BLAKE2b-256 078dead22130251fad291f53184a25048cff1fedda6756c1a1668bf87d99bc9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp310-cp310-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 985f0713016bba8715323a56ecee4294154af652337dd85d73f0c6e92ec1a181
MD5 4d02128cab404e48b45e62ef0485bed2
BLAKE2b-256 f702ae84f01408b81567783d87e16dcec4753a780c6c4b33a8a988c92086c267

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 b6f4e7a68f1336b5f9a81d2636fbd71afc6b46a3a3b2a6a9e1730d667a148eac
MD5 f799a2421a7cf85187e4405bcaa40455
BLAKE2b-256 d8e403dbbf2804fb39c3485700bdf43048c7eb0e3246e5f89e9e2a12b8ae87c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for seamless_entropy-0.2.3-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 30cc6552b4d55fc1f2e509ce326b424de1b92321a3a9055dd7bd6c49bde05543
MD5 67b0f04b7e99d4a0884e72fc3e650eb3
BLAKE2b-256 7eb0ce63d9ec15644417b69695c08050a7612ada681588fbfa75ef463d6c9eff

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