Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

procset

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

procset

Toolkit to manage sets of closed intervals.

  • 1.0
  • PyPI
  • Socket score

Maintainers
3

========== procset.py

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 <src/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:

.. code:: python

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:

.. code:: bash

$ python example.py remaining cores: 0-1 6-7

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc