Skip to content

Commit

Permalink
fixed typo in build.yaml, added build badge to readme.md, fixed build…
Browse files Browse the repository at this point in the history
… config for utilities project, some formatting
  • Loading branch information
braunms committed Jul 13, 2023
1 parent f162489 commit 7b38511
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- run: nuget restore VisFroG.sln

- name: Build app for release
run: msbuild VisFroG.sln -t:rebuild -verbosity:diag -property:Configuration=Releas
run: msbuild VisFroG.sln -t:rebuild -verbosity:diag -property:Configuration=Release
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@


*.db


## ------------------------------------------------------------------------
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
1 change: 1 addition & 0 deletions EntityFrameworkDatabase/Migrations/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal sealed class Configuration : DbMigrationsConfiguration<EntityFrameworkD
{
public Configuration()
{
// Set data directory variable given in connection string of DatabaseContext
AppDomain.CurrentDomain.SetData("DataDirectory", Utilities.Artefacts.Path());

AutomaticMigrationsEnabled = false;
Expand Down
7 changes: 0 additions & 7 deletions EntityFrameworkDatabase/Models/DatabaseContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class DatabaseContext : DbContext
// For more information refer to the documentation:
// http://msdn.microsoft.com/en-us/data/jj591621.aspx


public DatabaseContext() : base("Data Source=(localdb)\\MSSQLLocalDB; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|" + Utilities.Artefacts.FileName("database", "mdf"))
/// Use base("name=DatabaseContext") to look for connectionString in App.config => But App.config can not be used by Grasshopper component
/// // DataDirectory is defined in CTOR of Configuration
Expand All @@ -33,11 +32,5 @@ public class DatabaseContext : DbContext

public System.Data.Entity.DbSet<EntityFrameworkDatabase.Models.Entity> Entites { get; set; }



}



}

106 changes: 0 additions & 106 deletions PythonInterface/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,6 @@ public class Script
{
public string ID { get; set; }

/*
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, Slider
from bokeh.plotting import Figure, output_file, show
output_file(""js_on_change.html"")
x = [x*0.005 for x in range(0, 200)]
y = x
source = ColumnDataSource(data=dict(x=x, y=y))
plot = Figure(width=400, height=400)
plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6)
callback = CustomJS(args=dict(source=source), code=""""""
console.log('JS handler called ...');
const data = source.data;
const f = cb_obj.value
const x = data['x']
const y = data['y']
for (let i = 0; i < x.length; i++) {
y[i] = Math.pow(x[i], f)
}
source.change.emit();
"""""")
slider = Slider(start=0.1, end=4, value=1, step=.1, title=""power"")
slider.js_on_change('value', callback)
layout = column(slider, plot)
show(layout)
*/


private string _source = @"#
#-----------------------------------------------------------------
Expand Down Expand Up @@ -154,12 +117,6 @@ public Script()
var pathToVirtualEnv = @"C:\ProgramData\Anaconda3";
Console.WriteLine(pathToVirtualEnv);

//var path = Environment.GetEnvironmentVariable("PATH").TrimEnd(';');
//path = string.IsNullOrEmpty(path) ? pathToVirtualEnv : path + ";" + pathToVirtualEnv;
//Environment.SetEnvironmentVariable("PATH", path, EnvironmentVariableTarget.Process);
//Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process);
//Environment.SetEnvironmentVariable("PYTHONHOME", pathToVirtualEnv, EnvironmentVariableTarget.Process);
//Environment.SetEnvironmentVariable("PYTHONPATH", python_path, EnvironmentVariableTarget.Process);
string python_path = $"{pathToVirtualEnv}\\Lib\\site-packages;{pathToVirtualEnv}\\Lib;{pathToVirtualEnv}\\DLLs";

PythonEngine.PythonHome = pathToVirtualEnv;
Expand All @@ -174,69 +131,6 @@ public Script()

PythonEngine.Initialize();
PythonEngine.BeginAllowThreads();

/*
Runtime.PythonDLL = @"C:\Users\<username>\AppData\Local\Programs\Python\Python310\python310.dll";
var pathToVirtualEnv = @"path\to\env";
// be sure not to overwrite your existing "PATH" environmental variable.
var path = Environment.GetEnvironmentVariable("PATH").TrimEnd(';');
path = string.IsNullOrEmpty(path) ? pathToVirtualEnv : path + ";" + pathToVirtualEnv;
Environment.SetEnvironmentVariable("PATH", path, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process);
// Environment.SetEnvironmentVariable("PYTHONHOME", pathToVirtualEnv, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONPATH", $"{pathToVirtualEnv}\\Lib\\site-packages;{pathToVirtualEnv}\\Lib", EnvironmentVariableTarget.Process);
PythonEngine.Initialize();
PythonEngine.PythonHome = pathToVirtualEnv;
PythonEngine.PythonPath = Environment.GetEnvironmentVariable("PYTHONPATH", EnvironmentVariableTarget.Process);
string pathToVirtualEnv = "/path/to/venv/";
Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONHOME", pathToVirtualEnv, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONPATH", $"{pathToVirtualEnv}\\Lib\\site-packages;{pathToVirtualEnv}\\Lib", EnvironmentVariableTarget.Process);
PythonEngine.PythonHome = pathToVirtualEnv;
PythonEngine.PythonPath = PythonEngine.PythonPath + ";" + Environment.GetEnvironmentVariable("PYTHONPATH", EnvironmentVariableTarget.Process);
*/


//var searchPaths = this._engine.GetSearchPaths();
//foreach (var s in searchPaths)
// Console.WriteLine(s);

//ICollection<string> searchPaths = new List<string>();

/*
// This will get the current WORKING directory (i.e. \bin\Debug)
string workingDirectory = Environment.CurrentDirectory;
// or: Directory.GetCurrentDirectory() gives the same result
// This will get the current PROJECT bin directory (ie ../bin/)
string projectDirectory = Directory.GetParent(workingDirectory).Parent.FullName;
// This will get the current PROJECT directory
string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.FullName
*/
/*
string workingDirectory = Environment.CurrentDirectory;
string basedir = Directory.GetParent(workingDirectory).Parent.FullName; // AppDomain.CurrentDomain.BaseDirectory;
string libpath = Path.Combine(basedir, "lib");
//searchPaths.Add(libpath);
//Console.WriteLine(libpath);
//searchPaths.Add(@"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\Lib");
//searchPaths.Add(@"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\Lib\site-packages");
searchPaths.Add(@"C:\Program Files\Python34\Lib");
searchPaths.Add(@"C:\Program Files\Python34\Lib\site-packages");
this._engine.SetSearchPaths(searchPaths);
*/

}

