Skip to content

Commit

Permalink
Merge pull request #171 from VirtualPhotonics/feature/159-upgrade-vts…
Browse files Browse the repository at this point in the history
…-to-net-80

Feature/159 Upgrade VTS to .NET 8.0
  • Loading branch information
lmalenfant authored Sep 17, 2024
2 parents 813b38f + f5c2396 commit 66cd90a
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 47 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy-pages-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# Publish the docs to docs/_site
- name: Dotnet Setup
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x
- run: dotnet tool update -g docfx
- run: docfx documentation/docfx.json

# Deploy the generated docs to GitHub Pages
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
# Upload static files
path: 'documentation/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/dotnetbuildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src\\VtsLibrary.sln
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions BuildTestCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ dotnet test $PWD\src\Vts.Test\Vts.Test.csproj -c Release

Write-Host "Publish the VTS dll to platform specific folders" -ForegroundColor Green
Remove-Item $PWD\publish -Recurse -ErrorAction Ignore
dotnet publish $PWD\src\Vts\Vts.csproj -f net6.0 -c Release -o $PWD\publish\win-x64 --self-contained false
dotnet publish $PWD\src\Vts\Vts.csproj -f net6.0 -c Release -o $PWD\publish\linux-x64 --self-contained false
dotnet publish $PWD\src\Vts\Vts.csproj -f net6.0 -c Release -o $PWD\publish\osx-x64 --self-contained false
dotnet publish $PWD\src\Vts\Vts.csproj -c Release -o $PWD\publish\win-x64 --self-contained false
dotnet publish $PWD\src\Vts\Vts.csproj -c Release -o $PWD\publish\linux-x64 --self-contained false
dotnet publish $PWD\src\Vts\Vts.csproj -c Release -o $PWD\publish\osx-x64 --self-contained false
6 changes: 3 additions & 3 deletions BuildTestReleaseMCCL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (-not (Test-Path -LiteralPath $releasedir)) {
# Create win-x64 zip
$archive = $releasedir + "\MC_v" + $version + "_Win_x64.zip"
$source = "publish\win-x64\*"
Compress-Archive -Path $source -DestinationPath $archive
Compress-Archive -Force -Path $source -DestinationPath $archive
$matlabdir = "$PWD\matlab"
$matlabfiles = "$matlabdir\post_processing\*"
Compress-Archive -Path $matlabfiles -Update -DestinationPath $archive
Expand All @@ -66,7 +66,7 @@ Compress-Archive -Path $mcinversefiles -Update -DestinationPath $archive
# Create linux-x64 zip
$archive = $releasedir + "\MC_v" + $version + "_Linux_x64.zip"
$source = "publish\linux-x64\*"
Compress-Archive -Path $source -DestinationPath $archive
Compress-Archive -Force -Path $source -DestinationPath $archive
$matlabfiles = "$matlabdir\post_processing\*"
Compress-Archive -Path $matlabfiles -Update -DestinationPath $archive
$mcinversegeneralfiles = "$matlabdir\monte_carlo_inverse\general\*"
Expand All @@ -77,7 +77,7 @@ Compress-Archive -Path $mcinversefiles -Update -DestinationPath $archive
# Create osx-x64 zip
$archive = $releasedir + "\MC_v" + $version + "_Mac_x64.zip"
$source = "publish\osx-x64\*"
Compress-Archive -Path $source -DestinationPath $archive
Compress-Archive -Force -Path $source -DestinationPath $archive
$matlabfiles = "$matlabdir\post_processing\*"
Compress-Archive -Path $matlabfiles -Update -DestinationPath $archive
$mcinversegeneralfiles = "$matlabdir\monte_carlo_inverse\general\*"
Expand Down
4 changes: 2 additions & 2 deletions src/Vts.Benchmark/Vts.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>mc</AssemblyName>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<RootNamespace>Vts.MonteCarlo.CommandLineApplication</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Vts.MonteCarlo.PostProcessor</RootNamespace>
<AssemblyName>mc_post</AssemblyName>
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
Expand Down
4 changes: 2 additions & 2 deletions src/Vts.Scripting.Test/Vts.Scripting.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.10.0">
Expand Down
2 changes: 1 addition & 1 deletion src/Vts.Scripting/Vts.Scripting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
Expand Down
2 changes: 1 addition & 1 deletion src/Vts.Test/Extensions/EnumerableExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void ToDictionary_returns_dictionary_from_key_value_pairs()
new KeyValuePair<string, string>("two", "second"),
new KeyValuePair<string, string>("three", "third")
};
var dictionary = keyValuePairList.ToDictionary();
var dictionary = EnumerableExtensions.ToDictionary(keyValuePairList);
Assert.IsInstanceOf<Dictionary<string, string>>(dictionary);
Assert.AreEqual("first", dictionary["one"]);
Assert.AreEqual("second", dictionary["two"]);
Expand Down
4 changes: 2 additions & 2 deletions src/Vts.Test/Vts.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -42,7 +42,7 @@
<EmbeddedResource Include="Resources\sourcetest\inputAOfXAndYAndZ.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
Expand Down
36 changes: 18 additions & 18 deletions src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public struct mt_struct {
/// </summary>
public uint[] state; // if null then struct is mull
}
struct polynomial
struct Polynomial
{
public int[] x;
public int deg;
Expand All @@ -279,7 +279,7 @@ struct prescr_t
{
public int sizeOfA; // paramter size
public uint[][] modlist; // size[_nirredpoly][pre.sizeOfA]
public polynomial[] preModPolys; // size[pre.sizeOfA+1]
public Polynomial[] preModPolys; // size[pre.sizeOfA+1]
}

struct eqdeg_t
Expand Down Expand Up @@ -601,9 +601,9 @@ private int prescreening_dc(prescr_t pre, uint aaa)
}
private void init_prescreening_dc(ref prescr_t pre, int m, int n, int r, int w)
{
polynomial pl;
Polynomial pl;
pre.sizeOfA = w;
pre.preModPolys = new polynomial[pre.sizeOfA + 1];
pre.preModPolys = new Polynomial[pre.sizeOfA + 1];
make_pre_mod_polys(ref pre, m, n, r, w);
pre.modlist = new uint[_nirredpoly][];
for (int i = 0; i < _nirredpoly; i++)
Expand All @@ -619,7 +619,7 @@ private void init_prescreening_dc(ref prescr_t pre, int m, int n, int r, int w)
}
//was in original code: for loop (i eq 0 until i lt pre.sizeOfA) then free poly -> don't need this
}
private void next_irred_poly(ref polynomial pl, int nth)
private void next_irred_poly(ref Polynomial pl, int nth)
{
int i, max_deg;
for (max_deg = 0, i = 0; i <= _max_irred_deg; i++)
Expand All @@ -632,9 +632,9 @@ private void next_irred_poly(ref polynomial pl, int nth)
}
pl.deg = max_deg;
}
private void make_modlist(ref prescr_t pre, polynomial pl, int nPoly)
private void make_modlist(ref prescr_t pre, Polynomial pl, int nPoly)
{
polynomial tmpPl;
Polynomial tmpPl;
int i;
for (i = 0; i <= pre.sizeOfA; i++)
{
Expand All @@ -648,7 +648,7 @@ private void make_modlist(ref prescr_t pre, polynomial pl, int nPoly)
/// </summary>
/// <param name="wara">first polynomial</param>
/// <param name="waru">second polynomial</param>
private void polynomial_mod(ref polynomial wara, polynomial waru) // waru is "const" in C code
private void polynomial_mod(ref Polynomial wara, Polynomial waru) // waru is "const" in C code
{
int deg_diff, i;
while (wara.deg >= waru.deg)
Expand All @@ -668,7 +668,7 @@ private void polynomial_mod(ref polynomial wara, polynomial waru) // waru is "co
wara.deg = i;
}
}
private uint word2bit(polynomial pl)
private uint word2bit(Polynomial pl)
{
uint bx = 0;
for (int i = pl.deg; i > 0; i--)
Expand Down Expand Up @@ -719,7 +719,7 @@ private int is_reducible(prescr_t pre, uint aaa, uint[] polylist)
/// <param name="ww"></param>
private void make_pre_mod_polys(ref prescr_t pre, int mm, int nn, int rr, int ww)
{
polynomial t, t0, s, s0; // orig code had t1 and s1 in this list
Polynomial t, t0, s, s0; // orig code had t1 and s1 in this list
int i;
int j = 0;
t = new_poly(0);
Expand Down Expand Up @@ -758,18 +758,18 @@ private void make_pre_mod_polys(ref prescr_t pre, int mm, int nn, int rr, int ww
/// </summary>
/// <param name="pl">polynomial to be duplicated</param>
/// <returns>polynomial class</returns>
private polynomial polynomial_dup(polynomial pl)
private Polynomial polynomial_dup(Polynomial pl)
{
polynomial pt = new_poly(pl.deg);
Polynomial pt = new_poly(pl.deg);
for (int i = pl.deg; i >= 0; i--)
{
pt.x[i] = pl.x[i];
}
return pt;
}
private polynomial polynomial_mult(polynomial p0, polynomial p1)
private Polynomial polynomial_mult(Polynomial p0, Polynomial p1)
{
polynomial p;
Polynomial p;
if ((p0.deg < 0) || (p1.deg < 0))
{
p = new_poly(-1);
Expand All @@ -788,9 +788,9 @@ private polynomial polynomial_mult(polynomial p0, polynomial p1)
}
return p;
}
private polynomial make_tntm(int n, int m)
private Polynomial make_tntm(int n, int m)
{
polynomial p = new_poly(n);
Polynomial p = new_poly(n);
p.x[m] = 1;
p.x[n] = p.x[m];
return p;
Expand All @@ -802,9 +802,9 @@ private polynomial make_tntm(int n, int m)
/// </summary>
/// <param name="degree">degree of polynomial created</param>
/// <returns>polynomial class</returns>
private polynomial new_poly(int degree)
private Polynomial new_poly(int degree)
{
polynomial p = new polynomial();
Polynomial p = new Polynomial();
p.deg = degree;
if (degree < 0)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Vts/Vts.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Description>The VTS (Virtual Tissue Simulator) is an open source library for .NET that was designed as a modular and scalable platform to provide an integrated suite of computational tools to define, solve, visualize, and analyze relevant forward and inverse radiative transport problems in Biomedical Optics.</Description>
<Company>Virtual Photonics Technology Initiative</Company>
<Copyright>Copyright © 2024 Laser Microbeam and Medical Program</Copyright>
Expand Down Expand Up @@ -134,7 +134,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="NLog" Version="5.3.3" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
</ItemGroup>
Expand Down

0 comments on commit 66cd90a

Please sign in to comment.