Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed an absolute path, removed WinForms #9

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>WinFormsSVS_test</RootNamespace>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>ConsoleAppSVS_test</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SVSModel\SVSModel.csproj" />
<ProjectReference Include="..\TestModel\TestModel\TestModel.csproj" />
</ItemGroup>



</Project>
</Project>
4 changes: 4 additions & 0 deletions modelCsharp/ConsoleAppSVS-test/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

using TestModel;

Test.RunTests(TestConfigData.configDict);
16 changes: 10 additions & 6 deletions modelCsharp/SVSModel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SVSModel.Excel", "SVSModel.
{255D77C7-5338-42BC-A136-8801657D51BB} = {255D77C7-5338-42BC-A136-8801657D51BB}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsSVS-test", "WinFormsSVS-test\WinFormsSVS-test.csproj", "{7DD24577-0C84-42E1-B10C-551BB92A718A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestModel", "TestModel\TestModel\TestModel.csproj", "{B98654E6-CEB9-4418-ACC8-DFC06055081B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAppSVS-test", "ConsoleAppSVS-test\ConsoleAppSVS-test.csproj", "{9C1F1537-6CE7-4C6E-8B89-CD9276C3F6D6}"
EndProject
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "testGraph", "TestModel\testGraph\testGraph\testGraph.pyproj", "{4311625B-8B0C-45C1-B2C3-C7CFC084E381}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -28,14 +30,16 @@ Global
{30EFA8DB-CE6D-4B36-9EBC-0A0B2CD7A444}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30EFA8DB-CE6D-4B36-9EBC-0A0B2CD7A444}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30EFA8DB-CE6D-4B36-9EBC-0A0B2CD7A444}.Release|Any CPU.Build.0 = Release|Any CPU
{7DD24577-0C84-42E1-B10C-551BB92A718A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DD24577-0C84-42E1-B10C-551BB92A718A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DD24577-0C84-42E1-B10C-551BB92A718A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DD24577-0C84-42E1-B10C-551BB92A718A}.Release|Any CPU.Build.0 = Release|Any CPU
{B98654E6-CEB9-4418-ACC8-DFC06055081B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B98654E6-CEB9-4418-ACC8-DFC06055081B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B98654E6-CEB9-4418-ACC8-DFC06055081B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B98654E6-CEB9-4418-ACC8-DFC06055081B}.Release|Any CPU.Build.0 = Release|Any CPU
{9C1F1537-6CE7-4C6E-8B89-CD9276C3F6D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C1F1537-6CE7-4C6E-8B89-CD9276C3F6D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C1F1537-6CE7-4C6E-8B89-CD9276C3F6D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C1F1537-6CE7-4C6E-8B89-CD9276C3F6D6}.Release|Any CPU.Build.0 = Release|Any CPU
{4311625B-8B0C-45C1-B2C3-C7CFC084E381}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4311625B-8B0C-45C1-B2C3-C7CFC084E381}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
14 changes: 9 additions & 5 deletions modelCsharp/TestModel/TestModel/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting;
using static IronPython.Modules._ast;
using System.IO;

namespace TestModel
{
public class Test
{
private static void runPythonScript()
{
////just checking
string progToRun = @"C:\Users\1989s\source\repos\SVS\modelCsharp\TestModel\testGraph\testGraph\testGraph.py";
string dir = Directory.GetCurrentDirectory();
string newPath = Path.GetFullPath(Path.Combine(dir, @"..\..\..\..\"));
string progToRun = newPath+ @"TestModel\testGraph\testGraph\testGraph.py";

Process proc = new Process();
proc.StartInfo.FileName = "python.exe";
proc.StartInfo.RedirectStandardOutput = true;
Expand All @@ -42,7 +46,7 @@ private static void runPythonScript()
public static void RunTests(Dictionary<string, object> _configDict)

{

string dir = Directory.GetCurrentDirectory();
//DataFrame testConfigs = Crop.LoadCoefficients("SVSModel.Data.TestConfig.csv");

string resourceName = "TestModel.TestConfig.csv";
Expand Down Expand Up @@ -97,9 +101,9 @@ public static void RunTests(Dictionary<string, object> _configDict)
nextRow.Add(new KeyValuePair<string, object>(OutPutHeaders[c], output[r, c]));
}
newDataframe.Append(nextRow, true);
}
}

DataFrame.SaveCsv(newDataframe, @"C:\Users\1989s\source\repos\svs\modelCsharp\TestModel\testGraph\OutputFiles\" + test + ".csv");
DataFrame.SaveCsv(newDataframe, dir + "\\OutputFiles\\" + test + ".csv");

}
runPythonScript();
Expand Down
1 change: 0 additions & 1 deletion modelCsharp/TestModel/TestModel/TestModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
</ItemGroup>



<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
Expand Down
20 changes: 17 additions & 3 deletions modelCsharp/TestModel/testGraph/testGraph/testGraph.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import os
import pandas as pd
import matplotlib.pyplot as plt
import datetime as dt
import numpy as np

data = pd.read_csv(r"C:\Users\1989s\source\repos\svs\modelCsharp\TestModel\testGraph\OutputFiles\test 1.csv",index_col=0)
observed_data = pd.read_csv(r"C:\Users\1989s\source\repos\svs\modelCsharp\TestModel\testGraph\OutputFiles\observed.csv",index_col=0)
import glob


path = os.getcwd()

data = pd.read_csv(path + r"\OutputFiles\test 1.csv",index_col=0)
observed_data = pd.read_csv(path +r"\OutputFiles\observed.csv",index_col=0)

observed_data.sort_index(axis=0,inplace=True)

tests = ['test 1','test 2','test 3']

#tests = []

#fullpath =path + r"\\OutputFiles\\"

#for file in os.listdir(fullpath):
# if file.endswith(".csv") and file.startswith("test"):
# tests.append(file)

Alltests =[]
for t in tests[:]:
Alltests.append(pd.read_csv(r"C:/Users/1989s/source/repos/svs/modelCsharp/TestModel/testGraph/OutputFiles/"+t+".csv",index_col=0))
Alltests.append(pd.read_csv( path + "\\OutputFiles\\"+t+".csv",index_col=0))

AllData = pd.concat(Alltests,axis=1,keys=tests)
AllData.index = pd.to_datetime(AllData.index,format = "%d/%m/%Y %H:%M:%S %p")
Expand Down
7 changes: 0 additions & 7 deletions modelCsharp/TestModel/testGraph/testGraph/testGraph.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
<ItemGroup>
<Content Include="example.csv" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\svs\modelCsharp\SVSModel\SVSModel.csproj">
<Name>SVSModel</Name>
<Project>{255d77c7-5338-42bc-a136-8801657d51bb}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="testGraph.py" />
</ItemGroup>
Expand Down
65 changes: 0 additions & 65 deletions modelCsharp/WinFormsSVS-test/Form1.Designer.cs

This file was deleted.

23 changes: 0 additions & 23 deletions modelCsharp/WinFormsSVS-test/Form1.cs

This file was deleted.

120 changes: 0 additions & 120 deletions modelCsharp/WinFormsSVS-test/Form1.resx

This file was deleted.

Loading