public void Execute()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- BADGES ------------------------------------------------------------------>

[![Build](https://github.com/IntCDC/VisFroG/actions/workflows/build.yml/badge.svg)](https://github.com/IntCDC/VisFroG/actions/workflows/build.yml)
[![Github Repo Badge](https://img.shields.io/badge/github-repo-000.svg?logo=github&labelColor=gray&color=blue)](https://github.com/IntCDC/VisFroG)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![GitHub License](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.tik.uni-stuttgart.de/IntCDC-RDM-RSE/VisFroG/blob/main/LICENSE)
Expand Down
2 changes: 2 additions & 0 deletions Utilities/ArtefactPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ public class Artefacts

static public string Path()
{
// Returns the path of the VisFroG plugin, e.g. C:\Users\...\AppData\Roaming\Grasshopper\Libraries\VisFrog
return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); // System.AppContext.BaseDirectory;
}

static public string FileName(string body, string extension)
{
// Append unified prefix
const string prefix = "visfrog_";
return prefix + body + "." + extension; ;
}
Expand Down
51 changes: 36 additions & 15 deletions Utilities/Utilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,50 @@
<Deterministic>true</Deterministic>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<OutputPath>$(SolutionDir)bin</OutputPath>
<OutputPath>$(SolutionDir)bin</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
16 changes: 8 additions & 8 deletions VisFroG.sln
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ Global
{AC9A69F3-1273-46CD-BDD2-14BC512C8413}.Release|x86.Build.0 = Release|x86
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x64.ActiveCfg = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x64.Build.0 = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x86.ActiveCfg = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x86.Build.0 = Debug|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x64.ActiveCfg = Debug|x64
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x64.Build.0 = Debug|x64
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x86.ActiveCfg = Debug|x86
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Debug|x86.Build.0 = Debug|x86
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|Any CPU.Build.0 = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x64.ActiveCfg = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x64.Build.0 = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x86.ActiveCfg = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x86.Build.0 = Release|Any CPU
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x64.ActiveCfg = Release|x64
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x64.Build.0 = Release|x64
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x86.ActiveCfg = Release|x86
{B4B4910D-4B22-4F93-91AD-4B3938335B01}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 7b38511

Please sign in to comment.