Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
0d72b3f
Update assembly file version to 9.1.0.0
BHoMBot Dec 22, 2025
b693605
Update copyright headers to new year 2026
BHoMBot Dec 22, 2025
b1d66aa
Start of milestone changes for 9.1 (#193)
michaelhoehn Dec 23, 2025
f4865b7
Added python version 3.12.3 to possible versions.
Tom-Kingstone Jan 15, 2026
22ca840
Added Python version 3.12.3 to possible installable versions (#195)
jamesramsden-bh Jan 22, 2026
ebbc0c0
added log reading methods, and also minor improvements to error capture
Tom-Kingstone Jan 19, 2026
e5f8425
added helper methods for analytics
Tom-Kingstone Jan 20, 2026
cbb40ea
change console logger default level, and some fixes for analytics, cr…
Tom-Kingstone Jan 20, 2026
c3e0223
Apply suggestions from code review
Tom-Kingstone Jan 20, 2026
7571b87
component id to allow more precise logging.
Tom-Kingstone Jan 22, 2026
e60c0ef
make summarise more like BHoM analytics and improve analytics logger …
Tom-Kingstone Jan 26, 2026
31f1a15
fix implementation of c# ticks to be unix ticks to better reflect BHo…
Felix-Mallinder Jan 28, 2026
d49ff9c
Analytics log reader/summariser (#197)
jamesramsden-bh Jan 29, 2026
5045910
Fix index for stack trace extraction in error conversion
Tom-Kingstone Jan 29, 2026
a436b56
fix analytics
Tom-Kingstone Jan 29, 2026
9dc9eb6
Fix index for stack trace extraction in analytics error serialisation…
jamesramsden-bh Feb 2, 2026
bbc9534
fixed double scaling
Felix-Mallinder Feb 19, 2026
75e1281
changed base to 1970, reverted previous incorrect fix
Felix-Mallinder Feb 19, 2026
2dae569
Added a host of widgets, a default root object, default styling methods
Felix-Mallinder Feb 20, 2026
98aa1b9
renamed filing
Felix-Mallinder Feb 20, 2026
7b91664
included bhom branding
Felix-Mallinder Feb 20, 2026
3c8b30e
fixed style sheet
Felix-Mallinder Feb 20, 2026
c1fb71d
wip hand over to felix
Tom-Kingstone Feb 23, 2026
a1b97d9
improved theme methodology
Felix-Mallinder Feb 23, 2026
0dbb249
Improved default root use
Felix-Mallinder Feb 23, 2026
f05f88a
add a multi tick selection widget
Felix-Mallinder Feb 23, 2026
784a6a5
Added colour picker tool
Felix-Mallinder Feb 24, 2026
5a47506
Improved widget config with _widget_base inherited class
Felix-Mallinder Feb 24, 2026
1691431
Add warning message box window
Felix-Mallinder Feb 24, 2026
1f44ff8
Improved default methods uses in window tools
Felix-Mallinder Feb 24, 2026
2eb28c4
Improved packing, added documentation, added drop down widget
Felix-Mallinder Feb 24, 2026
e7a629b
Fixed `bson_unix_ticks` scale bug (#201)
jamesramsden-bh Feb 25, 2026
5975e3e
updated file naming to snake case, added init file imports, improved …
Felix-Mallinder Feb 25, 2026
bb5fc6a
added button and labels
Felix-Mallinder Feb 25, 2026
a146acf
fixed small errors, added testing script, added adaptability to cala…
Felix-Mallinder Feb 25, 2026
78df46c
smaller calendar changes
Felix-Mallinder Feb 25, 2026
66f7e84
init change
Felix-Mallinder Feb 25, 2026
09f6020
Added widget level validation
Felix-Mallinder Feb 25, 2026
6f3bee6
improved label support
Felix-Mallinder Feb 25, 2026
2a89156
bug fixes
Felix-Mallinder Feb 25, 2026
8b9419a
top_most default arg
Felix-Mallinder Feb 25, 2026
0b36be4
fixed processing window
Felix-Mallinder Feb 25, 2026
e412d93
Merge branch 'develop' into Python_Toolkit-#202-Tkiner-UI-BHoM-Standa…
Felix-Mallinder Feb 26, 2026
bd67979
updates to cmap selector & relative paths for images & icons
Felix-Mallinder Feb 26, 2026
d29aad9
small update
Felix-Mallinder Feb 27, 2026
f7b86f7
added init to use bhom.mplstyle for plots
Tom-Kingstone Feb 27, 2026
72047ef
delete temp test files
Felix-Mallinder Feb 27, 2026
28c9945
fixed font styling issue. removed duplicate tick box widgets
Felix-Mallinder Feb 27, 2026
289c95c
Add grid options
Felix-Mallinder Mar 2, 2026
4cc35b4
added plot sizing
Felix-Mallinder Mar 2, 2026
2627163
added consistent alignment controls for widgets
Felix-Mallinder Mar 2, 2026
00a9e8c
fixed useless button get/set methods
Felix-Mallinder Mar 4, 2026
ab05480
auto sizing changes
Felix-Mallinder Mar 4, 2026
e82a5de
button custom command exception handling
Felix-Mallinder Mar 9, 2026
99bf758
removed dark detect, improved button colouring
Felix-Mallinder Mar 9, 2026
8fecd1f
Added theme folder and some refactoring
jamesramsden-bh Mar 10, 2026
12843dc
Tkinter standardised approach (#203)
jamesramsden-bh Mar 10, 2026
e192172
fix all subprocess runs by setting PYTHONHOME to empty string
Tom-Kingstone Mar 11, 2026
f309a15
patched ; wrong tcl path, logo import issue, logged widgets bug
Felix-Mallinder Mar 12, 2026
a795d90
(code compliance) rename InstallPackage.cs to Install.cs
Tom-Kingstone Mar 12, 2026
f1366b5
documentation compliance
Tom-Kingstone Mar 12, 2026
7321d7d
move bhom.mplstyle to parent directory, and use a style context to pl…
Tom-Kingstone Mar 3, 2026
3f5c5a0
add a style for use with dark backgrounds
Tom-Kingstone Mar 9, 2026
14b6742
don't globally change plt.style, and use the bhom style for the figur…
Tom-Kingstone Mar 9, 2026
c60e441
update dark style axis title colour
Tom-Kingstone Mar 11, 2026
c387559
remove darkdetect from test
Tom-Kingstone Mar 12, 2026
c38a324
added global get method
Felix-Mallinder Mar 12, 2026
b9e504b
test warning s
Felix-Mallinder Mar 12, 2026
f415bbb
list box width
Felix-Mallinder Mar 13, 2026
c071b33
fixed get methods to cache values for dead widgets
Felix-Mallinder Mar 13, 2026
3edc3b0
format changes and spin box. fixed list return on liost box
Felix-Mallinder Mar 16, 2026
5c71565
Merge branch 'Python_Toolkit_#207-tkinter-ui-patches' into Python_Too…
Tom-Kingstone Mar 16, 2026
67c4f2f
radio styling change.
Felix-Mallinder Mar 16, 2026
bd49221
spin box fix
Felix-Mallinder Mar 16, 2026
c449aac
Fix grasshopper in rhino 8 failing to call python properly (#206)
jamesramsden-bh Mar 16, 2026
7a92792
some styling fixes for dark items on light mode
Felix-Mallinder Mar 17, 2026
1afa3b0
add argument to bhom base window to allow submitting without destroyi…
Tom-Kingstone Mar 17, 2026
2acb028
Added plot style context managers to all plot methods (#208)
jamesramsden-bh Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Python_Engine/Compute/BasePythonEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -79,3 +79,4 @@ public static PythonEnvironment BasePythonEnvironment(
}



6 changes: 4 additions & 2 deletions Python_Engine/Compute/Download.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -91,7 +91,7 @@ public static string DownloadFile(

[Description("Download and install a specified version of python, and return the executable for it.")]
[Input("version", "The version of python to download.")]
[Output("pythonExecutable", "The executable (python.exe) for the python version that was installed")]
[Output("pythonExecutable", "The executable (python.exe) for the python version that was installed.")]
public static string DownloadPythonVersion(this PythonVersion version)
{
string url = version.EmbeddableURL();
Expand Down Expand Up @@ -122,6 +122,7 @@ public static string DownloadPythonVersion(this PythonVersion version)
}
})
{
install.StartInfo.Environment["PYTHONHOME"] = "";
install.Start();
string stderr = install.StandardError.ReadToEnd();
install.WaitForExit();
Expand All @@ -148,3 +149,4 @@ public static string DownloadPythonVersion(this PythonVersion version)
}



Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -59,9 +59,10 @@ List<string> packages
FileName = executable,
Arguments = $"-m pip install --no-warn-script-location {packagesString}",
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardError = true
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down Expand Up @@ -111,6 +112,7 @@ string requirements
RedirectStandardError = true,
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand Down Expand Up @@ -155,6 +157,7 @@ string packageDirectory
RedirectStandardError = true,
}
};
process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand All @@ -178,3 +181,4 @@ string packageDirectory
}



4 changes: 3 additions & 1 deletion Python_Engine/Compute/Remove.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -109,6 +109,7 @@ public static void RemoveBaseVersion(PythonVersion version = PythonVersion.v3_10
}
})
{
uninstall.StartInfo.Environment["PYTHONHOME"] = "";
uninstall.Start();
string stderr = uninstall.StandardError.ReadToEnd();
uninstall.WaitForExit();
Expand Down Expand Up @@ -139,3 +140,4 @@ public static void RemoveEverything()
}



5 changes: 4 additions & 1 deletion Python_Engine/Compute/RequirementsTxt.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -69,6 +69,8 @@ public static string RequirementsTxt(
RedirectStandardOutput = true
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";
using (Process p = Process.Start(process.StartInfo))
{
StreamWriter sr = new StreamWriter(targetPath);
Expand All @@ -86,3 +88,4 @@ public static string RequirementsTxt(
}



4 changes: 3 additions & 1 deletion Python_Engine/Compute/Run.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -52,6 +52,7 @@ public static string RunCommandStdout(string command, bool hideWindows = true, s
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
commandMode = "/C";
}
process.StartInfo.Environment["PYTHONHOME"] = "";
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
Expand Down Expand Up @@ -100,3 +101,4 @@ public static string RunPythonString(this oM.Python.PythonEnvironment env, strin
}



3 changes: 2 additions & 1 deletion Python_Engine/Compute/UnzipFile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -83,3 +83,4 @@ public static void UnzipFile(
}



7 changes: 6 additions & 1 deletion Python_Engine/Compute/VirtualEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -91,6 +91,8 @@ public static PythonEnvironment VirtualEnvironment(this PythonVersion version, s
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";

using (Process p = Process.Start(process.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand All @@ -114,6 +116,8 @@ public static PythonEnvironment VirtualEnvironment(this PythonVersion version, s
}
};

process.StartInfo.Environment["PYTHONHOME"] = "";

using (Process p = Process.Start(process2.StartInfo))
{
string standardError = p.StandardError.ReadToEnd();
Expand All @@ -128,3 +132,4 @@ public static PythonEnvironment VirtualEnvironment(this PythonVersion version, s
}



3 changes: 2 additions & 1 deletion Python_Engine/Convert/ToPython.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -39,3 +39,4 @@ public static bool ToPython<T>(this T[,] input)
}
}
}

3 changes: 2 additions & 1 deletion Python_Engine/Modify/AddQuotesIfRequired.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of the Buildings and Habitats object Model (BHoM)
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
*
* Each contributor holds copyright over their respective contributions.
* The project versioning (Git) records all such contribution source information.
Expand Down Expand Up @@ -35,7 +35,7 @@
[Description("Adds quotes to a string (usually a file-path) if it contains spaces.")]
[Input("path", "The file-path to add quotes around if necessary.")]
[Output("path", "A usable file-path.")]
public static string AddQuotesIfRequired(this string path)

Check warning on line 38 in Python_Engine/Modify/AddQuotesIfRequired.cs

View check run for this annotation

BHoMBot-CI / beta-code-compliance

Python_Engine/Modify/AddQuotesIfRequired.cs#L38

Modify methods should return void, or their return type should be different to the input type of their first parameter - For more information see https://bhom.xyz/documentation/DevOps/Code%20Compliance%20and%20CI/Compliance%20Checks/ModifyReturnsDifferentType
{
return !string.IsNullOrWhiteSpace(path) ?
path.Contains(" ") && (!path.StartsWith("\"") && !path.EndsWith("\"")) ?
Expand All @@ -48,3 +48,4 @@




20 changes: 20 additions & 0 deletions Python_Engine/Python/src/python_toolkit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Base module for the python_toolkit package."""
# pylint: disable=E0401
import getpass
import os
from pathlib import Path

import matplotlib.pyplot as plt

# pylint: disable=E0401

# get common paths
DATA_DIRECTORY = (Path(__file__).parent.parent / "data").absolute()
BHOM_DIRECTORY = (Path(__file__).parent / "bhom").absolute()
HOME_DIRECTORY = (Path("C:/Users/") / getpass.getuser()).absolute()

TOOLKIT_NAME = "Python_Toolkit"

if os.name == "nt":
# override "HOME" in case this is set to something other than default for windows
os.environ["HOME"] = (Path("C:/Users/") / getpass.getuser()).as_posix()
8 changes: 8 additions & 0 deletions Python_Engine/Python/src/python_toolkit/bhom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Root for the bhom subpackage."""

import os
from pathlib import Path # pylint: disable=E0401
from os import path
import tempfile
Expand All @@ -9,6 +10,13 @@
TOOLKIT_NAME = "Python_Toolkit"
BHOM_VERSION = importlib.metadata.version("python_toolkit")

#Environment variable that if set disables BHoM analytics logging.
DISABLE_ANALYTICS = os.environ.get("DISABLE_BHOM_ANALYTICS", None)
if DISABLE_ANALYTICS is None:
DISABLE_ANALYTICS = False
else:
DISABLE_ANALYTICS = True

if not BHOM_LOG_FOLDER.exists():
BHOM_LOG_FOLDER = Path(tempfile.gettempdir()) / "BHoM" / "Logs"
BHOM_LOG_FOLDER.mkdir(exist_ok=True, parents=True)
Loading