[vtk-developers] Image based axis test passing despite failure (Windows bug with label precision)

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Dec 8 13:08:49 EST 2017


I think we already clobber a lot of it by setting the numeric locale to C,
and there is code in the axes that is careful to avoid localized number
strings:

void vtkAxis::GenerateLabelFormat(int notation, double n)
{
 std::ostringstream ostr;
 ostr.imbue(std::locale::classic());

 switch(notation)
 {
   case 1:
     ostr << n;
     ostr.precision(this->Precision);
     ostr.setf(std::ios::scientific, std::ios::floatfield);
     this->TickLabels->InsertNextValue(ostr.str());
     break;
...

I can try tweaking some of this now I have a failing test at least. I
thought the image regression would have been sensitive enough to catch it.

On Fri, Dec 8, 2017 at 12:58 PM, Jeff Baumes <jeff.baumes at kitware.com>
wrote:

> Don't know about the image non-failure, but I've seen these settings
> interfere with how numbers are formatted across Windows applications (e.g.
> I think these settings affect how CSVs are exported from Excel for example):
>
> https://superuser.com/questions/969078/how-can-i-
> change-number-format-in-my-pc-windows-8
>
> On Fri, Dec 8, 2017 at 12:49 PM Marcus D. Hanwell <
> marcus.hanwell at kitware.com> wrote:
>
>> I had been meaning to look into this for a while, we have an issue on
>> Windows with chart axes displaying way too many decimal places using
>> scientific notation and set precision. I have confirmed on the dashboard
>> that this does in fact happen with the TestAxes test:
>>
>> https://open.cdash.org/testDetails.php?test=607700533&build=5173639
>>
>> I made the axis next to it invisible, so it begs the question of why this
>> was passing on Windows as I only see one baseline, and it looks correct.
>> Perhaps the test image is too crowded, and the fuzzing for the image let it
>> through unnoticed all this time?
>>
>> This is using the standard library calls to generate the labels, so
>> guessing this is a bug/feature in the Windows STL, I will dig into this but
>> wanted to point this passing failure out in case anyone had ideas on how it
>> might be prevented in the future.
>>
>> I noticed because we use this in Tomviz, and on Windows users complained
>> about us using 10 decimal places, asking for a more reasonable number :-)
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/
>> opensource/opensource.html
>>
>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20171208/df4792bc/attachment.html>


More information about the vtk-developers mailing list