chore: repo cleanup and code quality improvements

- Remove global.json (SDK pinning unnecessary)

- Remove nuget.config, move MyGet source to .csproj RestoreAdditionalProjectSources

- Gitignore ndepend/ entirely, move badges to docs/img/

- Update README.md and docs/ndepend.md badge paths

- Add NDepend project property to QuanTAlib.slnx

- Expand .editorconfig ReSharper/diagnostic suppressions

- Use ArgumentOutOfRangeException instead of ArgumentException

- Use discard _ for unused event sender parameters

- Remove quantalib.code-workspace and sonar-suppressions.json

- Add filter signature SVGs
This commit is contained in:
Miha Kralj
2026-03-03 09:22:55 -08:00
parent e1a6743bda
commit 1910fdca93
131 changed files with 216046 additions and 2027 deletions
+7 -7
View File
@@ -31,7 +31,7 @@ public sealed class Alma : AbstractBase
[StructLayout(LayoutKind.Auto)]
private record struct State(double LastValidValue, bool IsInitialized);
private State _state;
private State _p_state;
private State _pState;
public bool IsNew => _isNew;
public override bool IsHot => _buffer.IsFull;
@@ -139,11 +139,11 @@ public sealed class Alma : AbstractBase
{
if (isNew)
{
_p_state = _state;
_pState = _state;
}
else
{
_state = _p_state;
_state = _pState;
}
if (double.IsFinite(input.Value))
@@ -213,7 +213,7 @@ public sealed class Alma : AbstractBase
// Reset state
_buffer.Clear();
_state = default;
_p_state = default;
_pState = default;
int warmupLength = Math.Min(source.Length, WarmupPeriod);
int startIndex = source.Length - warmupLength;
@@ -254,7 +254,7 @@ public sealed class Alma : AbstractBase
Update(new TValue(DateTime.MinValue, source[i]), isNew: true, publish: false);
}
_p_state = _state;
_pState = _state;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -449,7 +449,7 @@ public sealed class Alma : AbstractBase
{
_buffer.Clear();
_state = new State(double.NaN, IsInitialized: false);
_p_state = _state;
_pState = _state;
Last = default;
}
}
}
-8
View File
@@ -90,8 +90,6 @@ public sealed class Nlma : AbstractBase
_isNew = isNew;
return UpdateCore(input, isNew, publish: true);
}
/// <inheritdoc/>
public override TSeries Update(TSeries source)
{
if (source.Count == 0)
@@ -326,8 +324,6 @@ public sealed class Nlma : AbstractBase
}
// ── Prime / Batch / Calculate ──────────────────────────────────────
/// <inheritdoc/>
public override void Prime(ReadOnlySpan<double> source, TimeSpan? step = null)
{
foreach (var value in source)
@@ -489,8 +485,6 @@ public sealed class Nlma : AbstractBase
}
// ── Reset / Dispose ────────────────────────────────────────────────
/// <inheritdoc/>
public override void Reset()
{
_buffer.Clear();
@@ -498,8 +492,6 @@ public sealed class Nlma : AbstractBase
_p_lastValidValue = double.NaN;
Last = default;
}
/// <inheritdoc/>
protected override void Dispose(bool disposing)
{
if (!_disposed)
+5 -4
View File
@@ -1,9 +1,10 @@
using System.Reflection;
using System.Runtime.Intrinsics.X86;
using Xunit.Abstractions;
namespace QuanTAlib.Tests;
public class WmaCoverageTests
public class WmaCoverageTests(ITestOutputHelper output)
{
[Fact]
public void Cover_Scalar_Fallback_SmallData()
@@ -41,7 +42,7 @@ public class WmaCoverageTests
source[i] = i;
}
double[] output = new double[len];
double[] result = new double[len];
// Use reflection to invoke private static CalculateSimdCore
var method = typeof(Wma).GetMethod("CalculateSimdCore", BindingFlags.NonPublic | BindingFlags.Static);
@@ -73,12 +74,12 @@ public class WmaCoverageTests
// Maybe I can use `MethodInfo.CreateDelegate`?
// Delegates can take Spans if defined correctly.
InvokePrivateStaticMethod_WithSpans("CalculateSimdCore", source, output, period);
InvokePrivateStaticMethod_WithSpans("CalculateSimdCore", source, result, period);
}
catch (Exception ex)
{
// If reflection fails, we can't cover it.
Console.WriteLine($"Could not invoke AVX2 core: {ex.Message}");
output.WriteLine($"Could not invoke AVX2 core: {ex.Message}");
}
}