junifer 0.0.6.dev248__py3-none-any.whl → 0.0.6.dev258__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.
Files changed (131) hide show
  1. junifer/_version.py +2 -2
  2. junifer/api/decorators.py +1 -2
  3. junifer/api/functions.py +18 -18
  4. junifer/api/queue_context/gnu_parallel_local_adapter.py +4 -4
  5. junifer/api/queue_context/htcondor_adapter.py +4 -4
  6. junifer/api/queue_context/tests/test_gnu_parallel_local_adapter.py +3 -3
  7. junifer/api/queue_context/tests/test_htcondor_adapter.py +3 -3
  8. junifer/api/tests/test_functions.py +32 -32
  9. junifer/cli/cli.py +3 -3
  10. junifer/cli/parser.py +4 -4
  11. junifer/cli/tests/test_cli.py +5 -5
  12. junifer/cli/utils.py +5 -6
  13. junifer/configs/juseless/datagrabbers/ixi_vbm.py +2 -2
  14. junifer/configs/juseless/datagrabbers/tests/test_ucla.py +2 -2
  15. junifer/configs/juseless/datagrabbers/ucla.py +4 -4
  16. junifer/data/_dispatch.py +11 -14
  17. junifer/data/coordinates/_ants_coordinates_warper.py +16 -6
  18. junifer/data/coordinates/_coordinates.py +7 -7
  19. junifer/data/coordinates/_fsl_coordinates_warper.py +3 -3
  20. junifer/data/masks/_ants_mask_warper.py +3 -3
  21. junifer/data/masks/_fsl_mask_warper.py +3 -3
  22. junifer/data/masks/_masks.py +6 -9
  23. junifer/data/masks/tests/test_masks.py +4 -4
  24. junifer/data/parcellations/_ants_parcellation_warper.py +3 -3
  25. junifer/data/parcellations/_fsl_parcellation_warper.py +3 -3
  26. junifer/data/parcellations/_parcellations.py +19 -19
  27. junifer/data/parcellations/tests/test_parcellations.py +1 -2
  28. junifer/data/pipeline_data_registry_base.py +3 -2
  29. junifer/data/template_spaces.py +3 -3
  30. junifer/data/tests/test_data_utils.py +1 -2
  31. junifer/data/utils.py +4 -3
  32. junifer/datagrabber/aomic/id1000.py +2 -2
  33. junifer/datagrabber/aomic/piop1.py +5 -5
  34. junifer/datagrabber/aomic/piop2.py +5 -5
  35. junifer/datagrabber/aomic/tests/test_id1000.py +3 -3
  36. junifer/datagrabber/aomic/tests/test_piop1.py +4 -4
  37. junifer/datagrabber/aomic/tests/test_piop2.py +4 -4
  38. junifer/datagrabber/base.py +12 -11
  39. junifer/datagrabber/datalad_base.py +3 -3
  40. junifer/datagrabber/dmcc13_benchmark.py +8 -8
  41. junifer/datagrabber/hcp1200/datalad_hcp1200.py +3 -3
  42. junifer/datagrabber/hcp1200/hcp1200.py +8 -8
  43. junifer/datagrabber/hcp1200/tests/test_hcp1200.py +2 -1
  44. junifer/datagrabber/multiple.py +7 -7
  45. junifer/datagrabber/pattern.py +10 -10
  46. junifer/datagrabber/pattern_validation_mixin.py +10 -10
  47. junifer/datagrabber/tests/test_datalad_base.py +7 -8
  48. junifer/datagrabber/tests/test_dmcc13_benchmark.py +2 -2
  49. junifer/datagrabber/tests/test_pattern_validation_mixin.py +6 -6
  50. junifer/datareader/default.py +6 -6
  51. junifer/external/nilearn/junifer_connectivity_measure.py +2 -2
  52. junifer/external/nilearn/junifer_nifti_spheres_masker.py +4 -4
  53. junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +15 -15
  54. junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py +2 -3
  55. junifer/markers/base.py +8 -8
  56. junifer/markers/brainprint.py +7 -9
  57. junifer/markers/complexity/complexity_base.py +6 -8
  58. junifer/markers/complexity/hurst_exponent.py +5 -5
  59. junifer/markers/complexity/multiscale_entropy_auc.py +5 -5
  60. junifer/markers/complexity/perm_entropy.py +5 -5
  61. junifer/markers/complexity/range_entropy.py +5 -5
  62. junifer/markers/complexity/range_entropy_auc.py +5 -5
  63. junifer/markers/complexity/sample_entropy.py +5 -5
  64. junifer/markers/complexity/weighted_perm_entropy.py +5 -5
  65. junifer/markers/ets_rss.py +7 -7
  66. junifer/markers/falff/_afni_falff.py +1 -2
  67. junifer/markers/falff/_junifer_falff.py +1 -2
  68. junifer/markers/falff/falff_base.py +2 -4
  69. junifer/markers/falff/falff_parcels.py +7 -7
  70. junifer/markers/falff/falff_spheres.py +6 -6
  71. junifer/markers/functional_connectivity/crossparcellation_functional_connectivity.py +6 -6
  72. junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +7 -7
  73. junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +6 -6
  74. junifer/markers/functional_connectivity/functional_connectivity_base.py +10 -10
  75. junifer/markers/functional_connectivity/functional_connectivity_parcels.py +7 -7
  76. junifer/markers/functional_connectivity/functional_connectivity_spheres.py +6 -6
  77. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +1 -2
  78. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +1 -2
  79. junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +3 -3
  80. junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +3 -3
  81. junifer/markers/parcel_aggregation.py +8 -8
  82. junifer/markers/reho/_afni_reho.py +1 -2
  83. junifer/markers/reho/_junifer_reho.py +1 -2
  84. junifer/markers/reho/reho_base.py +2 -4
  85. junifer/markers/reho/reho_parcels.py +8 -8
  86. junifer/markers/reho/reho_spheres.py +7 -7
  87. junifer/markers/sphere_aggregation.py +8 -8
  88. junifer/markers/temporal_snr/temporal_snr_base.py +8 -8
  89. junifer/markers/temporal_snr/temporal_snr_parcels.py +6 -6
  90. junifer/markers/temporal_snr/temporal_snr_spheres.py +5 -5
  91. junifer/markers/utils.py +3 -3
  92. junifer/onthefly/_brainprint.py +2 -2
  93. junifer/onthefly/read_transform.py +3 -3
  94. junifer/pipeline/marker_collection.py +4 -4
  95. junifer/pipeline/pipeline_component_registry.py +5 -4
  96. junifer/pipeline/pipeline_step_mixin.py +7 -7
  97. junifer/pipeline/tests/test_pipeline_component_registry.py +2 -3
  98. junifer/pipeline/tests/test_pipeline_step_mixin.py +19 -19
  99. junifer/pipeline/tests/test_update_meta_mixin.py +4 -4
  100. junifer/pipeline/update_meta_mixin.py +2 -2
  101. junifer/pipeline/utils.py +5 -5
  102. junifer/preprocess/base.py +10 -10
  103. junifer/preprocess/confounds/fmriprep_confound_remover.py +11 -14
  104. junifer/preprocess/confounds/tests/test_fmriprep_confound_remover.py +1 -2
  105. junifer/preprocess/smoothing/smoothing.py +7 -7
  106. junifer/preprocess/warping/_ants_warper.py +3 -4
  107. junifer/preprocess/warping/_fsl_warper.py +3 -4
  108. junifer/preprocess/warping/space_warper.py +6 -6
  109. junifer/preprocess/warping/tests/test_space_warper.py +3 -4
  110. junifer/stats.py +4 -4
  111. junifer/storage/base.py +14 -13
  112. junifer/storage/hdf5.py +21 -20
  113. junifer/storage/pandas_base.py +12 -11
  114. junifer/storage/sqlite.py +11 -11
  115. junifer/storage/tests/test_hdf5.py +1 -2
  116. junifer/storage/tests/test_sqlite.py +2 -2
  117. junifer/storage/tests/test_utils.py +8 -7
  118. junifer/storage/utils.py +7 -7
  119. junifer/testing/datagrabbers.py +9 -10
  120. junifer/tests/test_stats.py +2 -2
  121. junifer/typing/_typing.py +6 -9
  122. junifer/utils/helpers.py +2 -3
  123. junifer/utils/logging.py +5 -5
  124. junifer/utils/singleton.py +3 -3
  125. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/METADATA +2 -2
  126. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/RECORD +131 -131
  127. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/AUTHORS.rst +0 -0
  128. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/LICENSE.md +0 -0
  129. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/WHEEL +0 -0
  130. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/entry_points.txt +0 -0
  131. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev258.dist-info}/top_level.txt +0 -0
