Compare commits
No commits in common. "main" and "v0.1.2" have entirely different histories.
@ -13,27 +13,15 @@ namespace dopt.TOM
|
|||||||
internal const string langMainStopSearchFolderName = "python";
|
internal const string langMainStopSearchFolderName = "python";
|
||||||
internal const string doptTOMPluginLibraryUsage = "1";
|
internal const string doptTOMPluginLibraryUsage = "1";
|
||||||
protected dynamic tomWrapperPipelines;
|
protected dynamic tomWrapperPipelines;
|
||||||
public Plugin(string runtimePath = "") : base(SharpPython.PyOptimLevels.O, threaded: false, runtimePath: runtimePath, verbose: true)
|
public Plugin(string runtimePath) : base(SharpPython.PyOptimLevels.O, threaded: false, runtimePath: runtimePath, verbose: true)
|
||||||
{
|
{
|
||||||
// keep these env variables within C#, but set them again in Python to mitigate issues in propagation from C# to Python
|
|
||||||
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();
|
base.Initialise();
|
||||||
|
|
||||||
using (Py.GIL())
|
using (Py.GIL())
|
||||||
{
|
{
|
||||||
dynamic os = Py.Import("os");
|
dynamic os = Py.Import("os");
|
||||||
// set environment variables directly in Python
|
os.putenv("LANG_MAIN_BASE_FOLDERNAME", langMainBaseFolderName);
|
||||||
using (PyDict kwargs = new PyDict())
|
os.putenv("LANG_MAIN_STOP_SEARCH_FOLDERNAME", langMainStopSearchFolderName);
|
||||||
{
|
os.putenv("DOPT_TOM_PLUGIN_LIBRARY_USAGE", doptTOMPluginLibraryUsage);
|
||||||
kwargs.SetItem("LANG_MAIN_BASE_FOLDERNAME", new PyString("bin"));
|
|
||||||
kwargs.SetItem("LANG_MAIN_STOP_SEARCH_FOLDERNAME", new PyString("python"));
|
|
||||||
kwargs.SetItem("DOPT_TOM_PLUGIN_LIBRARY_USAGE", new PyString("1"));
|
|
||||||
// Call function with no positional arguments, only keyword arguments
|
|
||||||
os.environ.update.Invoke(new PyTuple(), kwargs);
|
|
||||||
}
|
|
||||||
tomWrapperPipelines = Py.Import("tom_plugin.pipeline");
|
tomWrapperPipelines = Py.Import("tom_plugin.pipeline");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,12 +3,12 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<Version>0.1.4</Version>
|
<Version>0.1.2</Version>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="dopt.SharpPython" Version="0.4.4" />
|
<PackageReference Include="dopt.SharpPython" Version="0.4.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
[TestClass]
|
[TestClass]
|
||||||
public sealed class PluginTests
|
public sealed class PluginTests
|
||||||
{
|
{
|
||||||
public const string rtPath = @"A:\Arbeitsaufgaben\MOP-TOM\deployment\integration-test\bin";
|
public const string rtPath = @"A:\Arbeitsaufgaben\MOP-TOM\tom-plugin-deploy\bin";
|
||||||
public const string dummyData = @"Dummy_Dataset_N_1000.csv";
|
public const string dummyData = @"Dummy_Dataset_N_1000.csv";
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void RunPipelineOnTestData()
|
public void RunPipelineOnTestData()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user