Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Toolkit to manage sets of closed intervals.

License

NotificationsYou must be signed in to change notification settings

oar-team/procset.py

Repository files navigation

Toolkit to manage sets of closed intervals.

procset is a pure python module to manage sets of closed intervals. It can beused as a small python library to manage sets of resources, and is especiallyuseful when writing schedulers.

Features

  • Free Software: licensed under LGPLv3 (seeLICENSE.rst).
  • Pure Python module :)
  • Thoroughly tested!
  • Drop-in replacement for interval_set (seeintsetwrap.py).

Limitations

  • The provided implementation target only Python 3 (I do not want to maintainold stuff :P).
  • The intervals bounds have to be non-negative integers.

Requirements

  • setuptools>=34.4.0

Example use

What does it look like to useprocset? Here is a simple example program:

fromprocsetimportProcSetfree_cores=ProcSet((0,7))# I have 8 cores to work withjob_cores=ProcSet((2,5))# let's use some cores for a jobfree_cores-=job_coresprint('remaining cores:',str(free_cores))

And it looks like this when run:

$ python example.pyremaining cores: 0-1 6-7

About

Toolkit to manage sets of closed intervals.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp