Apply new architecture with base plugin dopt.SharpPython #3

Merged
foefl merged 3 commits from new_arch into main 2025-06-19 07:56:08 +00:00
5 changed files with 37 additions and 13 deletions
Showing only changes of commit 9ccab97fe7 - Show all commits

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dopt.TOMTests", "dopt.TOMTests\dopt.TOMTests.csproj", "{28496580-EF8C-4D54-8FEF-BAA2E4970367}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dopt.TOM", "dopt.TOM\dopt.TOM.csproj", "{73F5A4E6-A788-4BBE-CE74-61670014CEE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +23,14 @@ Global
{28496580-EF8C-4D54-8FEF-BAA2E4970367}.Release|Any CPU.Build.0 = Release|Any CPU
{28496580-EF8C-4D54-8FEF-BAA2E4970367}.Release|x64.ActiveCfg = Release|Any CPU
{28496580-EF8C-4D54-8FEF-BAA2E4970367}.Release|x64.Build.0 = Release|Any CPU
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Debug|Any CPU.ActiveCfg = Debug|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Debug|Any CPU.Build.0 = Debug|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Debug|x64.ActiveCfg = Debug|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Debug|x64.Build.0 = Debug|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Release|Any CPU.ActiveCfg = Release|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Release|Any CPU.Build.0 = Release|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Release|x64.ActiveCfg = Release|x64
{73F5A4E6-A788-4BBE-CE74-61670014CEE3}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -13,9 +13,11 @@ namespace dopt.TOM
internal const string langMainStopSearchFolderName = "python";
internal const string doptTOMPluginLibraryUsage = "1";
protected dynamic tomWrapperPipelines;
public Plugin(string runtimePath) : base(SharpPython.PyOptimLevels.O, threaded: false, runtimePath: runtimePath, verbose: true)
{
Environment.SetEnvironmentVariable("LANG_MAIN_BASE_FOLDERNAME", langMainBaseFolderName, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("LANG_MAIN_STOP_SEARCH_FOLDERNAME", langMainStopSearchFolderName, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("DOPT_TOM_PLUGIN_LIBRARY_USAGE", doptTOMPluginLibraryUsage, EnvironmentVariableTarget.Process);
base.Initialise();
using (Py.GIL())
{

View File

@ -1,11 +0,0 @@
namespace dopt.TOMTests
{
[TestClass]
public sealed class Test1
{
[TestMethod]
public void TestMethod1()
{
}
}
}

17
dopt.TOMTests/Tests.cs Normal file
View File

@ -0,0 +1,17 @@
namespace dopt.TOMTests
{
using dopt.TOM;
[TestClass]
public sealed class PluginTests
{
public const string rtPath = @"A:\Arbeitsaufgaben\MOP-TOM\tom-plugin-deploy\bin";
public const string dummyData = @"Dummy_Dataset_N_1000.csv";
[TestMethod]
public void RunPipelineOnTestData()
{
var plugin = new Plugin(rtPath);
plugin.RunOnCSV("t123", dummyData);
plugin.Dispose();
}
}
}

View File

@ -13,6 +13,8 @@
For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
-->
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
@ -22,6 +24,10 @@
<PackageReference Include="MSTest" Version="3.6.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dopt.TOM\dopt.TOM.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>