nimare 0.5.0rc1__py3-none-any.whl → 0.5.1rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
nimare/_version.py CHANGED
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-03-13T11:20:33-0500",
11
+ "date": "2025-05-14T18:30:31-0500",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "71d779964e5756b89c6237e1550112d9c8a77498",
15
- "version": "0.5.0rc1"
14
+ "full-revisionid": "0d38f6753997f345fc39e3eddb079655f87077b2",
15
+ "version": "0.5.1rc1"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
nimare/meta/utils.py CHANGED
@@ -33,7 +33,7 @@ def _convolve_sphere(kernel, ijks, index, max_shape):
33
33
 
34
34
  def np_all_axis1(x):
35
35
  """Numba compatible version of np.all(x, axis=1)."""
36
- out = np.ones(x.shape[0], dtype=np.bool8)
36
+ out = np.ones(x.shape[0], dtype=np.bool_)
37
37
  for i in range(x.shape[1]):
38
38
  out = np.logical_and(out, x[:, i])
39
39
  return out
nimare/reports/base.py CHANGED
@@ -540,7 +540,7 @@ class Report:
540
540
  rowvar=True,
541
541
  )
542
542
  else:
543
- corr = self.inputs_["corr_matrix"]
543
+ corr = self.results.estimator.inputs_["corr_matrix"]
544
544
 
