Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0.x' ]
dotnet-version: ['9.0.x' ]

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0.x' ]
dotnet-version: ['9.0.x' ]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,11 +25,11 @@ jobs:
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Debug
run: dotnet build
- name: Test
run: dotnet test --verbosity normal
- name: dotnet publish
run: dotnet publish -c Debug -o "./PSQuickGraph"
run: dotnet publish -o "./PSQuickGraph"
- name: psgallery publish
run: |
$env:GITHUB_WORKSPACE
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/
PSGraphv2/.DS_Store
PSGraph/.DS_Store
.DS_Store


bin/
obj/
.idea/
.idea/

x.*
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/PSGraphv2.Tests/bin/Debug/net6.0/PSGraph.Tests.dll",
"program": "${workspaceFolder}/PSGraph.Tests/bin/Debug/net6.0/PSGraph.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/PSGraphv2.Tests",
"cwd": "${workspaceFolder}/PSGraph.Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
Expand Down
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/PSGraphv2.Tests/PSGraph.Tests.csproj",
"${workspaceFolder}/PSGraph.Tests/PSGraph.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -19,7 +19,7 @@
"type": "process",
"args": [
"publish",
"${workspaceFolder}/PSGraphv2.Tests/PSGraph.Tests.csproj",
"${workspaceFolder}/PSGraph.Tests/PSGraph.Tests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
Expand All @@ -33,7 +33,7 @@
"watch",
"run",
"--project",
"${workspaceFolder}/PSGraphv2.Tests/PSGraph.Tests.csproj"
"${workspaceFolder}/PSGraph.Tests/PSGraph.Tests.csproj"
],
"problemMatcher": "$msCompile"
}
Expand Down
1 change: 0 additions & 1 deletion PSGraph.Common/Interface/IDsm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MathNet.Numerics.LinearAlgebra;
using Microsoft.PowerShell.Commands;
using PSGraph.Model;

namespace PSGraph.DesignStructureMatrix;
Expand Down
9 changes: 0 additions & 9 deletions PSGraph.Common/Interface/IDsmView.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.Data.Text;
using PSGraph.Model;
using QuikGraph;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Svg;

namespace PSGraph.DesignStructureMatrix
Expand Down
39 changes: 39 additions & 0 deletions PSGraph.Common/Logger/PSLogger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using Microsoft.Extensions.Logging;
using System.Management.Automation;

public class PSLogger : ILogger
{
private readonly PSCmdlet _cmdlet;

public PSLogger(PSCmdlet cmdlet)
{
_cmdlet = cmdlet;
}

public void Log<TState>(LogLevel logLevel, EventId eventId,

Check warning on line 14 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability of reference types in type of parameter 'exception' of 'void PSLogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)' doesn't match implicitly implemented member 'void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)' (possibly because of nullability attributes).

Check warning on line 14 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability of reference types in type of parameter 'exception' of 'void PSLogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)' doesn't match implicitly implemented member 'void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)' (possibly because of nullability attributes).

Check warning on line 14 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability of reference types in type of parameter 'exception' of 'void PSLogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)' doesn't match implicitly implemented member 'void ILogger.Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)' (possibly because of nullability attributes).
TState state, Exception exception, Func<TState, Exception, string> formatter)
{
var message = formatter(state, exception);

switch (logLevel)
{
case LogLevel.Debug:
_cmdlet.WriteDebug(message);
break;
case LogLevel.Information:
_cmdlet.WriteVerbose(message);
break;
case LogLevel.Warning:
_cmdlet.WriteWarning(message);
break;
case LogLevel.Error:
_cmdlet.WriteError(new ErrorRecord(exception ?? new Exception(message), "Error", ErrorCategory.NotSpecified, null));
break;
}
}

public bool IsEnabled(LogLevel logLevel) => true;

public IDisposable BeginScope<TState>(TState state) => null;

Check warning on line 38 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability in constraints for type parameter 'TState' of method 'PSLogger.BeginScope<TState>(TState)' doesn't match the constraints for type parameter 'TState' of interface method 'ILogger.BeginScope<TState>(TState)'. Consider using an explicit interface implementation instead.

Check warning on line 38 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability in constraints for type parameter 'TState' of method 'PSLogger.BeginScope<TState>(TState)' doesn't match the constraints for type parameter 'TState' of interface method 'ILogger.BeginScope<TState>(TState)'. Consider using an explicit interface implementation instead.

