Skip to content

Commit

Permalink
Improve code documentation for csv and codespeed runners
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Bechberger committed Jul 16, 2019
1 parent 0ee76f6 commit 11f24af
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions temci/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def _full_single_property_comp_table(self, property: str = None) -> '_Table':
pair = self.stats.get_pair(i, j)
rel_diff = None
if property is None:
popover.content = """
popover.content = r"""
Geometric mean of the means of the left relative to the means of the right:
\\[\\sqrt[\|properties\|]{
\\prod_{p \in \\text{properties}}
Expand Down Expand Up @@ -878,7 +878,7 @@ def _short_summary_table_for_single_property(self, objs: t.List[SingleProperty],
"format": self._float_format,
"extended": True
}, {
"title": "\(\sigma\) per mean",
"title": r"\(\sigma\) per mean",
"func": lambda x: fnumber(x.std_dev_per_mean(), rel_deviation=x.sem() / (x.mean() ** 2),
is_percent=True),
"format": self._percent_format,
Expand Down Expand Up @@ -924,7 +924,7 @@ def _short_summary_table_for_single_property(self, objs: t.List[SingleProperty],
}]
if self.misc["min_in_comparison_tables"]:
tested_per_prop.extend([{
"title": "\(\sigma\) per min",
"title": r"\(\sigma\) per min",
"func": lambda x: x.std_dev() / x.min(),
"format": self._float_format,
"popover": _Popover(self, "sdf", "sdf"),
Expand Down Expand Up @@ -1796,8 +1796,6 @@ def report(self) -> t.Optional[str]:
"""
Create an report and output it as configured.
:param with_tester_results: include the hypothesis tester results
:param to_string: return the report as a string and don't output it?
:return: the report string if ``to_string == True``
"""
if not self.misc["out"] == "-" and not os.path.exists(os.path.dirname(self.misc["out"])):
Expand Down Expand Up @@ -1858,12 +1856,14 @@ def _column_property(self, single: SingleProperty, modifier: str, opts: t.List[s
}))
class CodespeedReporter(AbstractReporter):
"""
Reporter that outputs JSON as expected by [codespeed](https://github.com/tobami/codespeed).
Reporter that outputs JSON as expected by `codespeed <https://github.com/tobami/codespeed>`_.
Branch name and commit ID are taken from the current directory.
Use it like this:
```
temci report --reporter codespeed ... | curl --data-urlencode json@- http://localhost:8000/result/add/json/
```
.. code:: sh
temci report --reporter codespeed ... | curl --data-urlencode json@- http://localhost:8000/result/add/json/
"""

def report(self):
Expand Down

0 comments on commit 11f24af

Please sign in to comment.