junifer 0.0.4.dev470__py3-none-any.whl → 0.0.4.dev486__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.
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.4.dev470'
16
- __version_tuple__ = version_tuple = (0, 0, 4, 'dev470')
15
+ __version__ = version = '0.0.4.dev486'
16
+ __version_tuple__ = version_tuple = (0, 0, 4, 'dev486')
@@ -35,6 +35,7 @@ def test_get_dependency_information_short() -> None:
35
35
  assert list(dependency_information.keys()) == [
36
36
  "click",
37
37
  "numpy",
38
+ "scipy",
38
39
  "datalad",
39
40
  "pandas",
40
41
  "nibabel",
@@ -51,6 +52,7 @@ def test_get_dependency_information_long() -> None:
51
52
  for key in [
52
53
  "click",
53
54
  "numpy",
55
+ "scipy",
54
56
  "datalad",
55
57
  "pandas",
56
58
  "nibabel",
junifer/stats.py CHANGED
@@ -7,7 +7,7 @@
7
7
  from typing import Any, Callable, Dict, List, Optional
8
8
 
9
9
  import numpy as np
10
- from scipy.stats import trim_mean
10
+ from scipy.stats import mode, trim_mean
11
11
  from scipy.stats.mstats import winsorize
12
12
 
13
13
  from .utils import logger, raise_error
@@ -24,10 +24,11 @@ def get_aggfunc_by_name(
24
24
  Name to identify the function. Currently supported names and
25
25
  corresponding functions are:
26
26
 
27
- * ``winsorized_mean`` -> :func:`scipy.stats.mstats.winsorize`
28
27
  * ``mean`` -> :func:`numpy.mean`
29
- * ``std`` -> :func:`numpy.std`
28
+ * ``winsorized_mean`` -> :func:`scipy.stats.mstats.winsorize`
30
29
  * ``trim_mean`` -> :func:`scipy.stats.trim_mean`
30
+ * ``mode`` -> :func:`scipy.stats.mode`
31
+ * ``std`` -> :func:`numpy.std`
31
32
  * ``count`` -> :func:`.count`
32
33
  * ``select`` -> :func:`.select`
33
34
 
@@ -40,6 +41,7 @@ def get_aggfunc_by_name(
40
41
  -------
41
42
  function
42
43
  Respective function with ``func_params`` parameter set.
44
+
43
45
  """
44
46
  from functools import partial # local import to avoid sphinx error
45
47
 
@@ -51,6 +53,7 @@ def get_aggfunc_by_name(
51
53
  "trim_mean",
52
54
  "count",
53
55
  "select",
56
+ "mode",
54
57
  }
55
58
  if func_params is None:
56
59
  func_params = {}
@@ -93,6 +96,8 @@ def get_aggfunc_by_name(
93
96
  elif pick is not None and drop is not None:
94
97
  raise_error("Either pick or drop must be specified, not both.")
95
98
  func = partial(select, **func_params)
99
+ elif name == "mode":
100
+ func = partial(mode, **func_params)
96
101
  else:
97
102
  raise_error(
98
103
  f"Function {name} unknown. Please provide any of "
@@ -115,6 +120,7 @@ def count(data: np.ndarray, axis: int = 0) -> np.ndarray:
115
120
  -------
116
121
  numpy.ndarray
117
122
  Number of elements along the given axis.
123
+
118
124
  """
119
125
  ax_size = data.shape[axis]
120
126
  if axis < 0:
@@ -137,7 +143,7 @@ def winsorized_mean(
137
143
  The axis to calculate winsorized mean on (default None).
138
144
  **win_params : dict
139
145
  Dictionary containing the keyword arguments for the winsorize function.
140
- E.g. ``{'limits': [0.1, 0.1]}``.
146
+ E.g., ``{'limits': [0.1, 0.1]}``.
141
147
 
142
148
  Returns
143
149
  -------
@@ -149,6 +155,7 @@ def winsorized_mean(
149
155
  --------
150
156
  scipy.stats.mstats.winsorize :
151
157
  The winsorize function used in this function.
158
+
152
159
  """
153
160
  win_dat = winsorize(data, axis=axis, **win_params)
154
161
  win_mean = win_dat.mean(axis=axis)
@@ -180,6 +187,13 @@ def select(
180
187
  numpy.ndarray
181
188
  Subset of the inputted data with the select settings
182
189
  applied as specified in ``select_params``.
190
+
191
+ Raises
192
+ ------
193
+ ValueError
194
+ If both ``pick`` and ``drop`` are None or
195
+ if both ``pick`` and ``drop`` are not None.
196
+
183
197
  """
184
198
 
185
199
  if pick is None and drop is None:
@@ -21,6 +21,8 @@ from junifer.stats import count, get_aggfunc_by_name, select, winsorized_mean
21
21
  ("count", None),
22
22
  ("trim_mean", None),
23
23
  ("trim_mean", {"proportiontocut": 0.1}),
24
+ ("mode", None),
25
+ ("mode", {"keepdims": True}),
24
26
  ],
25
27
  )
26
28
  def test_get_aggfunc_by_name(name: str, params: Optional[Dict]) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: junifer
3
- Version: 0.0.4.dev470
3
+ Version: 0.0.4.dev486
4
4
  Summary: JUelich NeuroImaging FEature extractoR
5
5
  Author-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
6
6
  Maintainer-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
@@ -28,6 +28,7 @@ License-File: LICENSE.md
28
28
  License-File: AUTHORS.rst
29
29
  Requires-Dist: click <8.2,>=8.1.3
30
30
  Requires-Dist: numpy <1.27,>=1.24
31
+ Requires-Dist: scipy <=1.11.4,>=1.9.0
31
32
  Requires-Dist: datalad <0.20,>=0.15.4
32
33
  Requires-Dist: pandas <2.2,>=1.4.0
33
34
  Requires-Dist: nibabel <5.11,>=3.2.0
@@ -73,6 +74,7 @@ Requires-Dist: bctpy ==0.6.0 ; extra == 'onthefly'
73
74
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)
74
75
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
75
76
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8176570.svg)](https://doi.org/10.5281/zenodo.8176570)
77
+ [![FAIR checklist badge](https://fairsoftwarechecklist.net/badge.svg)](https://fairsoftwarechecklist.net/v0.2?f=31&a=32113&i=32322&r=133)
76
78
 
77
79
  ## About
78
80
 
@@ -1,6 +1,6 @@
1
1
  junifer/__init__.py,sha256=x1UR2jUcrUdm2HNl-3Qvyi4UUrU6ms5qm2qcmNY7zZk,391
2
- junifer/_version.py,sha256=Wu_9wPF0C0cdTEJU3W3loFCJJ35cMzaMdMzBYdl3sGs,428
3
- junifer/stats.py,sha256=KUX4jJcLWnlE34coet8EkdFypFd-td4Vtpx5LvlomVs,5879
2
+ junifer/_version.py,sha256=pv1IAbgY-EBbr6jHiL5xztxQVxFC_WUrz9qFu8tmPHY,428
3
+ junifer/stats.py,sha256=sU5IZ2qFZWbzgSutQS_z42miIVItpSGmQYBn6KkD5fA,6162
4
4
  junifer/api/__init__.py,sha256=YILu9M7SC0Ri4CVd90fELH2OnK_gvCYAXCoqBNCFE8E,257
5
5
  junifer/api/cli.py,sha256=xScav2mF-Jr8JjVFt8kaHuLpX5l_jVTaQGPgQL3VNvA,12881
6
6
  junifer/api/decorators.py,sha256=8bnwHPAe7VgzKxl--M_e0umdAlTVSzaJQHEJZ5kof5k,2580
@@ -21,7 +21,7 @@ junifer/api/res/fsl/flirt,sha256=tSjiUco8ui8AbHD7mTzChEwbR0Rf_4iJTgzYTPF_WuQ,42
21
21
  junifer/api/res/fsl/img2imgcoord,sha256=Zmaw3oJYrEltcXiPyEubXry9ppAq3SND52tdDWGgeZk,49
22
22
  junifer/api/res/fsl/run_fsl_docker.sh,sha256=mRLtZo0OgDwleoee2MG6rYI37HVuGNk9zOADwcl97RA,1122
23
23
  junifer/api/res/fsl/std2imgcoord,sha256=-X5wRH6XMl0yqnTACJX6MFhO8DFOEWg42MHRxGvimXg,49
24
- junifer/api/tests/test_api_utils.py,sha256=_ykEECJN0qTEBcJ2YSvOAQrRN-xmEilRLPyirC5cO_o,2285
24
+ junifer/api/tests/test_api_utils.py,sha256=dexkg5U8JSo3wEU6EUIWnPNuVzHxRMXH1o2sBchMEu0,2319
25
25
  junifer/api/tests/test_cli.py,sha256=qKWkAf-A1DeDwCtrOaCrQ5bmuUYcLWeRbGk2K95OMHQ,5717
26
26
  junifer/api/tests/test_functions.py,sha256=0XHxCC7-jfVqV7m-R-eGiEwZPjEoBzdS0zperVIyNow,24659
27
27
  junifer/api/tests/test_parser.py,sha256=eUz2JPVb0_cxvoeI1O_C5PMNs5v_lDzGsN6fV1VW5Eg,6109
@@ -220,16 +220,16 @@ junifer/testing/tests/test_partlycloudytesting_datagrabber.py,sha256=1VY71RhGtLD
220
220
  junifer/testing/tests/test_spmauditory_datagrabber.py,sha256=1G1emk-Ze59HiNLaYsyIz5O1YGW9darcqlzvhE-J_Mc,919
221
221
  junifer/testing/tests/test_testing_registry.py,sha256=oerticBaPRaRZm3yANzInLac0Mqph3Y0aZPQFayu7xA,827
222
222
  junifer/tests/test_main.py,sha256=GMff7jlisGM9_FsiUwWDte43j-KQJGFRYZpwRRqTkd8,373
223
- junifer/tests/test_stats.py,sha256=u3bLjbshzc5fV207tLM79rR5vHDvNhdN7ZoYI1UTI04,4093
223
+ junifer/tests/test_stats.py,sha256=3vPMgYYpWxk8ECDFOMm3-dFBlh4XxjL83SwRBSBAHok,4155
224
224
  junifer/utils/__init__.py,sha256=ZDPU9ezSKawAJhb-3T67jDf-16QEyF6e7ONyu-lnBtQ,277
225
225
  junifer/utils/fs.py,sha256=Jd9AoV2fIF7pT7KhXsn8T1O1fJ1_SFZgaFuOBAM7DG8,460
226
226
  junifer/utils/logging.py,sha256=4kH8j9X_J2bMdnBJMldVF95C5sURa5UAsLmSgRaD9Ig,9117
227
227
  junifer/utils/tests/test_fs.py,sha256=WQS7cKlKEZ742CIuiOYYpueeAhY9PqlastfDVpVVtvE,923
228
228
  junifer/utils/tests/test_logging.py,sha256=l8oo-AiBV7H6_IzlsNcj__cLeZBUvgIGoaMszD9VaJg,7754
229
- junifer-0.0.4.dev470.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
230
- junifer-0.0.4.dev470.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
231
- junifer-0.0.4.dev470.dist-info/METADATA,sha256=hzW62alyqZpUv2XNvH1CVzkvq1-dyfvGsmCRiN3fS-g,7569
232
- junifer-0.0.4.dev470.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
233
- junifer-0.0.4.dev470.dist-info/entry_points.txt,sha256=DxFvKq0pOqRunAK0FxwJcoDfV1-dZvsFDpD5HRqSDhw,48
234
- junifer-0.0.4.dev470.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
235
- junifer-0.0.4.dev470.dist-info/RECORD,,
229
+ junifer-0.0.4.dev486.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
230
+ junifer-0.0.4.dev486.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
231
+ junifer-0.0.4.dev486.dist-info/METADATA,sha256=QVPItWF_irR7t8uq9u1SSTqfXWcxzKv__LpOf8qrk9c,7745
232
+ junifer-0.0.4.dev486.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
233
+ junifer-0.0.4.dev486.dist-info/entry_points.txt,sha256=DxFvKq0pOqRunAK0FxwJcoDfV1-dZvsFDpD5HRqSDhw,48
234
+ junifer-0.0.4.dev486.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
235
+ junifer-0.0.4.dev486.dist-info/RECORD,,