545
545
  similarity_table = pd.DataFrame(
546
546
  index=ids_,
@@ -2,10 +2,28 @@
2
2
 
3
3
  import os
4
4
  from glob import glob
5
+ from io import BytesIO
6
+ from unittest.mock import patch
5
7
 
6
8
  import nimare
7
9
 
8
10
 
11
+ def mock_urlopen(url):
12
+ """Mock URL opener that returns appropriate mock data based on file type."""
13
+ if "coordinates.tsv.gz" in url:
14
+ mock_data = b"x\ty\tz\n1\t2\t3\n4\t5\t6"
15
+ elif "metadata.tsv.gz" in url:
16
+ mock_data = b"id\ttitle\n1\tStudy 1\n2\tStudy 2"
17
+ elif "features.npz" in url:
18
+ mock_data = b"mock npz content"
19
+ elif "vocabulary.txt" in url:
20
+ mock_data = b"term1\nterm2\nterm3"
21
+ else:
22
+ mock_data = b"Mock file content"
23
+ return BytesIO(mock_data)
24
+
25
+
26
+ @patch("nimare.extract.extract.urlopen", side_effect=mock_urlopen)
9
27
  def test_fetch_neurosynth(tmp_path_factory):
10
28
  """Smoke test for extract.fetch_neurosynth.
11
29
 
@@ -19,15 +37,20 @@ def test_fetch_neurosynth(tmp_path_factory):
19
37
  source="abstract",
20
38
  vocab="terms",
21
39
  )
22
- files = glob(os.path.join(tmpdir, "neurosynth", "*"))
23
- assert len(files) == 4
24
-
25
- # One set of files found
40
+ # Check data_files structure
26
41
  assert isinstance(data_files, list)
27
42
  assert len(data_files) == 1
28
43
 
44
+ # Verify expected files in data_files
45
+ files_dict = data_files[0]
46
+ assert "coordinates" in files_dict
47
+ assert "metadata" in files_dict
48
+ assert "features" in files_dict
49
+ assert len(files_dict["features"]) == 1
50
+
29
51
 
30
- def test_fetch_neuroquery(tmp_path_factory):
52
+ @patch("nimare.extract.extract.urlopen", side_effect=mock_urlopen)
53
+ def test_fetch_neuroquery(mock_url, tmp_path_factory):
31
54
  """Smoke test for extract.fetch_neuroquery."""
32
55
  tmpdir = tmp_path_factory.mktemp("test_fetch_neuroquery")
33
56
  data_files = nimare.extract.fetch_neuroquery(
@@ -44,3 +67,10 @@ def test_fetch_neuroquery(tmp_path_factory):
44
67
  # One set of files found
45
68
  assert isinstance(data_files, list)
46
69
  assert len(data_files) == 1
70
+
71
+ # Verify mock was called with expected URLs
72
+ assert mock_url.call_count > 0 # Should be called for each file download
73
+ for call in mock_url.call_args_list:
74
+ url = call[0][0]
75
+ assert "neuroquery/neuroquery_data/blob" in url
76
+ assert "?raw=true" in url
@@ -108,3 +108,25 @@ def test_reports_ibma_smoke(tmp_path_factory, testdata_ibma, aggressive_mask):
108
108
  filename = "report.html"
109
109
  outpath = op.join(hedges_dir, filename)
110
110
  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)
nimare/utils.py CHANGED
@@ -1286,9 +1286,9 @@ def b_spline_bases(masker_voxels, spacing, margin=10):
1286
1286
  x_spline_coords = x_spline.nonzero()
1287
1287
  y_spline_coords = y_spline.nonzero()
1288
1288
  z_spline_coords = z_spline.nonzero()
1289
- x_spline_sparse = sparse.COO(x_spline_coords, x_spline[x_spline_coords])
1290
- y_spline_sparse = sparse.COO(y_spline_coords, y_spline[y_spline_coords])
1291
- z_spline_sparse = sparse.COO(z_spline_coords, z_spline[z_spline_coords])
1289
+ x_spline_sparse = sparse.COO(x_spline_coords, x_spline[x_spline_coords], shape=x_spline.shape)
1290
+ y_spline_sparse = sparse.COO(y_spline_coords, y_spline[y_spline_coords], shape=y_spline.shape)
1291
+ z_spline_sparse = sparse.COO(z_spline_coords, z_spline[z_spline_coords], shape=z_spline.shape)
1292
1292
 
1293
1293
  # create spatial design matrix by tensor product of spline bases in 3 dimesion
1294
1294
  # Row sums of X are all 1=> There is no need to re-normalise X
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nimare
3
- Version: 0.5.0rc1
3
+ Version: 0.5.1rc1
4
4
  Summary: NiMARE: Neuroimaging Meta-Analysis Research Environment
5
5
  Home-page: https://github.com/neurostuff/NiMARE
6
6
  Author: NiMARE developers
@@ -1,7 +1,7 @@
1
1
  benchmarks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  benchmarks/bench_cbma.py,sha256=fg_EER8hohi6kD1Hno_uXsFntKuCLTvseu-6OqkHkoU,1382
3
3
  nimare/__init__.py,sha256=HHIq3EimSZSf3zJSDwuTjBig1GbRwHGYfRLSqI3yleE,802
4
- nimare/_version.py,sha256=B-yG1ELidF5YmffvLhUktR130qlkvoRlzyFTb5ItxHw,500
4
+ nimare/_version.py,sha256=wKqr4KLFDBfby4GFFBohLjmyONhzWdP50R86OZ2SCak,500
5
5
  nimare/base.py,sha256=9DlcRB2mW759p7XqpKG3wRE-MmPsEPiYTbq6V1Yile4,7826
6
6
  nimare/cli.py,sha256=Zvy5jN2KopH_MBke-gm8A0DbBZmIFGvnE1tjhbYib9I,3695
7
7
  nimare/correct.py,sha256=2eI0jR6_odND-2CzSlaxRU2um6ccLSapd7ERAYteBnE,17110
@@ -14,7 +14,7 @@ nimare/nimads.py,sha256=2s5QnaLvrBt-kMrImGhG_p6r0unysufIIcPczr2bG0c,24342
14
14
  nimare/results.py,sha256=7szcyR6PkZAXBqbIGGWrw1nW9j9QCdpdl4MxUK_1Wzc,8190
15
15
  nimare/stats.py,sha256=XhXfFj6KHTPVSTXhbEid0qt8HLqJD82Bl5T23qmaf40,10098
16
16
  nimare/transforms.py,sha256=_kZO8N3IEHxd6Ir4IcewZtkWHpFknnjEnjsaD9b-1pg,30136
17
- nimare/utils.py,sha256=BJOOKgQuubamE0RBMJVubggQfaPgIH9wZ9Oou9DKvbU,46936
17
+ nimare/utils.py,sha256=rMuT1mhEYrb3R_2EAsz5A_f5VPWXzqRkH_saQTFybm4,47002
18
18
  nimare/annotate/__init__.py,sha256=hTla1yFYTJ8PDjm72ReeHa3qf0Que50Ww0fqz3Z86JI,434
19
19
  nimare/annotate/cogat.py,sha256=xzrepAuTkRenbECn4XYwgyul45r0tIMxCDKQV_ZFVb8,7457
20
20
  nimare/annotate/gclda.py,sha256=P2OQjuJn3DX0GVPte_VIVZf0LfO-yE_OhLbs6DwMaHQ,42592
@@ -35,13 +35,13 @@ nimare/meta/cbmr.py,sha256=h9CNMHW4KUh-YQYyGDRzqPN7G1tkHYAhrSgxrP8E61s,47769
35
35
  nimare/meta/ibma.py,sha256=qVw3ZhOlK6hgTdZZwa7TPDpfrGLf52dN00wH2Gw-Z8c,65442
36
36
  nimare/meta/kernel.py,sha256=5wN-6dbLkzqQ0WUSTrC0DJPSbbyGiZCls9M_TAYhNGY,19169
37
37
  nimare/meta/models.py,sha256=0QPlQTjWaNTeI8qTX-DHMXVjQSRD72SfJ2RZIYBZnCg,47054
38
- nimare/meta/utils.py,sha256=fvnFz4ek8APjQHhYBS441WYXE1N9huHaTiOO0Bvui4Q,18083
38
+ nimare/meta/utils.py,sha256=84T4I-wn-HTx7zwMqh0TdvzUbBe_vcpxIU4jA_pfuFU,18083
39
39
  nimare/meta/cbma/__init__.py,sha256=bWLrv5tL03U2ITttnnz3yerbg74w44qkZgdy32QMhqQ,219
40
40
  nimare/meta/cbma/ale.py,sha256=ZNjXC4MXhfSHvrTRppY04NkGtz_Iri696k5QMuBog7o,39273
41
41
  nimare/meta/cbma/base.py,sha256=-gJ4hW6_6T5oto3pre9GbWodHWRmPS2WZ1LJjB0BtMI,38382
42
42
  nimare/meta/cbma/mkda.py,sha256=V5vSQodiLZoZhkYPhous0a_-1pZoRjAIL8gmGyyoezc,60397
43
43
  nimare/reports/__init__.py,sha256=zGfrOPlMq2lTorKNEpyPblArFCnsvz3dRsvOHy_Ciag,428
44
- nimare/reports/base.py,sha256=DPYr1lTuS740pSv5Q-tE0UegU0mckG0JMI-2TKVe64Y,23489
44
+ nimare/reports/base.py,sha256=_PYM_zq5ATYden5CiuppURrZX_y54u_h5-DL5UFi_KM,23507
45
45
  nimare/reports/default.yml,sha256=zTcWUlC9ntvacMcIIUAJPoFV8XrvPGqCH2uwovwB4Wc,6003
46
46
  nimare/reports/figures.py,sha256=MCsjDR53475Jz1_anktKvNOh0qUNPMx-dfvP6Vy0uUc,19783
47
47
  nimare/reports/report.tpl,sha256=ZweYiJF80zdaIwK1iawAl1pwmBZdPjpxXxY5C0U5yVs,5518
@@ -72,7 +72,7 @@ nimare/tests/test_decode_continuous.py,sha256=KmdkulIIBBpjbao-TdFTVFuRd6lUx_-3Qq
72
72
  nimare/tests/test_decode_discrete.py,sha256=NL__uEvMori4HtmoZUVdj465lW4Qwr4ndgyOz5rB7dY,3293
73
73
  nimare/tests/test_diagnostics.py,sha256=VrfR_8nQKn2VF7dFdnTM7ZQy3Ou5eHdpaLhml5T6Pb0,6467
74
74
  nimare/tests/test_estimator_performance.py,sha256=tbK2Qr83rB0in-pB6MccnjLg4iHSyfilx-hTNDWQfe4,12749
75
- nimare/tests/test_extract.py,sha256=XJSxZTdy_hAej1J9CFK9zQk29rAM5KPiZKlopmUVCJ4,1206
75
+ nimare/tests/test_extract.py,sha256=nPaL07G9paLRCJzPOv79jH3mhOPs2YvQdghoLfcDz5A,2348
76
76
  nimare/tests/test_generate.py,sha256=LSh2APJsg87u2s2zydkrre3RVk_ZGpoB4d7uuvIPWYE,7318
77
77
  nimare/tests/test_io.py,sha256=QKr_zRGu8tyrpiLoLAjCV9ektxCTHRlKPWgyJRqQ9T8,10397
78
78
  nimare/tests/test_meta_ale.py,sha256=hccXSNzLGUgj6E4tCsiHZpuUFoBxXkP293-vtUS5jdE,11791
@@ -81,7 +81,7 @@ nimare/tests/test_meta_ibma.py,sha256=Yw4F0_pr3cpVSe7oeMlK0-btg1Uw58cenklOsIw87P
81
81
  nimare/tests/test_meta_kernel.py,sha256=Edk6lOsnqokg86mp9jAkokA203K61R7pjJEmyEEzV7E,8450
82
82
  nimare/tests/test_meta_mkda.py,sha256=9PuzNUKrTBjbCHdSnuOAToXbV7wp1O0TCdD537qGQkA,9206
83
83
  nimare/tests/test_nimads.py,sha256=3yzCO8rmUVfEYAt3HNnJcyAENorJ5BOWdJXY3hjrdP0,9807
84
- nimare/tests/test_reports.py,sha256=Qdz-PHjQwOneRmSCo0ac2d67BeGypWJIMi4OoiQrNik,3293
84
+ nimare/tests/test_reports.py,sha256=KIihXTAsIntsEG6xk3crMFLoQGiI5EOr0mesCne48CA,4030
85
85
  nimare/tests/test_stats.py,sha256=_GhpUC1u4hnFR2SZ-sHQqkJ5MwsyPsvwPEd2GkQmsHY,4030
86
86
  nimare/tests/test_transforms.py,sha256=mzEnufefhybs4r_dfRY6zQUAShepPMwKFY7S5amq3cs,10378
87
87
  nimare/tests/test_utils.py,sha256=JaJYexM_xJOa-Jhv5OdbQBZ-3IWba1-Dmf1-V580ACo,6443
@@ -111,9 +111,9 @@ nimare/workflows/cbma.py,sha256=2jYJs9kH7_LzFP6d7-oTHiTTgAFbtmiBNtBXSCSZPjg,7052
111
111
  nimare/workflows/ibma.py,sha256=lAkWtqSqnZiUUV460Bh046U9LeGhnry3bl8BFi-tx7s,4289
112
112
  nimare/workflows/macm.py,sha256=mVUBeKbTawhU93ApnkunZSUXZWo7qBPrM3dMGWfl0ik,2531
113
113
  nimare/workflows/misc.py,sha256=OWgHlSAnRI0-5Seii-bd48piIYsfEAF_aNKGorH1yJQ,1827
114
- nimare-0.5.0rc1.dist-info/LICENSE,sha256=PWPXnCGWh-FMiBZ61OnQ2BHFjPPlJJ7F0kFx_ryzp-M,1074
115
- nimare-0.5.0rc1.dist-info/METADATA,sha256=YyiKFKuawdfsp9SIW5pJ6nVgibwk27EYr8bKIointfA,4698
116
- nimare-0.5.0rc1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
117
- nimare-0.5.0rc1.dist-info/entry_points.txt,sha256=3w_hk9N2PWnKZkCaJyDlc0_kdn3rh35aiI21rSdvsuA,44
118
- nimare-0.5.0rc1.dist-info/top_level.txt,sha256=XnOcEXMs0BxdI8t3_ksTl96T8hykn9L7-bxLLraVrTI,18
119
- nimare-0.5.0rc1.dist-info/RECORD,,
114
+ nimare-0.5.1rc1.dist-info/LICENSE,sha256=PWPXnCGWh-FMiBZ61OnQ2BHFjPPlJJ7F0kFx_ryzp-M,1074
115
+ nimare-0.5.1rc1.dist-info/METADATA,sha256=z9_jAt6fncG6KjI6Fi_A3ktJyuY1gAAUEsU-cvZBn5U,4698
116
+ nimare-0.5.1rc1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
117
+ nimare-0.5.1rc1.dist-info/entry_points.txt,sha256=3w_hk9N2PWnKZkCaJyDlc0_kdn3rh35aiI21rSdvsuA,44
118
+ nimare-0.5.1rc1.dist-info/top_level.txt,sha256=XnOcEXMs0BxdI8t3_ksTl96T8hykn9L7-bxLLraVrTI,18
119
+ nimare-0.5.1rc1.dist-info/RECORD,,