From b00f23f9ecfa821b793835f8f92332538ee7b9ea Mon Sep 17 00:00:00 2001 From: minwook-shin Date: Sat, 5 Oct 2024 11:09:39 +0900 Subject: [PATCH] release 0.4.0 --- Changelog.md | 13 +++++++++++++ README.md | 4 ++-- f_scheduler/modules/dag.py | 1 + pyproject.toml | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 12b989b..2dd555c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,18 @@ # Changelog +## Release 0.4.0 + +### Features + +- add graphlib library to check cycle in the scheduler + - raise error if cycle is detected + +```python +from f_scheduler import DAG + +dag = DAG(use_graphlib=True) +``` + ## Release 0.3.0 ### Features diff --git a/README.md b/README.md index c49942f..0fd9f8a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ pip install f-scheduler from f_scheduler import ConditionOperator, DefaultFunctionOperator, IterFunctionOperator, DAG, Converter # create a DAG -dag = DAG() +dag = DAG(use_graphlib=True) # add tasks to the DAG dag.add_task(DefaultFunctionOperator(function=print, param=(['hello']), task_id='hello_task')) @@ -38,7 +38,7 @@ task_order = ['hello_task', 'condition_task', 'iter_task', 'bye_task'] # set the dependency between tasks # using the converter converter = Converter(dag) -converter.convert_list_to_dag(task_order).run('hello_task') +converter.convert_list_to_dag(task_order).run() # or dag.set_downstream('hello_task', 'condition_task') # dag.set_downstream('condition_task', 'iter_task') diff --git a/f_scheduler/modules/dag.py b/f_scheduler/modules/dag.py index 639e9b2..d7ef1c9 100644 --- a/f_scheduler/modules/dag.py +++ b/f_scheduler/modules/dag.py @@ -28,6 +28,7 @@ def run(self, start_task_id=None): start_task.run() else: order = list(self.graph.static_order()) + order.reverse() for task_id in order: self.tasks[task_id].run() diff --git a/pyproject.toml b/pyproject.toml index bd32143..01501c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ exclude = ['f_scheduler*tests'] [project] name = "f-scheduler" -version = "0.3.0" +version = "0.4.0" description = "Simplify Function Scheduler with Python 3" authors = [ {name = "minwook-shin", email = "minwook0106@gmail.com"},