From ff1d19bc8b3c377aefda32b36baf55d44fa1d80a Mon Sep 17 00:00:00 2001 From: Thomas Edward Kingstone Date: Tue, 12 Dec 2023 16:08:39 +0000 Subject: [PATCH 1/3] added bool run with default false to BasePythonEnvironment --- Python_Engine/Compute/BasePythonEnvironment.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Python_Engine/Compute/BasePythonEnvironment.cs b/Python_Engine/Compute/BasePythonEnvironment.cs index f4190d6..9aa25ca 100644 --- a/Python_Engine/Compute/BasePythonEnvironment.cs +++ b/Python_Engine/Compute/BasePythonEnvironment.cs @@ -37,9 +37,15 @@ public static partial class Compute [Input("reload", "Reload the base Python environment rather than recreating it, if it already exists.")] [Output("env", "The base Python Environment for all BHoM workflows.")] public static PythonEnvironment BasePythonEnvironment( + bool run = false, bool reload = true ) { + if (!run) + { + return null; + } + if (!Directory.Exists(Query.DirectoryEnvironments())) { // create PythonEnvironments directory if it doesnt already exist From 6c907b8d9a77ff5ce37268fcca4b57d58f7e2459 Mon Sep 17 00:00:00 2001 From: Thomas Edward Kingstone Date: Tue, 12 Dec 2023 16:22:11 +0000 Subject: [PATCH 2/3] Versioning --- Python_Engine/Compute/BasePythonEnvironment.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python_Engine/Compute/BasePythonEnvironment.cs b/Python_Engine/Compute/BasePythonEnvironment.cs index 9aa25ca..91cae42 100644 --- a/Python_Engine/Compute/BasePythonEnvironment.cs +++ b/Python_Engine/Compute/BasePythonEnvironment.cs @@ -35,7 +35,9 @@ public static partial class Compute { [Description("Retrieve or reinstall the base Python Environment for BHoM workflows.")] [Input("reload", "Reload the base Python environment rather than recreating it, if it already exists.")] + [Input("run", "Start the installation/retrieval of the BHoM Base Python Environment.")] [Output("env", "The base Python Environment for all BHoM workflows.")] + [PreviousVersion("BH.Engine.Python.Compute.BasePythonEnvironment(System.Boolean)")] public static PythonEnvironment BasePythonEnvironment( bool run = false, bool reload = true From bff88f446e410aaefd0c2210db53a5f2ba0ceaaa Mon Sep 17 00:00:00 2001 From: Thomas Edward Kingstone Date: Tue, 12 Dec 2023 16:47:08 +0000 Subject: [PATCH 3/3] versioning better this time --- Python_Engine/Compute/BasePythonEnvironment.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Python_Engine/Compute/BasePythonEnvironment.cs b/Python_Engine/Compute/BasePythonEnvironment.cs index 91cae42..0a4abbc 100644 --- a/Python_Engine/Compute/BasePythonEnvironment.cs +++ b/Python_Engine/Compute/BasePythonEnvironment.cs @@ -37,10 +37,10 @@ public static partial class Compute [Input("reload", "Reload the base Python environment rather than recreating it, if it already exists.")] [Input("run", "Start the installation/retrieval of the BHoM Base Python Environment.")] [Output("env", "The base Python Environment for all BHoM workflows.")] - [PreviousVersion("BH.Engine.Python.Compute.BasePythonEnvironment(System.Boolean)")] + [PreviousVersion("7.0", "BH.Engine.Python.Compute.BasePythonEnvironment(System.Boolean)")] public static PythonEnvironment BasePythonEnvironment( - bool run = false, - bool reload = true + bool reload = true, + bool run = false ) { if (!run)