Toolkit to manage sets of closed intervals.
Project description
Toolkit to manage sets of closed intervals.
procset is a pure python module to manage sets of closed intervals. It can be used as a small python library to manage sets of resources, and is especially useful when writing schedulers.
Features
Free Software: licensed under LGPLv3 (see LICENSE.rst).
Pure Python module :)
Thoroughly tested!
Drop-in replacement for interval_set (see intsetwrap.py).
Limitations
The provided implementation target only Python 3 (I do not want to maintain old stuff :P).
The intervals bounds have to be non-negative integers.
Requirements
setuptools>=34.4.0
Example use
What does it look like to use procset? Here is a simple example program:
from procset import ProcSet
free_cores = ProcSet((0, 7)) # I have 8 cores to work with
job_cores = ProcSet((2, 5)) # let's use some cores for a job
free_cores -= job_cores
print('remaining cores:', str(free_cores))
And it looks like this when run:
$ python example.py
remaining cores: 0-1 6-7
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file procset-1.0.tar.gz
.
File metadata
- Download URL: procset-1.0.tar.gz
- Upload date:
- Size: 165.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10921a4fe902822b6d4c94691abbf1965a29bc81157215f1a9092305e21fc146 |
|
MD5 | 8fa45d30e92bb2f529913f95e9ffb6ee |
|
BLAKE2b-256 | ff9717a02573b1842204a2cf8a1328221b41cd120bc450c872a4de14405aeb74 |
File details
Details for the file procset-1.0-py3-none-any.whl
.
File metadata
- Download URL: procset-1.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6804d642f59bc4a88046c34fe42840e09d72b71d5504678c0b09ac0de1b98af9 |
|
MD5 | b7de97b4f437e57435a438b37e4a7ad9 |
|
BLAKE2b-256 | 16c87e64f7a08fd6fa72df8f332b06821ff757dd091e3ada4494f920a85c1caa |