junifer/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.0.6.dev248'
16
- __version_tuple__ = version_tuple = (0, 0, 6, 'dev248')
15
+ __version__ = version = '0.0.6.dev258'
16
+ __version_tuple__ = version_tuple = (0, 0, 6, 'dev258')
junifer/api/decorators.py CHANGED
@@ -5,7 +5,6 @@
5
5
  # Synchon Mandal <s.mandal@fz-juelich.de>
6
6
  # License: AGPL
7
7
 
8
- from typing import Type
9
8
 
10
9
  from ..pipeline import PipelineComponentRegistry
11
10
  from ..typing import DataGrabberLike, MarkerLike, PreprocessorLike, StorageLike
@@ -47,7 +46,7 @@ def register_datagrabber(klass: DataGrabberLike) -> DataGrabberLike:
47
46
  return klass
48
47
 
49
48
 
50
- def register_datareader(klass: Type) -> Type:
49
+ def register_datareader(klass: type) -> type:
51
50
  """Register DataReader.
52
51
 
53
52
  Registers the DataReader so it can be used by name.
junifer/api/functions.py CHANGED
@@ -8,7 +8,7 @@
8
8
  import os
9
9
  import shutil
10
10
  from pathlib import Path
11
- from typing import Dict, List, Optional, Tuple, Union
11
+ from typing import Optional, Union
12
12
 
13
13
  from ..api.queue_context import GnuParallelLocalAdapter, HTCondorAdapter
14
14
  from ..datagrabber import BaseDataGrabber
@@ -27,7 +27,7 @@ from ..utils import logger, raise_error, yaml
27
27
  __all__ = ["run", "collect", "queue", "reset", "list_elements"]
28
28
 
29
29
 
30
- def _get_datagrabber(datagrabber_config: Dict) -> DataGrabberLike:
30
+ def _get_datagrabber(datagrabber_config: dict) -> DataGrabberLike:
31
31
  """Get DataGrabber.
