From 430d9d20068aa822c46b3282faf0c63f9f02f296 Mon Sep 17 00:00:00 2001 From: Greg Elphick <11791585+elphick@users.noreply.github.com> Date: Thu, 16 May 2024 13:06:27 +0800 Subject: [PATCH] 160 make dag progress bar optional (#162) * closes #160. progress bar optional, plus untested dag bugfix. * closes #160. second dag bugfix. --- CHANGELOG.rst | 9 +++++++++ elphick/mass_composition/dag.py | 8 +++++++- pyproject.toml | 2 +- scripts/bump_version.py | 3 --- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 442e929d..2cc7fbd7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +Mass_Composition 0.6.2 (2024-05-16) +=================================== + +Bugfix +------ + +- Second fix for DAG.run ValueError('generator already running') - managed result type. (160a) + + Mass_Composition 0.6.1 (2024-05-16) =================================== diff --git a/elphick/mass_composition/dag.py b/elphick/mass_composition/dag.py index e6058060..7060bd74 100644 --- a/elphick/mass_composition/dag.py +++ b/elphick/mass_composition/dag.py @@ -237,7 +237,13 @@ def execute_node(self, node: str, strms: dict): for successor in self.graph.successors(node): updated_edges[(node, successor)] = result - return node, list(result), updated_edges + # Check the type of the result + if isinstance(result, MassComposition): + # If the result is a Stream object, return it as is + return node, result, updated_edges + else: + # If the result is a generator or a tuple of Stream objects, convert it to a list + return node, list(result), updated_edges def plot(self): plt.figure(figsize=(8, 6)) diff --git a/pyproject.toml b/pyproject.toml index 69d49f9c..14b5c070 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mass-composition" -version = "0.6.1" +version = "0.6.2" description = "For managing multi-dimensional mass-composition datasets, supporting weighted mathematical operations and visualisation." authors = ["Greg "] packages = [{ include = "elphick/mass_composition" }] diff --git a/scripts/bump_version.py b/scripts/bump_version.py index e989bd77..ba8693d7 100644 --- a/scripts/bump_version.py +++ b/scripts/bump_version.py @@ -5,9 +5,6 @@ def run_command(command): process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = process.communicate() - print(f"stdout: {stdout.decode()}") - print(f"stderr: {stderr.decode()}") process.wait()