From 05de9c26a8bb043394b5f3161ba6940a002dfd02 Mon Sep 17 00:00:00 2001 From: James Kent Date: Wed, 14 Aug 2024 10:33:23 -0500 Subject: [PATCH] create mapping for the variables Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- nimare/reports/base.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nimare/reports/base.py b/nimare/reports/base.py index a80715ba5..e26be2c5a 100644 --- a/nimare/reports/base.py +++ b/nimare/reports/base.py @@ -484,15 +484,12 @@ def __init__( ) elif meta_type == "IBMA": # Use "z_maps", for Fishers, and Stouffers; otherwise use "beta_maps". - if "z_maps" in self.results.estimator.inputs_: - key_maps = "z_maps" - x_label = "Z" - elif "t_maps" in self.results.estimator.inputs_: - key_maps = "t_maps" - x_label = "T" - else: - key_maps = "beta_maps" - x_label = "Beta" +INPUT_TYPE_LABELS = {'z_maps': 'Z', 't_maps': 'T', 'beta_maps': 'Beta'} +for key_maps, x_label in INPUT_TYPE_LABELS.items(): + if key_maps in self.results.estimator.inputs_: + break +else: + key_maps, x_label = 'beta_maps', 'Beta' maps_arr = self.results.estimator.inputs_[key_maps] ids_ = self.results.estimator.inputs_["id"]