Skip to main content

Graph Scheduler

CI Coverage Status

A graph scheduler generates the order in which the nodes of a directed acyclic graph (DAG) are executed using the structure of the graph and expressive conditions. Specifically, a scheduler uses a topological ordering of the nodes as a base sequence of execution and further restricts execution based on predefined or custom conditions provided by the user. Patterns of execution are linked to abstract units of time and may optionally be mapped to real time units using pint.

Documentation is available on github-pages for the current release and for the current main branch. For prior releases, go to https://kmantel.github.io/graph-scheduler/tag/<tag_name>.

Installation

Install from pypi:

pip install graph-scheduler

Example

The graph is specified here in dependency dictionary format, but networkx Digraphs are also supported.

>>> import graph_scheduler

>>> graph = {
    'A': set(),
    'B': {'A'},
    'C': {'A'},
    'D': {'B', 'C'},
}

>>> sched = graph_scheduler.Scheduler(graph=graph)
>>> sched.add_condition('C', graph_scheduler.EveryNCalls('A', 2))
>>> sched.add_condition('D', graph_scheduler.EveryNCalls('C', 2))

>>> print(list(sched.run()))
[{'A'}, {'B'}, {'A'}, {'C', 'B'}, {'A'}, {'B'}, {'A'}, {'C', 'B'}, {'D'}]

Metadata

Release files for graph-scheduler 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graph-scheduler 1.2.2
File Size Uploaded
graph-scheduler-1.2.2.tar.gz 95.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graph-scheduler 1.2.2
File Interpreter ABI Platform
graph_scheduler-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 147.6 kB

Release files / graph-scheduler-1.2.2.tar.gz

Download URL graph-scheduler-1.2.2.tar.gz
Size 95.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d43bcff55decde8106a9b592d8899e788985b504111163545de257cfd7df6ec1
BLAKE2b-256 checksum
How to use checksums
ce21df5a22c07318cffd32cecfe5a212d4e37d1e5194e3c96b27ce49a046c119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / graph_scheduler-1.2.2-py3-none-any.whl

Download URL graph_scheduler-1.2.2-py3-none-any.whl
Size 52.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c52be82887e662b13177fdb236ac3ebe45faf7cd404d9321eb7d2c058c1ff088
BLAKE2b-256 checksum
How to use checksums
04207eb9eed7693379ca4d6082a9f76df7985309d71fbf39ad329d4181c73cdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page