32
32
 
33
33
  Parameters
@@ -49,7 +49,7 @@ def _get_datagrabber(datagrabber_config: Dict) -> DataGrabberLike:
49
49
  )
50
50
 
51
51
 
52
- def _get_preprocessor(preprocessing_config: Dict) -> PreprocessorLike:
52
+ def _get_preprocessor(preprocessing_config: dict) -> PreprocessorLike:
53
53
  """Get Preprocessor.
54
54
 
55
55
  Parameters
@@ -71,7 +71,7 @@ def _get_preprocessor(preprocessing_config: Dict) -> PreprocessorLike:
71
71
  )
72
72
 
73
73
 
74
- def _get_marker(marker_config: Dict) -> MarkerLike:
74
+ def _get_marker(marker_config: dict) -> MarkerLike:
75
75
  """Get Marker.
76
76
 
77
77
  Parameters
@@ -93,7 +93,7 @@ def _get_marker(marker_config: Dict) -> MarkerLike:
93
93
  )
94
94
 
95
95
 
96
- def _get_storage(storage_config: Dict) -> StorageLike:
96
+ def _get_storage(storage_config: dict) -> StorageLike:
97
97
  """Get Storage.
98
98
 
99
99
  Parameters
@@ -117,11 +117,11 @@ def _get_storage(storage_config: Dict) -> StorageLike:
117
117
 
118
118
  def run(
119
119
  workdir: Union[str, Path],
120
- datagrabber: Dict,
121
- markers: List[Dict],
122
- storage: Dict,
123
- preprocessors: Optional[List[Dict]] = None,
124
- elements: Union[str, List[Union[str, Tuple]], Tuple, None] = None,
120
+ datagrabber: dict,
121
+ markers: list[dict],
122
+ storage: dict,
123
+ preprocessors: Optional[list[dict]] = None,
124
+ elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
125
125
  ) -> None:
126
126
  """Run the pipeline on the selected element.
127
127
 
