From 0a606a15e0eb82d01a45eb60a8722e3628c79f74 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:42:51 +0000 Subject: [PATCH 1/2] Fix nbopen standard output and error handling in notebook generation Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com> --- bionetgen/core/main.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bionetgen/core/main.py b/bionetgen/core/main.py index 32de2a9d..d97b05a5 100644 --- a/bionetgen/core/main.py +++ b/bionetgen/core/main.py @@ -233,13 +233,24 @@ def generate_notebook(app): app.log.debug(f"Writing notebook to file: {fname}", f"{__file__} : notebook()") notebook.write(fname) # open the notebook with nbopen - # TODO: deal with stdout/err app.log.debug( f"Attempting to open notebook {fname} with nbopen", f"{__file__} : notebook()", ) - stdout = getattr(subprocess, app.config["bionetgen"]["stdout"]) - stderr = getattr(subprocess, app.config["bionetgen"]["stderr"]) + try: + stdout_loc = getattr(subprocess, app.config["bionetgen"]["stdout"]) + except (AttributeError, KeyError): + stdout_loc = subprocess.PIPE + try: + stderr_loc = getattr(subprocess, app.config["bionetgen"]["stderr"]) + except (AttributeError, KeyError): + stderr_loc = subprocess.STDOUT + if args.open: command = ["nbopen", fname] - rc, _ = run_command(command) + process = subprocess.Popen( + command, + stdout=stdout_loc, + stderr=stderr_loc, + ) + rc = process.wait() From 52bd0f6ac4bbc20bb65e92aefa9572230eef5892 Mon Sep 17 00:00:00 2001 From: akutuva21 Date: Mon, 13 Apr 2026 10:20:44 -0400 Subject: [PATCH 2/2] chore: PR #89 remove forbidden artifacts and run black --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 39aa9026..f9bf9c80 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ temp_testing/* build dist Issues/rule_keywords/test_DeleteMolecules_changed.bngl +.jules/ +__pycache__/