gnudatalanguage / gdl

GDL - GNU Data Language
GNU General Public License v2.0
274 stars 61 forks source link

close #1781 (TICK_GET error) #1785

Closed GillesDuvert closed 5 months ago

GillesDuvert commented 5 months ago

oops getLabelingValues was wrongly clearing values. Also, insure only the 1st axis values are reported

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 43.72%. Comparing base (86806a3) to head (9edc636). Report is 5 commits behind head on master.

:exclamation: Current head 9edc636 differs from pull request most recent head 235b5d1. Consider uploading reports for the commit 235b5d1 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1785 +/- ## ======================================= Coverage 43.72% 43.72% ======================================= Files 376 376 Lines 97401 97402 +1 Branches 19918 19920 +2 ======================================= + Hits 42589 42590 +1 Misses 54812 54812 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alaingdl commented 5 months ago

As shown by new test file in #1786 test_xyztick_get.pro this PR is not fully ok :( (bon courage @GillesDuvert )

alaingdl commented 5 months ago

Hi Gilles

(we have a /debug in test_xyztick_get.pro to print, the expected versus the computed ticks)

for me we still few works on that :

GDL> plot, findgen(63)-500, xtick_g=x1, ytick_g=y1
GDL> print, x1, y1
       0.0000000       10.000000       20.000000       30.000000       40.000000       50.000000
       60.000000       70.000000
      -500.00000      -490.00000      -480.00000      -470.00000      -460.00000      -450.00000
      -440.00000      -430.00000

IDL> plot, findgen(63)-500, xtick_g=x1, ytick_g=y1
IDL> print, x1, y1
       0.0000000       20.000000       40.000000       60.000000       80.000000
      -500.00000      -480.00000      -460.00000      -440.00000      -420.00000

(derived from the 3d case (SURFACE))

the good point is we have a way to make automatic tests on that ...

Those ranges were OK since years (at least from gdl-1.0.1git220829 to gdl-1.0.3git230929)

alaingdl commented 5 months ago

but #1701 is even worse ! thanks @GillesDuvert the code survives now to the updated tests test_xyztick_get !

just a detail :

/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp: In function ‘void lib::doOurOwnFormat(PLFLT, char*, PLINT, PLPointer)’:
/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp:1542:38: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 4 has type ‘__gnu_cxx::__promote_2<int, double, double, double>::__type’ {aka ‘double’} [-Wformat=]
 1542 |           snprintf(label, length, "%.*f", pow(10, value), prec);
      |                                    ~~^~   ~~~~~~~~~~~~~~
      |                                      |       |
      |                                      int     __gnu_cxx::__promote_2<int, double, double, double>::__type {aka double}
/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp:1542:39: warning: format ‘%f’ expects argument of type ‘double’, but argument 5 has type ‘int’ [-Wformat=]
 1542 |           snprintf(label, length, "%.*f", pow(10, value), prec);
      |                                    ~~~^                   ~~~~
      |                                       |                   |
      |                                       double              int
      |                                    %.*d
[ 27%] Linking CXX executable gdl
[100%] Built target gdl
GillesDuvert commented 5 months ago

but #1701 is even worse ! thanks @GillesDuvert the code survives now to the updated tests test_xyztick_get !

just a detail :

/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp: In function ‘void lib::doOurOwnFormat(PLFLT, char*, PLINT, PLPointer)’:
/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp:1542:38: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 4 has type ‘__gnu_cxx::__promote_2<int, double, double, double>::__type’ {aka ‘double’} [-Wformat=]
 1542 |           snprintf(label, length, "%.*f", pow(10, value), prec);
      |                                    ~~^~   ~~~~~~~~~~~~~~
      |                                      |       |
      |                                      int     __gnu_cxx::__promote_2<int, double, double, double>::__type {aka double}
/home/gdl/GDL/TestPR1785/gdl/src/plotting.cpp:1542:39: warning: format ‘%f’ expects argument of type ‘double’, but argument 5 has type ‘int’ [-Wformat=]
 1542 |           snprintf(label, length, "%.*f", pow(10, value), prec);
      |                                    ~~~^                   ~~~~
      |                                       |                   |
      |                                       double              int
      |                                    %.*d
[ 27%] Linking CXX executable gdl
[100%] Built target gdl

done, and it was important.