@@ -202,7 +202,7 @@ def run(
202
202
  mc.fit(datagrabber_object[t_element])
203
203
 
204
204
 
205
- def collect(storage: Dict) -> None:
205
+ def collect(storage: dict) -> None:
206
206
  """Collect and store data.
207
207
 
208
208
  Parameters
@@ -224,12 +224,12 @@ def collect(storage: Dict) -> None:
224
224
 
225
225
 
226
226
  def queue(
227
- config: Dict,
227
+ config: dict,
228
228
  kind: str,
229
229
  jobname: str = "junifer_job",
230
230
  overwrite: bool = False,
231
- elements: Union[str, List[Union[str, Tuple]], Tuple, None] = None,
232
- **kwargs: Union[str, int, bool, Dict, Tuple, List],
231
+ elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
232
+ **kwargs: Union[str, int, bool, dict, tuple, list],
233
233
  ) -> None:
234
234
  """Queue a job to be executed later.
235
235
 
@@ -316,7 +316,7 @@ def queue(
316
316
  elements = dg.get_elements()
317
317
  # Listify elements
318
318
  if not isinstance(elements, list):
319
- elements: List[Union[str, Tuple]] = [elements]
319
+ elements: list[Union[str, tuple]] = [elements]
320
320
 
321
321
  # Check job queueing system
322
322
  adapter = None
@@ -341,7 +341,7 @@ def queue(
341
341
  logger.info("Queue done")
342
342
 
343
343
 
344
- def reset(config: Dict) -> None:
344
+ def reset(config: dict) -> None:
345
345
  """Reset the storage and jobs directory.
346
346
 
347
347
  Parameters
@@ -380,8 +380,8 @@ def reset(config: Dict) -> None:
380
380
 
381
381
 
382
382
  def list_elements(
383
- datagrabber: Dict,
384
- elements: Union[str, List[Union[str, Tuple]], Tuple, None] = None,
383
+ datagrabber: dict,
384
+ elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
385
385
  ) -> str:
386
386
  """List elements of the datagrabber filtered using `elements`.
387
387
 
@@ -6,7 +6,7 @@
6
6
  import shutil
7
7
  import textwrap
8
8
  from pathlib import Path
9
- from typing import Dict, List, Optional, Tuple, Union
9
+ from typing import Optional, Union
10
10
 
11
11
  from ...utils import logger, make_executable, raise_error, run_ext_cmd
12
12
  from .queue_context_adapter import QueueContextAdapter
@@ -60,10 +60,10 @@ class GnuParallelLocalAdapter(QueueContextAdapter):
60
60
  job_name: str,
61
61
  job_dir: Path,
62
62
  yaml_config_path: Path,
63
- elements: List[Union[str, Tuple]],
63
+ elements: list[Union[str, tuple]],
64
64
  pre_run: Optional[str] = None,
65
65
  pre_collect: Optional[str] = None,
66
- env: Optional[Dict[str, str]] = None,
66
+ env: Optional[dict[str, str]] = None,
67
67
  verbose: str = "info",
68
68
  submit: bool = False,
69
69
  ) -> None:
@@ -86,7 +86,7 @@ class GnuParallelLocalAdapter(QueueContextAdapter):
86
86
  self._run_joblog_path = self._job_dir / f"run_{self._job_name}_joblog"
87
87
  self._elements_file_path = self._job_dir / "elements"
88
88
 
89
- def _check_env(self, env: Optional[Dict[str, str]]) -> None:
89
+ def _check_env(self, env: Optional[dict[str, str]]) -> None:
90
90
  """Check value of env parameter on init.
91
91
 
92
92
  Parameters
@@ -6,7 +6,7 @@
6
6
  import shutil
7
7
  import textwrap
8
8
  from pathlib import Path
9
- from typing import Dict, List, Optional, Tuple, Union
9
+ from typing import Optional, Union
10
10
 
11
11
  from ...utils import logger, make_executable, raise_error, run_ext_cmd
12
12
  from .queue_context_adapter import QueueContextAdapter
@@ -78,10 +78,10 @@ class HTCondorAdapter(QueueContextAdapter):
78
78
  job_name: str,
79
79
  job_dir: Path,
80
80
  yaml_config_path: Path,
81
- elements: List[Union[str, Tuple]],
81
+ elements: list[Union[str, tuple]],
82
82
  pre_run: Optional[str] = None,
83
83
  pre_collect: Optional[str] = None,
84
- env: Optional[Dict[str, str]] = None,
84
+ env: Optional[dict[str, str]] = None,
85
85
  verbose: str = "info",
86
86
  cpus: int = 1,
87
87
  mem: str = "8G",
@@ -115,7 +115,7 @@ class HTCondorAdapter(QueueContextAdapter):
115
115
  )
116
116
  self._dag_path = self._job_dir / f"{self._job_name}.dag"
117
117
 
118
- def _check_env(self, env: Optional[Dict[str, str]]) -> None:
118
+ def _check_env(self, env: Optional[dict[str, str]]) -> None:
119
119
  """Check value of env parameter on init.
120
120
 
121
121
  Parameters
@@ -5,7 +5,7 @@
5
5
 
6
6
  import logging
7
7
  from pathlib import Path
8
- from typing import Dict, List, Optional, Tuple, Union
8
+ from typing import Optional, Union
9
9
 
10
10
  import pytest
11
11
 
@@ -44,7 +44,7 @@ def test_GnuParallelLocalAdapter_env_shell_error() -> None:
44
44
  ],
45
45
  )
