Skip to content

Commit

Permalink
- adding License file to csproj
Browse files Browse the repository at this point in the history
- generate documentation checked
- symbol package format changed to snupkg
- added Microsoft.SourceLink.Github
  • Loading branch information
Steinar Elgsæter committed Feb 9, 2024
1 parent 0d65084 commit 40a5486
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 25 deletions.
14 changes: 12 additions & 2 deletions TimeSeriesAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
<PackageProjectUrl>https://equinor.github.io/TimeSeriesAnalysis</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>data-mining; time-series; dynamic-simulations; pid-control; multivariate-statistics; advanced-analytics;mpc-control;digital-twins</PackageTags>
<PackageLicenseFile></PackageLicenseFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RunAnalyzersDuringBuild>False</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
<RepositoryUrl>https://github.com/equinor/timeseriesanalysis</RepositoryUrl>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<Version>1.3.01</Version>
<Version>1.3.02</Version>
<Company>Equinor</Company>
<Authors>Equinor</Authors>
<IncludeSymbols>true</IncludeSymbols>
<DebugType>embedded</DebugType>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>


Expand Down Expand Up @@ -65,6 +67,10 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NuGet.Build.Tasks.Pack" Version="6.1.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -80,6 +86,10 @@
</ItemGroup>

<ItemGroup>
<None Update="LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Update="readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
Expand Down
29 changes: 14 additions & 15 deletions TimeSeriesAnalysis/TimeSeriesDataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ public TimeSeriesDataSet Combine(TimeSeriesDataSet inputDataSet)
}


/// <summary>
/// Fills a dataset with variables, values and dates
/// </summary>
/// <param name="dateTimes"></param>
/// <param name="variableDict"></param>
private void Fill(DateTime[] dateTimes, Dictionary<string, double[]> variableDict)
{
if (variableDict.ContainsKey("Time"))
Expand All @@ -239,6 +244,10 @@ private void Fill(DateTime[] dateTimes, Dictionary<string, double[]> variableDic
}


/// <summary>
/// Get the timebase, the time between two samples in the dataset
/// </summary>
/// <returns>The timebase in seconds</returns>
public double GetTimeBase()
{
if (timeStamps.Count > 2)
Expand Down Expand Up @@ -424,17 +433,17 @@ public double[] GetValues(string signalName)
}
}

internal List<int> GetIndicesToIgnore()
/// <summary>
/// Get a list of the indices in the dataset that are flagged to be ignored in identification
/// </summary>
/// <returns></returns>
public List<int> GetIndicesToIgnore()
{
if (indicesToIgnore == null)
return new List<int>();
//
return indicesToIgnore;
}




/// <summary>
/// Define a new signal, specifying only its inital value
/// </summary>
Expand Down Expand Up @@ -571,16 +580,6 @@ public void SetTimeStamps(List<DateTime> times)
}


/// <summary>
/// Set the timestamp of the start of the dataset,from which other time stamps can be found using timebase_s
/// </summary>
/// <param name="t0"></param>
/* public void SetT0(DateTime t0)
{
this.t0 = t0;
}
*/

/// <summary>
/// Create a comma-separated-variable(CSV) string of the dataset
/// </summary>
Expand Down
40 changes: 40 additions & 0 deletions TimeSeriesAnalysis/VecExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,45 @@ public static double[] Mult(this double[] array, double scalar, double nanValue
{
return Vec.ToString(array, nSignificantDigits, dividerStr);
}

/// <summary>
/// Returns the portion of array1 starting and indStart, and ending at indEnd(or at the end if third paramter is omitted)
///</summary>
/// <param name="array1">array to get subarray from</param>
/// <param name="indStart">starting index</param>
/// <param name="indEnd">ending index(or to the end if omitted)</param>
/// <returns>null if indStart and indEnd are the same, otherwise the subarray</returns>
public static double[] SubArray(this double[] array1, int indStart, int indEnd = -9999)
{
if (array1 == null)
return null;

if (indEnd > array1.Length - 1 || indEnd == -9999)
indEnd = array1.Length - 1;
else if (indEnd < 0)
{
indEnd = 0;
return new double[0];
}
if (indStart < 0)
indStart = 0;
int length = indEnd - indStart + 1;
if (length > 0)
{
double[] retArray = new double[length];
int outInd = 0;
for (int i = indStart; i <= indEnd; i++)
{
retArray[outInd] = array1[i];
outInd++;
}
return retArray;
}
else
return null;
}



}
}
32 changes: 30 additions & 2 deletions docs/api/TimeSeriesAnalysis.TimeSeriesDataSet.html
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,32 @@ <h5 class="returns">Returns</h5>
</table>


