Skip to content

Commit

Permalink
Improve temci format documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Bechberger committed Jul 15, 2019
1 parent a3ba150 commit 9a878ca
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 6 deletions.
40 changes: 40 additions & 0 deletions doc/temci.utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ temci.utils.click_helper module
:undoc-members:
:show-inheritance:

temci.utils.config_utils module
-------------------------------

.. automodule:: temci.utils.config_utils
:members:
:undoc-members:
:show-inheritance:

temci.utils.library_init module
-------------------------------

.. automodule:: temci.utils.library_init
:members:
:undoc-members:
:show-inheritance:

temci.utils.mail module
-----------------------

Expand All @@ -20,6 +36,22 @@ temci.utils.mail module
:undoc-members:
:show-inheritance:

temci.utils.number module
-------------------------

.. automodule:: temci.utils.number
:members:
:undoc-members:
:show-inheritance:

temci.utils.plugin module
-------------------------

.. automodule:: temci.utils.plugin
:members:
:undoc-members:
:show-inheritance:

temci.utils.registry module
---------------------------

Expand All @@ -36,6 +68,14 @@ temci.utils.settings module
:undoc-members:
:show-inheritance:

temci.utils.sudo_utils module
-----------------------------

.. automodule:: temci.utils.sudo_utils
:members:
:undoc-members:
:show-inheritance:

temci.utils.typecheck module
----------------------------

Expand Down
33 changes: 33 additions & 0 deletions doc/temci_format.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
temci format
============

.. code:: sh
temci format [OPTIONS] NUMBER [ABS_DEVIATION]
A small formatting utility, to format numbers with their standard deviation and si prefixes.

Usage Example
-------------

.. code:: sh
> temci format 1.0 0.5
1.(000)
> temci format 1.56 0.005
1.56(0)
> temci format 1560 --scientific_notation
1.560k
> temci format 1560 --no-scientific_notation_si_prefixes
1.560e3
This tool uses the number formatting module `temci.utils.number <temci.utils.html#temci.utils.number>`_.
The therein defined method `format_number <temci.utils.html#temci.utils.number.format_number>`_ can be
used to format numbers and has the same options as the tool itself.
Read `Usage as a Library <extending.html#usage-as-a-library>`_ on how to use the module in a project other
than temci.

Options
-------

.. code:: sh
Usage: temci format [OPTIONS] NUMBER [ABS_DEVIATION]
Expand Down Expand Up @@ -56,3 +86,6 @@ A small formatting utility, to format numbers with their standard deviation and
Don't omit the minimum number of decimal
places if insignificant? [default: True]
--help Show this message and exit.
These options can also be set in the settings file, under ``report/number``.
13 changes: 7 additions & 6 deletions doc/temci_shell.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
temci shell
-----------
===========

``temci short shell`` opens a shell in a benchmarking environment. It allows to execute your own benchmarking suite
in its own cpuset with disabled hyper threading, ….
Expand All @@ -8,18 +8,19 @@ This command has the same options as `temci exec <temci_exec.html>`_ (regarding
For example running your own benchmarking suite ``bench.sh`` in a reasonably setup environment can be done
via:

.. code: sh
.. code:: sh
temci short shell ./bench.sh
The launched shell is interative:
The launched shell is interactive:

.. code: sh
.. code:: sh
temci short shell
> echo 1
> temci short shell
>> echo 1
1
``temci shell`` accepts an input file as its argument which has the following structure
(see `ShellRunDriver <temci.run.html#temci.run.run_driver.ShellRunDriver>`_:

Expand Down
2 changes: 2 additions & 0 deletions temci/utils/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import math
from temci.utils.typecheck import *
from temci.utils.util import document

Number = t.Union[int, float]
""" Numeric type """
Expand All @@ -28,6 +29,7 @@ def map(cls, key: t.Union[str, 'ParenthesesMode']) -> 'ParenthesesMode':
}[key]


@document(settings_format="Configuration format, is in the settings under report/number")
class FNumber:
"""
A formattable number wrapper.
Expand Down

0 comments on commit 9a878ca

Please sign in to comment.