From 89c6692f2a5e54e1be24721d554a502f462e65ac Mon Sep 17 00:00:00 2001 From: Constantin Chaumet <16308584+Jekannadar@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:48:23 +0200 Subject: [PATCH 1/2] Bump cosy version to 0.0.1.dev29, Adds visualization feature --- examples/getting_started/basic_example.py | 5 +++-- examples/getting_started/variation_example.py | 5 +++-- examples/lot_sizing/lot_sizing_pipeline.py | 5 +++-- examples/ml_blood_sugar_level/ml_blood_sugar_level.py | 5 +++-- pyproject.toml | 2 +- tests/test_task_id_generation.py | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/examples/getting_started/basic_example.py b/examples/getting_started/basic_example.py index a079bc6..17be47f 100644 --- a/examples/getting_started/basic_example.py +++ b/examples/getting_started/basic_example.py @@ -36,13 +36,14 @@ def run(self): TaskB, ) maestro = Maestro(repo.cls_repo, repo.taxonomy) - results = list(maestro.query(TaskB.target())) + results = maestro.query(TaskB.target()) luigi.build(results, local_scheduler=True, detailed_summary=True) print( textwrap.dedent( f""" =============================================== - There are a total of {len(results)} results + There are a total of {len(list(results))} results ===============================================""" ) ) + results.visualize() \ No newline at end of file diff --git a/examples/getting_started/variation_example.py b/examples/getting_started/variation_example.py index 49ab853..728ff50 100644 --- a/examples/getting_started/variation_example.py +++ b/examples/getting_started/variation_example.py @@ -43,16 +43,17 @@ class SubstituteNameByJaneDoeTask(SubstituteNameTask): def main(): repo = CoSyLuigiRepo(WriteTemplateTask, SubstituteNameTask) maestro = Maestro(repo.cls_repo, repo.taxonomy) - results = list(maestro.query(SubstituteNameTask.target())) + results = maestro.query(SubstituteNameTask.target()) luigi.build(results, local_scheduler=True, detailed_summary=True) print( textwrap.dedent( f""" =============================================== - There are a total of {len(results)} results + There are a total of {len(list(results))} results ===============================================""" ) ) + results.visualize() if __name__ == "__main__": diff --git a/examples/lot_sizing/lot_sizing_pipeline.py b/examples/lot_sizing/lot_sizing_pipeline.py index a775326..9a021ec 100644 --- a/examples/lot_sizing/lot_sizing_pipeline.py +++ b/examples/lot_sizing/lot_sizing_pipeline.py @@ -161,13 +161,14 @@ def run_optimizer(self, cost, demand): ) print(PredictDemand.get_all_variants()) maestro = Maestro(repo.cls_repo, repo.taxonomy) - results = list(maestro.query(OptimizeLots.target())) + results = maestro.query(OptimizeLots.target()) luigi.build(results, local_scheduler=True, detailed_summary=True) print( textwrap.dedent( f""" =============================================== - There are a total of {len(results)} results + There are a total of {len(list(results))} results ===============================================""" ) ) + results.visualize() \ No newline at end of file diff --git a/examples/ml_blood_sugar_level/ml_blood_sugar_level.py b/examples/ml_blood_sugar_level/ml_blood_sugar_level.py index 8228880..f3e6d15 100644 --- a/examples/ml_blood_sugar_level/ml_blood_sugar_level.py +++ b/examples/ml_blood_sugar_level/ml_blood_sugar_level.py @@ -161,16 +161,17 @@ def main(): EvaluateRegressionModel, ) maestro = Maestro(repo.cls_repo, repo.taxonomy) - results = list(maestro.query(EvaluateRegressionModel.target())) + results = maestro.query(EvaluateRegressionModel.target()) luigi.build(results, local_scheduler=True, detailed_summary=True) print( textwrap.dedent( f""" =============================================== - There are a total of {len(results)} results + There are a total of {len(list(results))} results ===============================================""" ) ) + results.visualize() if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 90ff5a9..8f0030f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dependencies = [ - "combinatory-synthesizer==0.0.1.dev24", + "combinatory-synthesizer==0.0.1.dev29", "luigi==3.8.0" ] diff --git a/tests/test_task_id_generation.py b/tests/test_task_id_generation.py index 728073e..f23c49c 100644 --- a/tests/test_task_id_generation.py +++ b/tests/test_task_id_generation.py @@ -131,7 +131,7 @@ def test_shading_not_possible(repo): repo.cls_repo, repo.taxonomy, ) - luigi.build(list(maestro.query(Evaluate.target())), local_scheduler=True, detailed_summary=True) + luigi.build(maestro.query(Evaluate.target()), local_scheduler=True, detailed_summary=True) assert target_a.exists() assert target_b.exists() @@ -149,7 +149,7 @@ def test_shading_would_be_possible(shadeable_repo): shadeable_repo.cls_repo, shadeable_repo.taxonomy, ) - luigi.build(list(maestro.query(EvaluateWithPotentialToShade.target())), local_scheduler=True, detailed_summary=True) + luigi.build(maestro.query(EvaluateWithPotentialToShade.target()), local_scheduler=True, detailed_summary=True) assert not (target_a.exists() and target_b.exists()) From 2b137c8da08f7cef7f2356a2fad4bb9917356791 Mon Sep 17 00:00:00 2001 From: Constantin Chaumet <16308584+Jekannadar@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:51:30 +0200 Subject: [PATCH 2/2] Format --- examples/getting_started/basic_example.py | 2 +- examples/lot_sizing/lot_sizing_pipeline.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/getting_started/basic_example.py b/examples/getting_started/basic_example.py index 17be47f..b32279f 100644 --- a/examples/getting_started/basic_example.py +++ b/examples/getting_started/basic_example.py @@ -46,4 +46,4 @@ def run(self): ===============================================""" ) ) - results.visualize() \ No newline at end of file + results.visualize() diff --git a/examples/lot_sizing/lot_sizing_pipeline.py b/examples/lot_sizing/lot_sizing_pipeline.py index 9a021ec..cf9e5d5 100644 --- a/examples/lot_sizing/lot_sizing_pipeline.py +++ b/examples/lot_sizing/lot_sizing_pipeline.py @@ -171,4 +171,4 @@ def run_optimizer(self, cost, demand): ===============================================""" ) ) - results.visualize() \ No newline at end of file + results.visualize()