Skip to content

Commit

Permalink
PSX_OperationStatsImpl: Fix median calculation for post processing stats
Browse files Browse the repository at this point in the history
It does not make sense to combine /Z with GetRTError(1) as we will never
get an RTE.

The test was also incorrect, so this is now tested as well (again).

Bug introduced in d3a696e (psxStats: Convert avg post processing to
stats, 2023-06-16).
  • Loading branch information
t-b committed Jun 5, 2024
1 parent 8b85d3e commit 1e58c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Packages/MIES/MIES_SweepFormula_PSX.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1343,10 +1343,9 @@ static Function/WAVE PSX_OperationStatsImpl(string graph, string id, WAVE/WAVE r
Make/FREE/D results = {V_avg, NaN, V_adev, V_sdev, V_skew, V_kurt}
AssertonAndClearRTError()
StatsQuantiles/Q/Z resultsRawClean; err = GetRTError(1)
StatsQuantiles/Q/Z resultsRawClean
if(!err)
if(!V_Flag)
results[1] = V_Median
endif
Expand Down
2 changes: 1 addition & 1 deletion Packages/tests/Basic/UTF_SweepFormula_PSX.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ Function/WAVE StatsTestSpecialCases_GetInput()
input[%outOfRange] = "0"

JWN_CreatePath(input, "/0")
JWN_SetWaveInWaveNote(input, "/0/results", {10, 0, 0, 0, NaN, NaN})
JWN_SetWaveInWaveNote(input, "/0/results", {10, NaN, 0, 0, NaN, NaN})
JWN_SetWaveInWaveNote(input, "/0/xValues", ListToTextWave(PSX_STATS_LABELS, ";"))
JWN_SetWaveInWaveNote(input, "/0/marker", {PSX_MARKER_REJECT, PSX_MARKER_REJECT, PSX_MARKER_REJECT, \
PSX_MARKER_REJECT, PSX_MARKER_REJECT, PSX_MARKER_REJECT})
Expand Down

0 comments on commit 1e58c20

Please sign in to comment.