Skip to content

Commit 0d38f67

Browse files
authored
Fix the use correlation matrix from the results object when available for Reports (#925)
* Fix the use correlation matrix from the results object when available * Improve coverage in Reports
1 parent ed5f067 commit 0d38f67

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

nimare/reports/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def __init__(
540540
rowvar=True,
541541
)
542542
else:
543-
corr = self.inputs_["corr_matrix"]
543+
corr = self.results.estimator.inputs_["corr_matrix"]
544544

545545
similarity_table = pd.DataFrame(
546546
index=ids_,

nimare/tests/test_reports.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,25 @@ def test_reports_ibma_smoke(tmp_path_factory, testdata_ibma, aggressive_mask):
108108
filename = "report.html"
109109
outpath = op.join(hedges_dir, filename)
110110
assert op.isfile(outpath)
111+
112+
113+
def test_reports_ibma_multiple_contrasts_smoke(tmp_path_factory, testdata_ibma_multiple_contrasts):
114+
"""Smoke test for IBMA reports for multiple contrasts."""
115+
tmpdir = tmp_path_factory.mktemp("test_reports_ibma_smoke")
116+
117+
# Generate a report with z maps as inputs
118+
stouffers_dir = op.join(tmpdir, "stouffers")
119+
workflow = IBMAWorkflow(
120+
estimator=Stouffers(aggressive_mask=True),
121+
corrector="fdr",
122+
diagnostics="jackknife",
123+
voxel_thresh=3.2,
124+
output_dir=stouffers_dir,
125+
)
126+
results = workflow.fit(testdata_ibma_multiple_contrasts)
127+
128+
run_reports(results, stouffers_dir)
129+
130+
filename = "report.html"
131+
outpath = op.join(stouffers_dir, filename)
132+
assert op.isfile(outpath)

0 commit comments

Comments
 (0)