From e42849f25cd153e3de4c7b846ba5bd31203e2dda Mon Sep 17 00:00:00 2001 From: Lisa Glover Date: Wed, 11 Sep 2024 17:52:14 -0700 Subject: [PATCH 1/5] Upgraded to .NET 8, updated packages and fixed ToDictionary to specify EnumerableExtensions.ToDictionary() --- src/Vts.Benchmark/Vts.Benchmark.csproj | 4 ++-- .../Vts.MonteCarlo.CommandLineApplication.Test.csproj | 4 ++-- .../Vts.MonteCarlo.CommandLineApplication.csproj | 2 +- .../Vts.MonteCarlo.PostProcessor.Test.csproj | 4 ++-- .../Vts.MonteCarlo.PostProcessor.csproj | 2 +- src/Vts.Scripting.Test/Vts.Scripting.Test.csproj | 4 ++-- src/Vts.Scripting/Vts.Scripting.csproj | 2 +- src/Vts.Test/Extensions/EnumerableExtensionsTests.cs | 2 +- src/Vts.Test/Vts.Test.csproj | 4 ++-- src/Vts/Vts.csproj | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Vts.Benchmark/Vts.Benchmark.csproj b/src/Vts.Benchmark/Vts.Benchmark.csproj index 0fa59ee7c..6ef6ac17f 100644 --- a/src/Vts.Benchmark/Vts.Benchmark.csproj +++ b/src/Vts.Benchmark/Vts.Benchmark.csproj @@ -2,11 +2,11 @@ Exe - net6.0 + net8.0 - + diff --git a/src/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.CommandLineApplication.Test.csproj b/src/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.CommandLineApplication.Test.csproj index f721f947b..27d9cd176 100644 --- a/src/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.CommandLineApplication.Test.csproj +++ b/src/Vts.MonteCarlo.CommandLineApplication.Test/Vts.MonteCarlo.CommandLineApplication.Test.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 false @@ -23,7 +23,7 @@ - + all diff --git a/src/Vts.MonteCarlo.CommandLineApplication/Vts.MonteCarlo.CommandLineApplication.csproj b/src/Vts.MonteCarlo.CommandLineApplication/Vts.MonteCarlo.CommandLineApplication.csproj index f5a6b30ea..bfec47735 100644 --- a/src/Vts.MonteCarlo.CommandLineApplication/Vts.MonteCarlo.CommandLineApplication.csproj +++ b/src/Vts.MonteCarlo.CommandLineApplication/Vts.MonteCarlo.CommandLineApplication.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 mc win-x64;linux-x64;osx-x64 Vts.MonteCarlo.CommandLineApplication diff --git a/src/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Test.csproj b/src/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Test.csproj index c9b776d79..b6160a239 100644 --- a/src/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Test.csproj +++ b/src/Vts.MonteCarlo.PostProcessor.Test/Vts.MonteCarlo.PostProcessor.Test.csproj @@ -1,13 +1,13 @@  - net6.0 + net8.0 false - + all diff --git a/src/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.csproj b/src/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.csproj index 81f6a7c4b..e0c5911e4 100644 --- a/src/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.csproj +++ b/src/Vts.MonteCarlo.PostProcessor/Vts.MonteCarlo.PostProcessor.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 Vts.MonteCarlo.PostProcessor mc_post win-x64;linux-x64;osx-x64 diff --git a/src/Vts.Scripting.Test/Vts.Scripting.Test.csproj b/src/Vts.Scripting.Test/Vts.Scripting.Test.csproj index fbcfb2b4f..1d2ef4297 100644 --- a/src/Vts.Scripting.Test/Vts.Scripting.Test.csproj +++ b/src/Vts.Scripting.Test/Vts.Scripting.Test.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable true @@ -11,7 +11,7 @@ - + diff --git a/src/Vts.Scripting/Vts.Scripting.csproj b/src/Vts.Scripting/Vts.Scripting.csproj index 8d0479775..70295d3fd 100644 --- a/src/Vts.Scripting/Vts.Scripting.csproj +++ b/src/Vts.Scripting/Vts.Scripting.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable true diff --git a/src/Vts.Test/Extensions/EnumerableExtensionsTests.cs b/src/Vts.Test/Extensions/EnumerableExtensionsTests.cs index 82a8e81e4..74533e3eb 100644 --- a/src/Vts.Test/Extensions/EnumerableExtensionsTests.cs +++ b/src/Vts.Test/Extensions/EnumerableExtensionsTests.cs @@ -96,7 +96,7 @@ public void ToDictionary_returns_dictionary_from_key_value_pairs() new KeyValuePair("two", "second"), new KeyValuePair("three", "third") }; - var dictionary = keyValuePairList.ToDictionary(); + var dictionary = EnumerableExtensions.ToDictionary(keyValuePairList); Assert.IsInstanceOf>(dictionary); Assert.AreEqual("first", dictionary["one"]); Assert.AreEqual("second", dictionary["two"]); diff --git a/src/Vts.Test/Vts.Test.csproj b/src/Vts.Test/Vts.Test.csproj index 830860f54..adb72c845 100644 --- a/src/Vts.Test/Vts.Test.csproj +++ b/src/Vts.Test/Vts.Test.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 false @@ -42,7 +42,7 @@ - + diff --git a/src/Vts/Vts.csproj b/src/Vts/Vts.csproj index 8ea5534ae..f41aa83a7 100644 --- a/src/Vts/Vts.csproj +++ b/src/Vts/Vts.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 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. Virtual Photonics Technology Initiative Copyright © 2024 Laser Microbeam and Medical Program @@ -134,7 +134,7 @@ - + From c148b753e73ad1e4058d02d557a06efd6fd4649d Mon Sep 17 00:00:00 2001 From: Lisa Glover Date: Wed, 11 Sep 2024 17:58:13 -0700 Subject: [PATCH 2/5] Update dotnetbuildtest.yml Update .NET version --- .github/workflows/dotnetbuildtest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetbuildtest.yml b/.github/workflows/dotnetbuildtest.yml index d61f89b2c..ec6cb86c2 100644 --- a/.github/workflows/dotnetbuildtest.yml +++ b/.github/workflows/dotnetbuildtest.yml @@ -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 From dd6824fe469d9698ae0a185a2a7d227aa5ddc780 Mon Sep 17 00:00:00 2001 From: Lisa Glover Date: Wed, 11 Sep 2024 18:03:16 -0700 Subject: [PATCH 3/5] Update deploy-pages-static.yml Update .NET version and action versions --- .github/workflows/deploy-pages-static.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-pages-static.yml b/.github/workflows/deploy-pages-static.yml index 79bcd5dca..c67e62ac5 100644 --- a/.github/workflows/deploy-pages-static.yml +++ b/.github/workflows/deploy-pages-static.yml @@ -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 From 60a6054e5b928b0f4f66ba57c622a0212e3e1451 Mon Sep 17 00:00:00 2001 From: Lisa Glover Date: Thu, 12 Sep 2024 18:30:14 -0700 Subject: [PATCH 4/5] Removed the .NET version from the publish command and added -Force to the archives to overwrite in case one exists --- BuildTestCore.ps1 | 6 +++--- BuildTestReleaseMCCL.ps1 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BuildTestCore.ps1 b/BuildTestCore.ps1 index 9f7e497c7..1b6189ead 100644 --- a/BuildTestCore.ps1 +++ b/BuildTestCore.ps1 @@ -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 diff --git a/BuildTestReleaseMCCL.ps1 b/BuildTestReleaseMCCL.ps1 index ec01a05a4..eee98569c 100644 --- a/BuildTestReleaseMCCL.ps1 +++ b/BuildTestReleaseMCCL.ps1 @@ -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 @@ -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\*" @@ -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\*" From f5c2396590df532772aff817e56ead814ac8ec22 Mon Sep 17 00:00:00 2001 From: Lisa Glover Date: Fri, 13 Sep 2024 18:09:52 -0700 Subject: [PATCH 5/5] Updated the polynomial struct to uppercase to remove the build warning --- .../Rng/DynamicCreatorMersenneTwister.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs b/src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs index adc98497b..13b4db74d 100644 --- a/src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs +++ b/src/Vts/MonteCarlo/Rng/DynamicCreatorMersenneTwister.cs @@ -270,7 +270,7 @@ public struct mt_struct { /// public uint[] state; // if null then struct is mull } - struct polynomial + struct Polynomial { public int[] x; public int deg; @@ -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 @@ -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++) @@ -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++) @@ -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++) { @@ -648,7 +648,7 @@ private void make_modlist(ref prescr_t pre, polynomial pl, int nPoly) /// /// first polynomial /// second polynomial - 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) @@ -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--) @@ -719,7 +719,7 @@ private int is_reducible(prescr_t pre, uint aaa, uint[] polylist) /// 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); @@ -758,18 +758,18 @@ private void make_pre_mod_polys(ref prescr_t pre, int mm, int nn, int rr, int ww /// /// polynomial to be duplicated /// polynomial class - 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); @@ -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; @@ -802,9 +802,9 @@ private polynomial make_tntm(int n, int m) /// /// degree of polynomial created /// polynomial class - 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) {