<a id="TimeSeriesAnalysis_TimeSeriesDataSet_GetIndicesToIgnore_" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetIndicesToIgnore*"></a>
<h4 id="TimeSeriesAnalysis_TimeSeriesDataSet_GetIndicesToIgnore" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetIndicesToIgnore">GetIndicesToIgnore()</h4>
<div class="markdown level1 summary"><p>Get a list of the indices in the dataset that are flagged to be ignored in identification</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public List&lt;int&gt; GetIndicesToIgnore()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.List</span>&lt;<span class="xref">System.Int32</span>&gt;</td>
<td></td>
</tr>
</tbody>
</table>


<a id="TimeSeriesAnalysis_TimeSeriesDataSet_GetLength_" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetLength*"></a>
<h4 id="TimeSeriesAnalysis_TimeSeriesDataSet_GetLength" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetLength">GetLength()</h4>
<div class="markdown level1 summary"><p>Get the length in samples of the data set</p>
Expand Down Expand Up @@ -730,7 +756,8 @@ <h5 class="returns">Returns</h5>

<a id="TimeSeriesAnalysis_TimeSeriesDataSet_GetTimeBase_" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetTimeBase*"></a>
<h4 id="TimeSeriesAnalysis_TimeSeriesDataSet_GetTimeBase" data-uid="TimeSeriesAnalysis.TimeSeriesDataSet.GetTimeBase">GetTimeBase()</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 summary"><p>Get the timebase, the time between two samples in the dataset</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
Expand All @@ -747,7 +774,8 @@ <h5 class="returns">Returns</h5>
<tbody>
<tr>
<td><span class="xref">System.Double</span></td>
<td></td>
<td><p>The timebase in seconds</p>
</td>
</tr>
</tbody>
</table>
Expand Down
57 changes: 57 additions & 0 deletions docs/api/TimeSeriesAnalysis.VecExtensionMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,63 @@ <h5 class="returns">Returns</h5>
</table>


<a id="TimeSeriesAnalysis_VecExtensionMethods_SubArray_" data-uid="TimeSeriesAnalysis.VecExtensionMethods.SubArray*"></a>
<h4 id="TimeSeriesAnalysis_VecExtensionMethods_SubArray_System_Double___System_Int32_System_Int32_" data-uid="TimeSeriesAnalysis.VecExtensionMethods.SubArray(System.Double[],System.Int32,System.Int32)">SubArray(Double[], Int32, Int32)</h4>
<div class="markdown level1 summary"><p>Returns the portion of array1 starting and indStart, and ending at indEnd(or at the end if third paramter is omitted)</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static double[] SubArray(this double[] array1, int indStart, int indEnd = -9999)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Double</span>[]</td>
<td><span class="parametername">array1</span></td>
<td><p>array to get subarray from</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">indStart</span></td>
<td><p>starting index</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">indEnd</span></td>
<td><p>ending index(or to the end if omitted)</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Double</span>[]</td>
<td><p>null if indStart and indEnd are the same, otherwise the subarray</p>
</td>
</tr>
</tbody>
</table>


<a id="TimeSeriesAnalysis_VecExtensionMethods_ToString_" data-uid="TimeSeriesAnalysis.VecExtensionMethods.ToString*"></a>
<h4 id="TimeSeriesAnalysis_VecExtensionMethods_ToString_System_Double___System_Int32_System_String_" data-uid="TimeSeriesAnalysis.VecExtensionMethods.ToString(System.Double[],System.Int32,System.String)">ToString(Double[], Int32, String)</h4>
<div class="markdown level1 summary"><p>Create a compact string of vector with a certain number of significant digits and a chosen divider</p>
Expand Down
Loading

0 comments on commit 40a5486

Please sign in to comment.