Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Incorrect name

discer

Generic linear-time sorting and partitioning

Based on this paper by Fritz Henglein.

Warning before you start using this library

The standard libraries sorted function has linear-time sorting in the average case (Timsort) and is way more optimized than this library and will almost certainly be faster than any sorting done with this library.

discer.relations contains a Relation type that represents the Order and Equiv types from the paper along with a few of standard relations from the paper. discer.grouping and discer.sorting contain the respective Equiv and Order based from functions from the paper.

Future work

Not in any particular order:

  • Better README and docs
  • Add some tests
  • Optimize
    • Lazy evaluation over the key/pair list to reduces passes on it
    • Defer to sorted when it will likely (or definitely) run in linear time
    • The paper includes some optimizations not included
    • Generic Multiset Programming may also contain further optimizations
  • Setup SumL and ProductL to use TypeVarTuple
  • Functions to extend Relations
    • list :: Relation a -> Relation [a]
    • tuple :: Relation a -> Relation Tuple[a, ...]
    • dict :: Relation a -> Relation Dict[k, a]
  • Refactor sdisc and disc, the functions are basically exactly the same except how they deal with Natural
  • Add compatibility for at least Python 3.8+

References

Henglein, Fritz. "Generic top-down discrimination for sorting and partitioning in linear time." Journal of Functional Programming 22.3 (2012): 300-374.

Metadata

Release files for discr 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discr 0.1.0
File Size Uploaded
discr-0.1.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discr 0.1.0
File Interpreter ABI Platform
discr-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / discr-0.1.0.tar.gz

Download URL discr-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed7d642413cbd47003cf82cb5e139d07598c0b1260c2c751f2b052a977695a50
BLAKE2b-256 checksum
How to use checksums
77d7881e2dd7dabd183974d8bca894673cd5ad611c64e26298e49f69095aa0f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release files / discr-0.1.0-py3-none-any.whl

Download URL discr-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28384f729edd1d2d47f6d213aece8f834d2bdef19b37dc908d7c0d3d234a64e1
BLAKE2b-256 checksum
How to use checksums
adc50d0791004a600f3f9efc710050c3e5f4efc7535ec727174bc5f9d738cd2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page