Giter Site home page Giter Site logo

Comments (9)

dbeyer avatar dbeyer commented on June 9, 2024

This should actually be split into two independent features:
(a) adhere to significant digits (i.e., we must not display digits that have no significance) and
(b) nicely align the numbers at the decimal point in the table columns.

The correct number of significant digits should be provided by the measurement engineer
(in the XML table definition).

I have implemented a preliminary version of these two features in functions

  • format_number (reduce to significant digits) and
  • format_number_align (alignment)
    in util.py.

The perfect adjustment is only possible with the counting mentioned by Philipp.
But instead of the "maximum width" we need the "maximum number of digits after the decimal point",
for a correct alignment that works for all situations.

The current implementation works well for values larger than 0.1
(i.e., when the max number of digits after the decimal point coincides with the number of significant digits).

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

The same assignment also needs to be done for the statistics lines at the bottom of the table.

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

There is currently something wrong with at least some results, I have cases where values between 0 and 1 get rounded incorrectly to 0. This is visible for example in the test case test_multi_table_xml_with_columns in column SMT time (s).

Furthermore, it seems that statistics get computed only for the first set of results in a table (visible among others in the same test case).

from benchexec.

lembergerth avatar lembergerth commented on June 9, 2024

The two stated bugs should be fixed by commits 9bddbd8 and 769e9ea, sorry about them.

Another issue: How should the format of value 0 look like?
E.g.: Number of significant digits = 3, value = 0.0000
Should we display 0.00 or 0.0000?

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

Good question. 0.00 would look more natural in general, while .000 would look more like the values nearby. There is still a mismatch with very small values like .00123 anyway though, thus I think we can go with 0.00.

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

The rounding is almost perfect now, except values like 0.070 get rounded to .07 instead of .070.

Could you please add some unit tests for format_number/format_value?

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

For columns of format count, the average and stdev values in the summary tooltips of the footer now have too many digits. I think these can be rounded to 1 or 2 decimal places. If the user gave a number of significant digits for this column, this should be applied here as well, of course (just like it is already done for measure columns).

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

There also seem to be too many spaces on the right now for columns with small values, e.g. again in test case test_multi_table_xml_with_columns in column SMT time (s).

from benchexec.

PhilippWendler avatar PhilippWendler commented on June 9, 2024

Thanks @leostrakosch, I could not find any remaining problem, thus I am closing this. Please still write some unit tests, and if you think the current code is worth to be refactored, feel free to do so.

from benchexec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.