Skip to content

Commit

Permalink
Fix Tunny optimization environment check
Browse files Browse the repository at this point in the history
  • Loading branch information
hrntsm committed Feb 18, 2024
1 parent 6e3287f commit 25e544b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Tunny/Component/Optimizer/BoneFishComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ protected override void SolveInstance(IGH_DataAccess DA)
CheckObjectivesInput(Params.Input[1].Sources.Select(ghParam => ghParam.InstanceGuid));
CheckArtifactsInput(Params.Input[3].Sources.Select(ghParam => ghParam.InstanceGuid));

var settings = TunnySettings.LoadFromJson();
string tunnyAssembleVersion = TEnvVariables.Version.ToString(3);
if (settings.CheckPythonLibraries || settings.Version != tunnyAssembleVersion)
{
AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "The optimization environment has not been built; launch the UI of the Tunny component once and install Python.");
return;
}

bool start = false;
bool stop = false;
if (!DA.GetData(4, ref start)) { return; }
Expand Down Expand Up @@ -96,7 +104,7 @@ protected override void SolveInstance(IGH_DataAccess DA)
Params.Output[1].ClearData();
Params.Output[2].ClearData();

OptimizeLoop.Settings = TunnySettings.LoadFromJson();
OptimizeLoop.Settings = settings;
var worker = new BackgroundWorker
{
WorkerReportsProgress = true,
Expand Down

0 comments on commit 25e544b

Please sign in to comment.