Skip to content

Commit

Permalink
1767 return empty plot when observed data without nonZero values (#1768)
Browse files Browse the repository at this point in the history
* initial implementation

* code review change

* test corrected
  • Loading branch information
georgeDaskalakis authored Nov 14, 2022
1 parent 46203b0 commit edbd947
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ protected override void UpdateAnalysis()

_identityRepositories.AddRange(_predictedVsObservedChartService.AddIdentityCurves(observationColumns, Chart));

//if no identity repository has been added, resulting in the chart not having been initialized, just return an empty plot
//this has been the case for having only one plot with exclusively 0 values
if (!_identityRepositories.Any())
return;

if (ChartIsBeingCreated)
_predictedVsObservedChartService.ConfigureAxesDimensionAndTitle(observationColumns, Chart);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ protected override void Context()
_calculationData.Add(_concentrationDataColumn);
A.CallTo(() => _observedDataRepository.AllObservedDataUsedBy(A<ISimulation>._)).Returns(new List<DataRepository>() { _calculationData });

A.CallTo(() => _predictedVsObservedService.AddIdentityCurves(A<List<DataColumn>>._, _predictedVsObservedChart)).Returns(new List<DataRepository>() { DomainHelperForSpecs.ObservedData() });

sut.InitializeAnalysis(_predictedVsObservedChart);
}
}
Expand Down

0 comments on commit edbd947

Please sign in to comment.