Skip to content

Commit

Permalink
Improve report generation
Browse files Browse the repository at this point in the history
Allow the generation of xkcd like plots and fix the bug that
caused the x axis descriptions of box plots to be cut off.
  • Loading branch information
parttimenerd committed May 8, 2016
1 parent 615b51f commit 76e2cf6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run(self):
"Operating System :: POSIX :: Linux",
"Topic :: System :: Benchmark",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Development Status :: 2 - Beta",
"Development Status :: 4 - Beta",
"Environment :: Console",
'Intended Audience :: Developers',

Expand Down
2 changes: 1 addition & 1 deletion temci/report/rundata.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _speed_up(self, property: str, data1: RunData, data2: RunData):
Calculates the speed up from the second to the first
(e.g. the first is RESULT * 100 % faster than the second).
"""
return (scipy.mean(data2[property]) - scipy.mean(data1[property])) \
return (scipy.mean(data1[property]) - scipy.mean(data2[property])) \
/ scipy.mean(data1[property])

def _estimate_time_for_run_datas(self, run_bin_size: int, data1: RunData, data2: RunData,
Expand Down
20 changes: 15 additions & 5 deletions temci/report/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ def histogram(self, fig_width: Number, fig_height: Number = None,
:param other_obj_names: names of the additional objects
:param own_name: used with other_objs option
"""
self.reset_plt()
self._hist_data = {}
import matplotlib.pyplot as plt
import seaborn as sns
Expand Down Expand Up @@ -631,11 +632,19 @@ def __str__(self) -> str:

def reset_plt(self):
""" Reset the current matplotlib plot style. """
import seaborn as sns
sns.reset_defaults()
sns.set_style("darkgrid")
sns.set_palette(sns.color_palette("muted"))
mpl.use("agg")
import matplotlib.pyplot as plt
plt.gcf().subplots_adjust(bottom=0.15)
if Settings()["report/xkcd_like_plots"]:
import seaborn as sns
sns.reset_defaults()
mpl.use("agg")
plt.xkcd()
else:
import seaborn as sns
sns.reset_defaults()
sns.set_style("darkgrid")
sns.set_palette(sns.color_palette("muted"))
mpl.use("agg")


class Single(BaseStatObject):
Expand Down Expand Up @@ -1302,6 +1311,7 @@ def boxplot(self, fig_width: Number, fig_height: Number = None):
"""
import seaborn as sns
import matplotlib.pyplot as plt
self.reset_plt()
if fig_height is None:
fig_height = self._height_for_width(fig_width)
self._fig = plt.figure(figsize=self._fig_size_cm_to_inch(fig_width, fig_height))
Expand Down
2 changes: 1 addition & 1 deletion temci/scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Versions with uneven minor version number are considered beta.
"""

version = "0.7.1"
version = "0.7.2"
""" The current version of temci """
4 changes: 3 additions & 1 deletion temci/utils/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class Settings(metaclass=Singleton):
"exclude_invalid": BoolOrNone() // Default(True)
// Description("Exclude all data sets that contain only zeros or NaNs."),
"long_properties": BoolOrNone() // Default(True)
// Description("Replace the property names in reports with longer more descriptive versions?")
// Description("Replace the property names in reports with longer more descriptive versions?"),
"xkcd_like_plots": BoolOrNone() // Default(False)
// Description("Produce xkcd like plots (requires the humor sans font to be installed)")
}, all_keys=False),
"run": Dict({
"discarded_runs": NaturalNumber() // Description("First n runs that are discarded") // Default(1),
Expand Down

0 comments on commit 76e2cf6

Please sign in to comment.