46
46
  def test_GnuParallelLocalAdapter_elements(
47
- elements: List[Union[str, Tuple]],
47
+ elements: list[Union[str, tuple]],
48
48
  expected_text: str,
49
49
  ) -> None:
50
50
  """Test GnuParallelLocalAdapter elements().
@@ -177,7 +177,7 @@ def test_GnuParallelLocalAdapter_prepare(
177
177
  tmp_path: Path,
178
178
  monkeypatch: pytest.MonkeyPatch,
179
179
  caplog: pytest.LogCaptureFixture,
180
- env: Dict[str, str],
180
+ env: dict[str, str],
181
181
  ) -> None:
182
182
  """Test GnuParallelLocalAdapter prepare().
183
183
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import logging
7
7
  from pathlib import Path
8
- from typing import Dict, List, Optional, Tuple, Union
8
+ from typing import Optional, Union
9
9
 
10
10
  import pytest
11
11
 
@@ -181,7 +181,7 @@ def test_HTCondorAdapter_run_collect(
181
181
  ],
182
182
  )
183
183
  def test_HTCondor_dag(
184
- elements: List[Union[str, Tuple]], collect: str, expected_text: str
184
+ elements: list[Union[str, tuple]], collect: str, expected_text: str
185
185
  ) -> None:
186
186
  """Test HTCondorAdapter dag().
187
187
 
@@ -218,7 +218,7 @@ def test_HTCondorAdapter_prepare(
218
218
  tmp_path: Path,
219
219
  monkeypatch: pytest.MonkeyPatch,
220
220
  caplog: pytest.LogCaptureFixture,
221
- env: Dict[str, str],
221
+ env: dict[str, str],
222
222
  ) -> None:
223
223
  """Test HTCondorAdapter prepare().
224
224
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  import logging
9
9
  from pathlib import Path
10
- from typing import Dict, List, Optional, Tuple, Union
10
+ from typing import Optional, Union
11
11
 
12
12
  import pytest
13
13
  from ruamel.yaml import YAML
@@ -26,7 +26,7 @@ yaml.indent(mapping=2, sequence=4, offset=2)
26
26
 
27
27
 
28
28
  @pytest.fixture
29
- def datagrabber() -> Dict[str, str]:
29
+ def datagrabber() -> dict[str, str]:
30
30
  """Return a datagrabber as a dictionary."""
