Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round outputs #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Round outputs #7

wants to merge 2 commits into from

Commits on Aug 5, 2022

  1. Decimal outputs can be rounded

    Adds a command line argument to specify whether to round the outputs
    (and to how many decimal places).
    
    ```
      -R ROUND_TO, --round-to ROUND_TO
                            number of digits to round outputs to
    ```
    
    This addresses two rough edges with models that produce decimal
    outputs. Firstly they may produce outputs with spurious or
    uninteresting accuracy, secondly floating point arithmetic may produce
    unhelpful decimal representations. Both are apparent in the example
    below.
    
    Without rounding:
    
    ```
    $ cat pipeline.sys | systems-run | cut -f1,14- | expand --tabs=20
                        Options             Initiatives         Deliverables        Observables         Done
    0                   0                   0                   0                   0                   0
    1                   5                   0                   0                   0                   0
    2                   6                   2                   0                   0                   0
    3                   6                   2                   2                   0                   0
    4                   5.94                2.0                 2.16                1.8                 0
    5                   6.832000000000001   2.0                 2.2880000000000003  1.8                 1.8
    6                   6.6856              2.0                 2.3904              1.8                 3.6
    7                   6.5084800000000005  2.0                 2.47232             1.8                 5.4
    8                   6.306784            2.0                 2.5378559999999997  1.8                 7.2
    9                   6.0854272           2.0                 2.5902847999999996  1.8                 9.0
    10                  5.848341759999999   2.0                 2.6322278399999997  1.8                 10.8
    ```
    
    With rounding:
    
    ```
    $ cat pipeline.sys | systems-run --round-to 2 | cut -f1,14- | expand --tabs=14
                  Options       Initiatives   Deliverables  Observables   Done
    0             0             0             0             0             0
    1             5             0             0             0             0
    2             6             2             0             0             0
    3             6             2             2             0             0
    4             5.94          2.0           2.16          1.8           0
    5             6.83          2.0           2.29          1.8           1.8
    6             6.69          2.0           2.39          1.8           3.6
    7             6.51          2.0           2.47          1.8           5.4
    8             6.31          2.0           2.54          1.8           7.2
    9             6.09          2.0           2.59          1.8           9.0
    10            5.85          2.0           2.63          1.8           10.8
    ```
    benbc committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    6d2bf1f View commit details
    Browse the repository at this point in the history
  2. Include help output in README

    benbc committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    a581610 View commit details
    Browse the repository at this point in the history