Check warning on line 38 in PSGraph.Common/Logger/PSLogger.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Nullability in constraints for type parameter 'TState' of method 'PSLogger.BeginScope<TState>(TState)' doesn't match the constraints for type parameter 'TState' of interface method 'ILogger.BeginScope<TState>(TState)'. Consider using an explicit interface implementation instead.
}
8 changes: 1 addition & 7 deletions PSGraph.Common/Model/DSMExportTypes.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSGraph.Model
namespace PSGraph.Model
{
public enum DSMExportTypes
{
Expand Down
9 changes: 0 additions & 9 deletions PSGraph.Common/Model/DSMMatrixLineKinds.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
using MathNet.Numerics.LinearAlgebra;
using PSGraph.Model;
using QuikGraph;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSGraph.DesignStructureMatrix {
enum DSMMatrixLineKind{
ROW,
Expand Down
10 changes: 5 additions & 5 deletions PSGraph.Common/Model/GraphExportTypes.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using QuikGraph.Graphviz.Dot;
using System.Collections.Generic;

namespace PSGraph
namespace PSGraph
{
public enum GraphExportTypes
{
Graphviz,
GraphML,
MSAGL_MDS,
MSAGL_SUGIYAMA,
MSAGL_FASTINCREMENTAL
MSAGL_FASTINCREMENTAL,
Vega_ForceDirected,
Vega_AdjacencyMatrix,
Vega_TreeLayout
}
}
8 changes: 1 addition & 7 deletions PSGraph.Common/Model/PSBidirectionalGraph.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using PSGraph.Model;
using QuikGraph;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QuikGraph;

namespace PSGraph.Model
{
Expand Down
10 changes: 10 additions & 0 deletions PSGraph.Common/Model/PSDistanceVectorRecord.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using PSGraph.Model;

namespace PSGraph.Common.Model;

public class PSDistanceVectorRecord
{
public required PSVertex Vertex;
public double Level;

}
11 changes: 2 additions & 9 deletions PSGraph.Common/Model/PSEdge.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using JetBrains.Annotations;
using QuikGraph;
using QuikGraph;
using QuikGraph.Graphviz.Dot;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSGraph.Model
{
Expand All @@ -16,7 +9,7 @@
public string Name => Label;
public int Weight = 1;
public GraphvizEdge GVertexParameters = new GraphvizEdge();
public PSEdge([JetBrains.Annotations.NotNullAttribute] PSVertex source, [JetBrains.Annotations.NotNullAttribute] PSVertex target, [CanBeNull] PSEdgeTag tag) : base(source, target, tag)
public PSEdge(PSVertex source, PSVertex target, PSEdgeTag tag) : base(source, target, tag)

Check warning on line 12 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'Label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 12 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'Label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 12 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'Label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
}

Expand All @@ -31,7 +24,7 @@
public PSVertex Source { get; }
public PSVertex Target { get; }

public PSUndirectedEdge(PSVertex s, PSVertex t, double tag)

Check warning on line 27 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'Source' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 27 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'Target' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 27 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'Source' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 27 in PSGraph.Common/Model/PSEdge.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'Source' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
var res = s.CompareTo(t);
if (res < 0)
Expand Down
10 changes: 1 addition & 9 deletions PSGraph.Common/Model/PSEdgeTag.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
using PSGraph.Model;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSGraph.Model
namespace PSGraph.Model
{
public class PSEdgeTag
{
Expand Down
6 changes: 0 additions & 6 deletions PSGraph.Common/Model/PSVertex.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using QuikGraph.Graphviz.Dot;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PSGraph.Model
{
Expand All @@ -28,12 +22,12 @@
//throw new NotImplementedException();
}

public PSVertex(string label)

Check warning on line 25 in PSGraph.Common/Model/PSVertex.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 25 in PSGraph.Common/Model/PSVertex.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
Label = label;
}

public PSVertex(PSVertex v)

Check warning on line 30 in PSGraph.Common/Model/PSVertex.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 30 in PSGraph.Common/Model/PSVertex.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable field 'label' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
string l = new string(v.label.ToCharArray()); //copy?
var copy = new PSVertex(l);
Expand Down
20 changes: 20 additions & 0 deletions PSGraph.Common/Model/VegaDataModels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace PSGraph.Model.VegaDataModels;

public interface IGraphRecord
{
public int id { get; set; }
public string name { get; set; }
}
public class GraphRootRecord: IGraphRecord
{
public int id { get; set; }
public string name { get ; set; }

Check warning on line 11 in PSGraph.Common/Model/VegaDataModels.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'name' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 11 in PSGraph.Common/Model/VegaDataModels.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'name' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 11 in PSGraph.Common/Model/VegaDataModels.cs

View workflow job for this annotation

GitHub Actions / build (9.0.x)

Non-nullable property 'name' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}

public class GraphRecord : GraphRootRecord
{
public int parent;
}

public record NodeRecord(string name, int group, int index);
public record LinkRecord(int source, int target, int value, int src, int tgt); //dirty hack to make vega visuals work
19 changes: 11 additions & 8 deletions PSGraph.Common/PSGraph.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.1</Version>
<Authors>Andrey Vernigora</Authors>
<PackageId>PSGraph.Common</PackageId>
<Description>Common types of PSGraph module</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/eosfor/PSGraph</RepositoryUrl>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="AutomaticGraphLayout" Version="1.1.12" />
<PackageReference Include="AutomaticGraphLayout.Drawing" Version="1.1.12" />
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
<PackageReference Include="MathNet.Numerics" Version="4.15.0" />
<PackageReference Include="MathNet.Numerics.Data.Text" Version="4.1.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.2" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
<PackageReference Include="MathNet.Numerics.Data.Text" Version="5.0.0" />
<PackageReference Include="QuikGraph" Version="2.5.0" />
<PackageReference Include="QuikGraph.Graphviz" Version="2.5.0" />
<PackageReference Include="QuikGraph.MSAGL" Version="2.5.0" />
<PackageReference Include="QuikGraph.Serialization" Version="2.5.0" />
<PackageReference Include="Svg" Version="3.4.7" />
<PackageReference Include="System.Management.Automation" Version="7.4.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.6" />
<PackageReference Include="System.Management.Automation" Version="7.5.1" />
</ItemGroup>

</Project>
Loading
Loading