31
31
  return {
32
32
  "kind": "PartlyCloudyTestingDataGrabber",
@@ -34,7 +34,7 @@ def datagrabber() -> Dict[str, str]:
34
34
 
35
35
 
36
36
  @pytest.fixture
37
- def markers() -> List[Dict[str, str]]:
37
+ def markers() -> list[dict[str, str]]:
38
38
  """Return markers as a list of dictionary."""
39
39
  return [
40
40
  {
@@ -53,7 +53,7 @@ def markers() -> List[Dict[str, str]]:
53
53
 
54
54
 
55
55
  @pytest.fixture
56
- def storage() -> Dict[str, str]:
56
+ def storage() -> dict[str, str]:
57
57
  """Return a storage as a dictionary."""
58
58
  return {
59
59
  "kind": "SQLiteFeatureStorage",
@@ -62,9 +62,9 @@ def storage() -> Dict[str, str]:
62
62
 
63
63
  def test_run_single_element(
64
64
  tmp_path: Path,
65
- datagrabber: Dict[str, str],
66
- markers: List[Dict[str, str]],
67
- storage: Dict[str, str],
65
+ datagrabber: dict[str, str],
66
+ markers: list[dict[str, str]],
67
+ storage: dict[str, str],
68
68
  ) -> None:
69
69
  """Test run function with single element.
70
70
 
@@ -97,8 +97,8 @@ def test_run_single_element(
97
97
 
98
98
  def test_run_single_element_with_preprocessing(
99
99
  tmp_path: Path,
100
- markers: List[Dict[str, str]],
101
- storage: Dict[str, str],
100
+ markers: list[dict[str, str]],
101
+ storage: dict[str, str],
102
102
  ) -> None:
103
103
  """Test run function with single element and pre-processing.
104
104
 
@@ -137,9 +137,9 @@ def test_run_single_element_with_preprocessing(
137
137
 
138
138
  def test_run_multi_element_multi_output(
139
139
  tmp_path: Path,
140
- datagrabber: Dict[str, str],
141
- markers: List[Dict[str, str]],
142
- storage: Dict[str, str],
140
+ datagrabber: dict[str, str],
141
+ markers: list[dict[str, str]],
142
+ storage: dict[str, str],
143
143
  ) -> None:
144
144
  """Test run function with multi element and multi output.
145
145
 
@@ -173,9 +173,9 @@ def test_run_multi_element_multi_output(
173
173
 
174
174
  def test_run_multi_element_single_output(
175
175
  tmp_path: Path,
176
- datagrabber: Dict[str, str],
177
- markers: List[Dict[str, str]],
178
- storage: Dict[str, str],
176
+ datagrabber: dict[str, str],
177
+ markers: list[dict[str, str]],
178
+ storage: dict[str, str],
179
179
  ) -> None:
180
180
  """Test run function with multi element and single output.
181
181
 
@@ -210,9 +210,9 @@ def test_run_multi_element_single_output(
210
210
 
211
211
  def test_run_and_collect(
212
212
  tmp_path: Path,
213
- datagrabber: Dict[str, str],
214
- markers: List[Dict[str, str]],
215
- storage: Dict[str, str],
213
+ datagrabber: dict[str, str],
214
+ markers: list[dict[str, str]],
215
+ storage: dict[str, str],
216
216
  ) -> None:
217
217
  """Test run and collect functions.
218
218
 
@@ -259,9 +259,9 @@ def test_queue_correct_yaml_config(
259
259
  tmp_path: Path,
260
260
  monkeypatch: pytest.MonkeyPatch,
261
261
  caplog: pytest.LogCaptureFixture,
262
- datagrabber: Dict[str, str],
263
- markers: List[Dict[str, str]],
264
- storage: Dict[str, str],
262
+ datagrabber: dict[str, str],
263
+ markers: list[dict[str, str]],
264
+ storage: dict[str, str],
265
265
  ) -> None:
266
266
  """Test proper YAML config generation for queueing.
267
267
 
@@ -426,7 +426,7 @@ def test_queue_with_imports(
426
426
  tmp_path: Path,
427
427
  monkeypatch: pytest.MonkeyPatch,
428
428
  caplog: pytest.LogCaptureFixture,
429
- with_: Union[str, List[str]],
429
+ with_: Union[str, list[str]],
430
430
  ) -> None:
431
431
  """Test queue with `with` imports.
432
432
 
@@ -477,7 +477,7 @@ def test_queue_with_elements(
477
477
  tmp_path: Path,
478
478
  monkeypatch: pytest.MonkeyPatch,
479
479
  caplog: pytest.LogCaptureFixture,
480
- elements: Union[str, List[Union[str, Tuple[str]]], Tuple[str]],
480
+ elements: Union[str, list[Union[str, tuple[str]]], tuple[str]],
481
481
  ) -> None:
482
482
  """Test queue with elements.
483
483
 
@@ -508,7 +508,7 @@ def test_queue_without_elements(
508
508
  tmp_path: Path,
509
509
  monkeypatch: pytest.MonkeyPatch,
510
510
  caplog: pytest.LogCaptureFixture,
511
- datagrabber: Dict[str, str],
511
+ datagrabber: dict[str, str],
512
512
  ) -> None:
513
513
  """Test queue without elements.
514
514
 
@@ -536,9 +536,9 @@ def test_queue_without_elements(
536
536
 
537
537
  def test_reset_run(
538
538
  tmp_path: Path,
539
- datagrabber: Dict[str, str],
540
- markers: List[Dict[str, str]],
541
- storage: Dict[str, str],
539
+ datagrabber: dict[str, str],
540
+ markers: list[dict[str, str]],
541
+ storage: dict[str, str],
542
542
  ) -> None:
543
543
  """Test reset function for run.
544
544
 
@@ -580,9 +580,9 @@ def test_reset_run(
580
580
  def test_reset_queue(
581
581
  tmp_path: Path,
582
582
  monkeypatch: pytest.MonkeyPatch,
583
- datagrabber: Dict[str, str],
584
- markers: List[Dict[str, str]],
585
- storage: Dict[str, str],
583
+ datagrabber: dict[str, str],
584
+ markers: list[dict[str, str]],
585
+ storage: dict[str, str],
586
586
  job_name: str,
587
587
  ) -> None:
588
588
  """Test reset function for queue.
@@ -647,8 +647,8 @@ def test_reset_queue(
647
647
  ],
648
648
  )
649
649
  def test_list_elements(
650
- datagrabber: Dict[str, str],
651
- elements: Optional[List[str]],
650
+ datagrabber: dict[str, str],
651
+ elements: Optional[list[str]],
652
652
  ) -> None:
653
653
  """Test elements listing.
654
654
 
junifer/cli/cli.py CHANGED
@@ -8,7 +8,7 @@ import pathlib
8
8
  import subprocess
9
9
  import sys
10
10
  from pathlib import Path
11
- from typing import Optional, Tuple, Union
11
+ from typing import Optional, Union
12
12
 
13
13
  import click
14
14
 
@@ -106,7 +106,7 @@ def cli() -> None: # pragma: no cover
106
106
  default="info",
107
107
  )
108
108
  def run(
109
- filepath: click.Path, element: Tuple[str], verbose: Union[str, int]
109
+ filepath: click.Path, element: tuple[str], verbose: Union[str, int]
110
110
  ) -> None:
111
111
  """Run feature extraction.
112
112
 
@@ -395,7 +395,7 @@ def reset(
395
395
  )
396
396
  def list_elements(
397
397
  filepath: click.Path,
398
- element: Tuple[str],
398
+ element: tuple[str],
399
399
  output_file: Optional[click.Path],
400
400
  verbose: Union[str, int],
401
401
  ) -> None:
junifer/cli/parser.py CHANGED
@@ -8,7 +8,7 @@ import importlib
8
8
  import importlib.util
9
9
  import sys
10
10
  from pathlib import Path
11
- from typing import Dict, List, Tuple, Union
11
+ from typing import Union
12
12
 
13
13
  import pandas as pd
14
14
 
@@ -18,7 +18,7 @@ from ..utils import logger, raise_error, warn_with_log, yaml
18
18
  __all__ = ["parse_yaml", "parse_elements"]
19
19
 
20
20
 
21
- def parse_yaml(filepath: Union[str, Path]) -> Dict: # noqa: C901
21
+ def parse_yaml(filepath: Union[str, Path]) -> dict: # noqa: C901
22
22
  """Parse YAML.
23
23
 
24
24
  Parameters
@@ -140,7 +140,7 @@ def parse_yaml(filepath: Union[str, Path]) -> Dict: # noqa: C901
140
140
  return contents
141
141
 
142
142
 
143
- def parse_elements(element: Tuple[str], config: Dict) -> Union[List, None]:
143
+ def parse_elements(element: tuple[str], config: dict) -> Union[list, None]:
144
144
  """Parse elements from cli.
145
145
 
146
146
  Parameters
@@ -201,7 +201,7 @@ def parse_elements(element: Tuple[str], config: Dict) -> Union[List, None]:
201
201
  return elements
202
202
 
203
203
 
204
- def _parse_elements_file(filepath: Path) -> List[Tuple[str, ...]]:
204
+ def _parse_elements_file(filepath: Path) -> list[tuple[str, ...]]:
205
205
  """Parse elements from file.
206
206
 
207
207
  Parameters
@@ -5,7 +5,7 @@
5
5
  # License: AGPL
6
6
 
7
7
  from pathlib import Path
8
- from typing import Callable, List, Tuple
8
+ from typing import Callable
9
9
 
10
10
  import pytest
11
11
  from click.testing import CliRunner
@@ -42,7 +42,7 @@ runner = CliRunner()
42
42
  ],
43
43
  )
44
44
  def test_run_and_collect_commands(
45
- tmp_path: Path, elements: Tuple[str, ...]
45
+ tmp_path: Path, elements: tuple[str, ...]
46
46
  ) -> None:
47
47
  """Test run and collect commands.
48
48
 
@@ -175,7 +175,7 @@ def test_run_using_element_file(tmp_path: Path, elements: str) -> None:
175
175
  ],
176
176
  )
177
177
  def test_multi_element_access(
178
- tmp_path: Path, elements: str, expected_list: List[Tuple[str, ...]]
178
+ tmp_path: Path, elements: str, expected_list: list[tuple[str, ...]]
179
179
  ) -> None:
180
180
  """Test mulit-element parsing.
181
181
 
@@ -306,7 +306,7 @@ def test_reset(
306
306
  ],
307
307
  )
308
308
  def test_list_elements_stdout(
309
- elements: Tuple[str, ...],
309
+ elements: tuple[str, ...],
310
310
  ) -> None:
311
311
  """Test elements listing to stdout.
312
312
 
@@ -344,7 +344,7 @@ def test_list_elements_stdout(
344
344
  )
345
345
  def test_list_elements_output_file(
346
346
  tmp_path: Path,
347
- elements: Tuple[str, ...],
347
+ elements: tuple[str, ...],
348
348
  ) -> None:
349
349
  """Test elements listing to output file.
350
350
 
junifer/cli/utils.py CHANGED
@@ -7,13 +7,12 @@ import os
7
7
  import platform as pl
8
8
  import re
9
9
  from importlib.metadata import distribution
10
- from typing import Dict
11
10
 
12
11
  from .._version import __version__
13
12
  from ..utils.logging import get_versions
14
13
 
15
14
 
16
- def _get_junifer_version() -> Dict[str, str]:
15
+ def _get_junifer_version() -> dict[str, str]:
17
16
  """Get junifer version information.
18
17
 
19
18
  Returns
@@ -27,7 +26,7 @@ def _get_junifer_version() -> Dict[str, str]:
27
26
  }
28
27
 
29
28
 
30
- def _get_python_information() -> Dict[str, str]:
29
+ def _get_python_information() -> dict[str, str]:
31
30
  """Get installed Python information.
32
31
 
33
32
  Parameters
@@ -42,7 +41,7 @@ def _get_python_information() -> Dict[str, str]:
42
41
  }
43
42
 
44
43
 
45
- def _get_dependency_information(long_: bool) -> Dict[str, str]:
44
+ def _get_dependency_information(long_: bool) -> dict[str, str]:
46
45
  """Get Python environment dependency information.
47
46
 
48
47
  Parameters
@@ -87,7 +86,7 @@ def _get_dependency_information(long_: bool) -> Dict[str, str]:
87
86
  return pruned_dependency_versions
88
87
 
89
88
 
90
- def _get_system_information() -> Dict[str, str]:
89
+ def _get_system_information() -> dict[str, str]:
91
90
  """Get system information.
92
91
 
93
92
  Returns
@@ -101,7 +100,7 @@ def _get_system_information() -> Dict[str, str]:
101
100
  }
102
101
 
103
102
 
104
- def _get_environment_information(long_: bool) -> Dict[str, str]:
103
+ def _get_environment_information(long_: bool) -> dict[str, str]:
105
104
  """Get system environment information.
106
105
 
107
106
  Parameters
@@ -6,7 +6,7 @@
6
6
  # License: AGPL
7
7
 
8
8
  from pathlib import Path
9
- from typing import List, Union
9
+ from typing import Union
10
10
 
11
11
  from ....api.decorators import register_datagrabber
12
12
  from ....datagrabber import PatternDataladDataGrabber
@@ -37,7 +37,7 @@ class JuselessDataladIXIVBM(PatternDataladDataGrabber):
37
37
  def __init__(
38
38
  self,
39
39
  datadir: Union[str, Path, None] = None,
40
- sites: Union[str, List[str], None] = None,
40
+ sites: Union[str, list[str], None] = None,
41
41
  ) -> None:
42
42
  uri = (
43
43
  "ria+http://cat_12.5.ds.inm7.de"
@@ -6,7 +6,7 @@
6
6
  # License: AGPL
7
7
 
8
8
  import socket
9
- from typing import List, Optional, Union
9
+ from typing import Optional, Union
10
10
 
11
11
  import pytest
12
12
 
@@ -53,7 +53,7 @@ def test_JuselessUCLA() -> None:
53
53
  ],
54
54
  )
55
55
  def test_JuselessUCLA_partial_data_access(
56
- types: Union[str, List[str]],
56
+ types: Union[str, list[str]],
57
57
  ) -> None:
58
58
  """Test JuselessUCLA DataGrabber partial data access.
59
59
 
@@ -5,7 +5,7 @@
5
5
  # License: AGPL
6
6
 
7
7
  from pathlib import Path
8
- from typing import List, Union
8
+ from typing import Union
9
9
 
10
10
  from ....api.decorators import register_datagrabber
11
11
  from ....datagrabber import PatternDataGrabber
@@ -43,8 +43,8 @@ class JuselessUCLA(PatternDataGrabber):
43
43
  datadir: Union[
44
44
  str, Path
45
45
  ] = "/data/project/psychosis_thalamus/data/fmriprep",
46
- types: Union[str, List[str], None] = None,
47
- tasks: Union[str, List[str], None] = None,
46
+ types: Union[str, list[str], None] = None,
47
+ tasks: Union[str, list[str], None] = None,
48
48
  ) -> None:
49
49
  # Declare all tasks
50
50
  all_tasks = [
@@ -136,7 +136,7 @@ class JuselessUCLA(PatternDataGrabber):
136
136
  confounds_format="fmriprep",
137
137
  )
138
138
 
139
- def get_elements(self) -> List:
139
+ def get_elements(self) -> list:
140
140
  """Implement fetching list of elements in the dataset.
141
141
 
142
142
  Returns