Skip to main content

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.

pd.lib.utility
..............

The module contents followed useful functions:

name2klass
Return klass by name

klass2name
Return name by klass


pd.lib.topsort
..............

The module contents classes developed to provide different kind of topologic
sort. All classes are use as:

TopSort([<Parameters>])(<Items>), где :

Parameters
Sort execution parameters;

Items
Each item is a pair of object reference and object reference list which one depend;

Followed classes are provided by module:

TopSort
Simple topologic sort;

TopSortIndex
Simple topologic sort for any kind of object;

TopSortFuzzy
Fuzzy topologic sort;

TopSortFuzzyIndex
Fuzzy topologic sort for any kind of object;


Fuzzy topologic sort can transform to linear ordered array graph with
cyclomatic value more then zero. Best results achieved on litle values:
the sort is for tree with a few cycles.


* Sun Jan 13 2008 Andrey Orlov <dbdt@dreambot.ru> 0.0.5
- Module fuzzyobject added

* Sat Dec 22 2007 Andrey Orlov <dbdt@dreambot.ru> 0.0.4
- Module topsort added

* Mon Dec 10 2007 Andrey Orlov <dbdt@dreambot.ru> 0.0.3
- Module utility added

* Tue Nov 13 2007 Andrey Orlov <dbdt@dreambot.ru> 0.0.2
- HeapSortIndexSafe class added

* Mon Nov 12 2007 Andrey Orlov <dbdt@dreambot.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.5.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file pd.lib-0.0.5.tar.gz.

File metadata

  • Download URL: pd.lib-0.0.5.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pd.lib-0.0.5.tar.gz
Algorithm Hash digest
SHA256 7952c71f8e188d1e7e9360c717c74a9c5a69f5ce0f33567ad34cd667a1df89e8
MD5 bd48caeee6a962d7f7fcb3bbd211dc9f
BLAKE2b-256 58f53fd2abeb677a0143a9b1ee7e37a790245268c118fd249314fa4522167fee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page