Library of small but useful modules
Project description
Short module description
=========================
Module pd.lib content some simple modules
and fucntions.
Description of modules
----------------------
pd.lib.heapsort
...............
The module is simple lazy sort implementation realised therewith heapq
module. Items will be sorted only when accepted and using of computation
resource is minimazed.
Two classes are provided by module:
HeapSort
On initialization accepted item list and comparing
function;
HeapSortByIndex
On initialization accepted item list and index. List
items mapped on index values and can be compared by them. In this
case third parameter - revert - are used. Revert can be True or
False. If revert is True then array will be sorted in reverse order.
Parameter revert is False by default.
HeapSortByIndexSafe
It class liked on HeapSortByIndex above, but use index in extremely safe
manner: if item omited from index it mapped on infinity and any item are
comparable;
Classes, mentioned above, to provide methods:
chunk(n)
Return first n items from begin sorted list.
* Tue Nov 13 2007 Andrey Orlov <cray@neural.ru> 0.0.2
- HeapSortIndexSafe class added
* Mon Nov 12 2007 Andrey Orlov <cray@neural.ru> 0.0.1
- first official release
=========================
Module pd.lib content some simple modules
and fucntions.
Description of modules
----------------------
pd.lib.heapsort
...............
The module is simple lazy sort implementation realised therewith heapq
module. Items will be sorted only when accepted and using of computation
resource is minimazed.
Two classes are provided by module:
HeapSort
On initialization accepted item list and comparing
function;
HeapSortByIndex
On initialization accepted item list and index. List
items mapped on index values and can be compared by them. In this
case third parameter - revert - are used. Revert can be True or
False. If revert is True then array will be sorted in reverse order.
Parameter revert is False by default.
HeapSortByIndexSafe
It class liked on HeapSortByIndex above, but use index in extremely safe
manner: if item omited from index it mapped on infinity and any item are
comparable;
Classes, mentioned above, to provide methods:
chunk(n)
Return first n items from begin sorted list.
* Tue Nov 13 2007 Andrey Orlov <cray@neural.ru> 0.0.2
- HeapSortIndexSafe class added
* Mon Nov 12 2007 Andrey Orlov <cray@neural.ru> 0.0.1
- first official release
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
pd.lib-0.0.2.tar.gz
(3.5 kB
view details)
File details
Details for the file pd.lib-0.0.2.tar.gz
.
File metadata
- Download URL: pd.lib-0.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62183e307fb079d19467007d0529b8fde7e6471bb6247d999f2115e1ede39abe |
|
MD5 | f8b7f6c1be4ba297d948012776acd135 |
|
BLAKE2b-256 | 01709a6e6969d8421c1213e790bf54f7fd7cc315a6390a168079939bdb904ac0 |