Skip to content

Commit

Permalink
-attempt to fix unit test that broke in previous build
Browse files Browse the repository at this point in the history
  • Loading branch information
Steinar Elgsæter committed Oct 30, 2024
1 parent 7f920f6 commit 70607bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 8 additions & 2 deletions Dynamic/PlantSimulator/PlantSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ static private (bool, double[]) SimulateSingle(UnitDataSet unitData, ISimulatabl
uNames.Add(uName);
}
modelCopy.SetInputIDs(uNames.ToArray());
//modelCopy.SetOutputID("output");
if (modelCopy.GetOutputID() == null)
modelCopy.SetOutputID("output");

PlantSimulator sim = new PlantSimulator(new List<ISimulatableModel> { modelCopy });
// var simData = new TimeSeriesDataSet();
Expand Down Expand Up @@ -633,7 +634,12 @@ public bool SimulateSingle(TimeSeriesDataSet inputData, string singleModelName,
return false;
}
}
simData.SetTimeStamps(inputData.GetTimeStamps().ToList());
if (inputData.GetTimeStamps() != null)
simData.SetTimeStamps(inputData.GetTimeStamps().ToList());
else
{
//?
}
// disturbance estimation
if (modelDict[singleModelName].GetProcessModelType() == ModelType.SubProcess && doEstimateDisturbance)
{
Expand Down
4 changes: 0 additions & 4 deletions TimeSeriesAnalysis.Tests/Tests/GainSchedModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ public void TenThresholds_DifferentGainsAboveEachThreshold()
double observedGain = (simY1[idxAfter]- simY1[idxBefore]) ; // all steps are exactly 1.

Assert.IsTrue( observedGain >prevGain, "step idx:"+stepIdx);

prevGain = observedGain;

}


}

[TestCase(1, "up", Description = "static, two gains, no timedelay, no bias")]
Expand Down
2 changes: 1 addition & 1 deletion TimeSeriesAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
<RepositoryUrl>https://github.com/equinor/TimeSeriesAnalysis.git</RepositoryUrl>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<Version>1.3.20</Version>
<Version>1.3.21</Version>
<Company>Equinor</Company>
<Authors>Equinor</Authors>
<IncludeSymbols>true</IncludeSymbols>
Expand Down

0 comments on commit 70607bf

Please sign in to comment.