From e7fc45cf8dc05c330ff85c4bea5810a2a0425f11 Mon Sep 17 00:00:00 2001 From: x11x <28614156+x11x@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:53:20 +1000 Subject: [PATCH] Use functools.wraps in set_rc decorator This means docstrings are exposed for the plot helper functions wrapped by set_rc, making it easier to view the docs for each function (so you can use shift-tab etc.) --- scripts/plot_helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/plot_helper.py b/scripts/plot_helper.py index b0a5dcf..18f3f3d 100644 --- a/scripts/plot_helper.py +++ b/scripts/plot_helper.py @@ -4,6 +4,7 @@ from matplotlib import pyplot, ticker, get_backend, rc from mpl_toolkits.mplot3d import Axes3D from itertools import cycle +from functools import wraps # interactive backends _int_backends = ['GTK3Agg', 'GTK3Cairo', 'MacOSX', 'nbAgg', @@ -37,6 +38,7 @@ 'alpha': 0.8} def set_rc(func): + @wraps(func) def wrapper(*args, **kwargs): rc('font', family='serif', size=fontsize) rc('figure', dpi=200)