From f1af47354c98d7c2343fe57fb4445b7197c6202d Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Thu, 23 Sep 2021 09:46:40 +0200 Subject: [PATCH] ba_plot: follow pylint style advice --- Wrap/Python/ba_plot.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Wrap/Python/ba_plot.py b/Wrap/Python/ba_plot.py index a890d592764..3c7f4667641 100644 --- a/Wrap/Python/ba_plot.py +++ b/Wrap/Python/ba_plot.py @@ -24,7 +24,7 @@ except Exception as e: label_fontsize = 16 # default values from environment variables -CMAP = "CMAP" in os.environ and os.environ["CMAP"] or 'inferno' +CMAP = os.environ['CMAP'] if 'CMAP' in os.environ else 'inferno' NOSHOW = "NOSHOW" in os.environ @@ -68,8 +68,7 @@ def translate_axis_label(label): } if label in label_dict.keys(): return label_dict[label] - else: - return label + return label def get_axes_labels(result, units): @@ -139,9 +138,9 @@ def plot_histogram(hist, **kwargs): :param zmax: Max value on amplitude's color bar """ - if not 'xlabel' in kwargs: + if 'xlabel' not in kwargs: kwargs['xlabel'] = translate_axis_label(hist.xAxis().axisName()) - if not 'ylabel' in kwargs: + if 'ylabel' not in kwargs: kwargs['ylabel'] = translate_axis_label(hist.yAxis().axisName()) axes_limits = [ @@ -171,9 +170,9 @@ def plot_colormap(result, **kwargs): axes_limits = get_axes_limits(result, units) axes_labels = get_axes_labels(result, units) - if not 'xlabel' in kwargs: + if 'xlabel' not in kwargs: kwargs['xlabel'] = axes_labels[0] - if not 'ylabel' in kwargs: + if 'ylabel' not in kwargs: kwargs['ylabel'] = axes_labels[1] return plot_array(result.array(), axes_limits=axes_limits, **kwargs) @@ -230,7 +229,7 @@ def plot_simulation_result(result, **kwargs): else: plot_colormap(result, **kwargs) plt.tight_layout() - if not (noshow): + if not noshow: plt.show() else: print("plot_simulation_result: noshow") -- GitLab