templateflow 24.2.2__tar.gz → 25.0.1__tar.gz

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 (51) hide show
  1. {templateflow-24.2.2 → templateflow-25.0.1}/.circleci/config.yml +25 -27
  2. {templateflow-24.2.2 → templateflow-25.0.1}/.github/workflows/pythonpackage.yml +1 -1
  3. {templateflow-24.2.2 → templateflow-25.0.1}/CHANGES.rst +11 -0
  4. {templateflow-24.2.2 → templateflow-25.0.1}/PKG-INFO +6 -6
  5. {templateflow-24.2.2 → templateflow-25.0.1}/docs/conf.py +1 -2
  6. {templateflow-24.2.2 → templateflow-25.0.1}/pyproject.toml +3 -3
  7. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/_version.py +9 -4
  8. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/api.py +3 -7
  9. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/cli.py +4 -2
  10. templateflow-25.0.1/templateflow/conf/templateflow-skel.md5 +1 -0
  11. templateflow-25.0.1/templateflow/conf/templateflow-skel.zip +0 -0
  12. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/test_api.py +3 -3
  13. templateflow-25.0.1/templateflow/tests/test_cli.py +69 -0
  14. templateflow-24.2.2/templateflow/conf/templateflow-skel.md5 +0 -1
  15. templateflow-24.2.2/templateflow/conf/templateflow-skel.zip +0 -0
  16. {templateflow-24.2.2 → templateflow-25.0.1}/.gitattributes +0 -0
  17. {templateflow-24.2.2 → templateflow-25.0.1}/.github/workflows/codespell.yml +0 -0
  18. {templateflow-24.2.2 → templateflow-25.0.1}/.gitignore +0 -0
  19. {templateflow-24.2.2 → templateflow-25.0.1}/.gitmodules +0 -0
  20. {templateflow-24.2.2 → templateflow-25.0.1}/.maint/update_changes.sh +0 -0
  21. {templateflow-24.2.2 → templateflow-25.0.1}/.maint/update_requirements.py +0 -0
  22. {templateflow-24.2.2 → templateflow-25.0.1}/.neurodebian/neurodebian.gpg +0 -0
  23. {templateflow-24.2.2 → templateflow-25.0.1}/.zenodo.json +0 -0
  24. {templateflow-24.2.2 → templateflow-25.0.1}/LICENSE +0 -0
  25. {templateflow-24.2.2 → templateflow-25.0.1}/README.rst +0 -0
  26. {templateflow-24.2.2 → templateflow-25.0.1}/codecov.yml +0 -0
  27. {templateflow-24.2.2 → templateflow-25.0.1}/docs/Makefile +0 -0
  28. {templateflow-24.2.2 → templateflow-25.0.1}/docs/_static/RTD-advanced-conf.png +0 -0
  29. {templateflow-24.2.2 → templateflow-25.0.1}/docs/_static/git.png +0 -0
  30. {templateflow-24.2.2 → templateflow-25.0.1}/docs/_templates/versions.html +0 -0
  31. {templateflow-24.2.2 → templateflow-25.0.1}/docs/api.rst +0 -0
  32. {templateflow-24.2.2 → templateflow-25.0.1}/docs/changes.rst +0 -0
  33. {templateflow-24.2.2 → templateflow-25.0.1}/docs/cli.rst +0 -0
  34. {templateflow-24.2.2 → templateflow-25.0.1}/docs/datalad.rst +0 -0
  35. {templateflow-24.2.2 → templateflow-25.0.1}/docs/environment.yml +0 -0
  36. {templateflow-24.2.2 → templateflow-25.0.1}/docs/examples.rst +0 -0
  37. {templateflow-24.2.2 → templateflow-25.0.1}/docs/index.rst +0 -0
  38. {templateflow-24.2.2 → templateflow-25.0.1}/docs/installation.rst +0 -0
  39. {templateflow-24.2.2 → templateflow-25.0.1}/docs/links.rst +0 -0
  40. {templateflow-24.2.2 → templateflow-25.0.1}/docs/reference/.gitignore +0 -0
  41. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/__init__.py +0 -0
  42. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/_loader.py +0 -0
  43. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/conf/__init__.py +0 -0
  44. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/conf/_s3.py +0 -0
  45. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/conf/bids.py +0 -0
  46. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/conf/config.json +0 -0
  47. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/__init__.py +0 -0
  48. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/test_conf.py +0 -0
  49. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/test_multiproc.py +0 -0
  50. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/test_s3.py +0 -0
  51. {templateflow-24.2.2 → templateflow-25.0.1}/templateflow/tests/test_version.py +0 -0
@@ -8,7 +8,7 @@ jobs:
8
8
  build:
9
9
  executor:
10
10
  name: python/default
11
- tag: '3.12'
11
+ tag: '3.13'
12
12
 
13
13
  # docker:
14
14
  # - auth:
@@ -38,7 +38,7 @@ jobs:
38
38
  deploy_pypi:
39
39
  executor:
40
40
  name: python/default
41
- tag: '3.12'
41
+ tag: '3.13'
42
42
 
43
43
  # docker:
44
44
  # - auth:
@@ -60,7 +60,7 @@ jobs:
60
60
  tests:
61
61
  executor:
62
62
  name: python/default
63
- tag: '3.12'
63
+ tag: '3.13'
64
64
 
65
65
  # docker:
66
66
  # - auth:
@@ -70,37 +70,19 @@ jobs:
70
70
  environment:
71
71
  - OSF_MIRROR_PATH: /tmp/data/templateflow
72
72
  steps:
73
- - restore_cache:
74
- keys:
75
- - annex-v1-{{ epoch }}
76
- - annex-v1-
77
73
  - run:
78
- name: Install git and git-annex
74
+ name: Configure git
79
75
  command: |
80
- if [[ ! -e "/tmp/cache/git-annex-standalone.tar.gz" ]]; then
81
- wget -O- http://neuro.debian.net/lists/focal.us-ca.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
82
- sudo apt-key add .neurodebian/neurodebian.gpg
83
- sudo apt-key adv --recv-keys --keyserver hkps://keys.openpgp.org 0xA5D32F012649A5A9 || true
84
- sudo apt update && sudo apt-get install -y --no-install-recommends git-annex-standalone
85
- mkdir -p /tmp/cache
86
- tar czvf /tmp/cache/git-annex-standalone.tar.gz /usr/bin/git-annex /usr/bin/git-annex-shell /usr/lib/git-annex.linux
87
- else
88
- sudo tar xzfv /tmp/cache/git-annex-standalone.tar.gz -C /
89
- fi
90
76
  git config --global user.name "First Last"
91
77
  git config --global user.email "email@domain.com"
92
78
 
93
- - save_cache:
94
- key: annex-v1-{{ epoch }}
95
- paths:
96
- - "/tmp/cache"
97
-
98
79
  - attach_workspace:
99
80
  at: ~/project
100
81
 
101
82
  - run:
102
83
  command: |
103
84
  python .maint/update_requirements.py
85
+ echo git-annex >> dev-requirements.txt
104
86
  name: Generate requirements.txt
105
87
 
106
88
  - python/install-packages:
@@ -126,8 +108,14 @@ jobs:
126
108
  mkdir -p ~/tests/ ~/coverage/
127
109
  export TEMPLATEFLOW_USE_DATALAD=on
128
110
  python -m pytest \
129
- --junit-xml=~/tests/datalad.xml --cov templateflow --cov-report xml:~/coverage/cov_api_dl.xml \
130
- --doctest-modules templateflow/api.py
111
+ --junit-xml=~/tests/datalad.xml --cov templateflow --doctest-modules \
112
+ templateflow/api.py
113
+
114
+ coverage run --append -m templateflow.cli config
115
+ coverage run --append -m templateflow.cli ls MNI152NLin2009cAsym --suffix T1w
116
+ coverage run --append -m templateflow.cli get MNI152NLin2009cAsym --suffix mask
117
+ coverage run --append -m templateflow.cli update
118
+ coverage xml -o ~/coverage/cov_api_dl.xml
131
119
 
132
120
  - codecov/upload:
133
121
  file: ~/coverage/cov_api_dl.xml
@@ -140,8 +128,13 @@ jobs:
140
128
  export TEMPLATEFLOW_USE_DATALAD=off
141
129
  export TEMPLATEFLOW_HOME=$HOME/templateflow-s3
142
130
  python -m pytest \
143
- --junit-xml=~/tests/s3.xml --cov templateflow --cov-report xml:~/coverage/cov_api_s3.xml \
144
- --doctest-modules templateflow/api.py
131
+ --junit-xml=~/tests/s3.xml --cov templateflow --doctest-modules templateflow/api.py
132
+
133
+ coverage run --append -m templateflow.cli config
134
+ coverage run --append -m templateflow.cli ls MNI152NLin2009cAsym --suffix T1w
135
+ coverage run --append -m templateflow.cli get MNI152NLin2009cAsym --suffix mask
136
+ coverage run --append -m templateflow.cli update
137
+ coverage xml -o ~/coverage/cov_api_s3.xml
145
138
 
146
139
  - codecov/upload:
147
140
  file: ~/coverage/cov_api_s3.xml
@@ -273,6 +266,11 @@ workflows:
273
266
  only:
274
267
  - master
275
268
  jobs:
269
+ - build:
270
+ context:
271
+ - nipreps-common
276
272
  - tests:
277
273
  context:
278
274
  - nipreps-common
275
+ requires:
276
+ - build
@@ -63,7 +63,7 @@ jobs:
63
63
  needs: build
64
64
  strategy:
65
65
  matrix:
66
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
66
+ python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
67
67
  mode: ['wheel']
68
68
  include:
69
69
  - {python-version: '3.11', mode: 'repo'}
@@ -1,3 +1,14 @@
1
+ 25.0.1 (August 13, 2025)
2
+ ========================
3
+ Patch release containing fixes to transform names in two templates.
4
+
5
+ 25.0.0 (August 12, 2025)
6
+ ========================
7
+ Minor release including updated templates.
8
+
9
+ * FIX: Fix crash in templateflow get when matching one file (#140)
10
+ * MAINT: Update Python support, datalad and git-annex deps (#143)
11
+
1
12
  24.2.2 (September 14, 2024)
2
13
  ===========================
3
14
  Patch release containing one bugfix and updating the default skeleton.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: templateflow
3
- Version: 24.2.2
3
+ Version: 25.0.1
4
4
  Summary: TemplateFlow Python Client - TemplateFlow is the Zone of neuroimaging templates.
5
5
  Project-URL: Archive, https://github.com/templateflow/templateflow
6
6
  Project-URL: Bug Tracker, https://github.com/templateflow/python-client/issues
@@ -213,20 +213,20 @@ License-File: LICENSE
213
213
  Classifier: Development Status :: 3 - Alpha
214
214
  Classifier: Intended Audience :: Science/Research
215
215
  Classifier: License :: OSI Approved :: Apache Software License
216
- Classifier: Programming Language :: Python :: 3.8
217
216
  Classifier: Programming Language :: Python :: 3.9
218
217
  Classifier: Programming Language :: Python :: 3.10
219
218
  Classifier: Programming Language :: Python :: 3.11
220
219
  Classifier: Programming Language :: Python :: 3.12
220
+ Classifier: Programming Language :: Python :: 3.13
221
221
  Classifier: Topic :: Scientific/Engineering :: Image Recognition
222
- Requires-Python: >=3.8
222
+ Requires-Python: >=3.9
223
223
  Requires-Dist: importlib-resources>=5.7; python_version < '3.11'
224
224
  Requires-Dist: pybids>=0.15.2
225
225
  Requires-Dist: requests
226
226
  Requires-Dist: tqdm
227
227
  Provides-Extra: all
228
228
  Requires-Dist: coverage~=5.0.0; extra == 'all'
229
- Requires-Dist: datalad~=1.0.0; extra == 'all'
229
+ Requires-Dist: datalad>=1.0.0; extra == 'all'
230
230
  Requires-Dist: nbsphinx; extra == 'all'
231
231
  Requires-Dist: packaging; extra == 'all'
232
232
  Requires-Dist: pydot>=1.2.3; extra == 'all'
@@ -242,7 +242,7 @@ Requires-Dist: sphinxcontrib-apidoc; extra == 'all'
242
242
  Requires-Dist: sphinx~=4.0; extra == 'all'
243
243
  Requires-Dist: toml; extra == 'all'
244
244
  Provides-Extra: datalad
245
- Requires-Dist: datalad~=1.0.0; extra == 'datalad'
245
+ Requires-Dist: datalad>=1.0.0; extra == 'datalad'
246
246
  Provides-Extra: doc
247
247
  Requires-Dist: nbsphinx; extra == 'doc'
248
248
  Requires-Dist: packaging; extra == 'doc'
@@ -24,8 +24,7 @@ release = __version__
24
24
 
25
25
  # The short X.Y version
26
26
  version = (
27
- __version__ if Version(release).public == release
28
- else f"dev ({release.partition('+')[0]})"
27
+ __version__ if Version(release).public == release else f'dev ({release.partition("+")[0]})'
29
28
  )
30
29
 
31
30
  # -- General configuration ---------------------------------------------------
@@ -12,14 +12,14 @@ classifiers = [
12
12
  "Intended Audience :: Science/Research",
13
13
  "Topic :: Scientific/Engineering :: Image Recognition",
14
14
  "License :: OSI Approved :: Apache Software License",
15
- "Programming Language :: Python :: 3.8",
16
15
  "Programming Language :: Python :: 3.9",
17
16
  "Programming Language :: Python :: 3.10",
18
17
  "Programming Language :: Python :: 3.11",
19
18
  "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
20
  ]
21
21
  license = {file = "LICENSE"}
22
- requires-python = ">=3.8"
22
+ requires-python = ">=3.9"
23
23
  dependencies = [
24
24
  "pybids >= 0.15.2",
25
25
  "importlib_resources >= 5.7; python_version < '3.11'",
@@ -45,7 +45,7 @@ test = [
45
45
  "toml",
46
46
  ]
47
47
  datalad = [
48
- "datalad ~= 1.0.0"
48
+ "datalad >= 1.0.0"
49
49
  ]
50
50
  doc = [
51
51
  "nbsphinx",
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '24.2.2'
16
- __version_tuple__ = version_tuple = (24, 2, 2)
20
+ __version__ = version = '25.0.1'
21
+ __version_tuple__ = version_tuple = (25, 0, 1)
@@ -176,22 +176,18 @@ def get(template, raise_empty=False, **kwargs):
176
176
  if not_fetched:
177
177
  msg = 'Could not fetch template files: {}.'.format(', '.join(not_fetched))
178
178
  if dl_missing and not TF_USE_DATALAD:
179
- msg += (
180
- f"""\
179
+ msg += f"""\
181
180
  The $TEMPLATEFLOW_HOME folder {TF_LAYOUT.root} seems to contain an initiated DataLad \
182
181
  dataset, but the environment variable $TEMPLATEFLOW_USE_DATALAD is not \
183
182
  set or set to one of (false, off, 0). Please set $TEMPLATEFLOW_USE_DATALAD \
184
183
  on (possible values: true, on, 1)."""
185
- )
186
184
 
187
185
  if s3_missing and TF_USE_DATALAD:
188
- msg += (
189
- f"""\
186
+ msg += f"""\
190
187
  The $TEMPLATEFLOW_HOME folder {TF_LAYOUT.root} seems to contain an plain \
191
188
  dataset, but the environment variable $TEMPLATEFLOW_USE_DATALAD is \
192
189
  set to one of (true, on, 1). Please set $TEMPLATEFLOW_USE_DATALAD \
193
190
  off (possible values: false, off, 0)."""
194
- )
195
191
 
196
192
  raise RuntimeError(msg)
197
193
 
@@ -394,5 +390,5 @@ def _normalize_ext(value):
394
390
  return value
395
391
 
396
392
  if isinstance(value, str):
397
- return f"{'' if value.startswith('.') else '.'}{value}"
393
+ return f'{"" if value.startswith(".") else "."}{value}'
398
394
  return [_normalize_ext(v) for v in value]
@@ -61,7 +61,7 @@ def entity_opts():
61
61
  entities = json.loads(Path(load_data('conf/config.json')).read_text())['entities']
62
62
 
63
63
  args = [
64
- (f"--{e['name']}", *ENTITY_SHORTHANDS.get(e['name'], ()))
64
+ (f'--{e["name"]}', *ENTITY_SHORTHANDS.get(e['name'], ()))
65
65
  for e in entities
66
66
  if e['name'] not in ENTITY_EXCLUDE
67
67
  ]
@@ -141,7 +141,9 @@ def ls(template, **kwargs):
141
141
  def get(template, **kwargs):
142
142
  """Fetch the assets corresponding to template and optional filters."""
143
143
  entities = {k: _nulls(v) for k, v in kwargs.items() if v != ''}
144
- click.echo('\n'.join(f'{match}' for match in api.get(template, **entities)))
144
+ paths = api.get(template, **entities)
145
+ filenames = [str(paths)] if isinstance(paths, Path) else [str(file) for file in paths]
146
+ click.echo('\n'.join(filenames))
145
147
 
146
148
 
147
149
  if __name__ == '__main__':
@@ -0,0 +1 @@
1
+ 7e2dd937d76630809f5715172cf6a55f -
@@ -85,9 +85,9 @@ class Bibtex:
85
85
  assert self.citekey == other.citekey, 'Mismatched citekeys'
86
86
  for key in self.pairs.keys():
87
87
  assert key in other.pairs, f'Key ({key}) missing from other'
88
- assert (
89
- self.pairs[key] == other.pairs[key]
90
- ), f'Key ({key}) mismatched\n\n{self.pairs[key]}\n\n{other.pairs[key]}'
88
+ assert self.pairs[key] == other.pairs[key], (
89
+ f'Key ({key}) mismatched\n\n{self.pairs[key]}\n\n{other.pairs[key]}'
90
+ )
91
91
 
92
92
  for key in other.pairs.keys():
93
93
  assert key in self.pairs, f'Key ({key}) missing from pairs'
@@ -0,0 +1,69 @@
1
+ from pathlib import Path
2
+
3
+ import click.testing
4
+ import pytest
5
+
6
+ from .. import cli
7
+
8
+
9
+ @pytest.fixture
10
+ def runner():
11
+ return click.testing.CliRunner()
12
+
13
+
14
+ def test_ls_one(runner):
15
+ result = runner.invoke(cli.main, ['ls', 'MNI152Lin', '--res', '1', '-s', 'T1w'])
16
+
17
+ # One result
18
+ lines = result.stdout.strip().splitlines()
19
+ assert len(lines) == 1
20
+
21
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T1w.nii.gz' in lines[0]
22
+
23
+ path = Path(lines[0])
24
+
25
+ assert path.exists()
26
+
27
+
28
+ def test_ls_multi(runner):
29
+ result = runner.invoke(cli.main, ['ls', 'MNI152Lin', '--res', '1', '-s', 'T1w', '-s', 'T2w'])
30
+
31
+ # Two results
32
+ lines = result.stdout.strip().splitlines()
33
+ assert len(lines) == 2
34
+
35
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T1w.nii.gz' in lines[0]
36
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T2w.nii.gz' in lines[1]
37
+
38
+ paths = [Path(line) for line in lines]
39
+
40
+ assert all(path.exists() for path in paths)
41
+
42
+
43
+ def test_get_one(runner):
44
+ result = runner.invoke(cli.main, ['get', 'MNI152Lin', '--res', '1', '-s', 'T1w'])
45
+
46
+ # One result, possible download status before
47
+ lines = result.stdout.strip().splitlines()[-2:]
48
+
49
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T1w.nii.gz' in lines[0]
50
+
51
+ path = Path(lines[0])
52
+
53
+ stat_res = path.stat()
54
+ assert stat_res.st_size == 10669511
55
+
56
+
57
+ def test_get_multi(runner):
58
+ result = runner.invoke(cli.main, ['get', 'MNI152Lin', '--res', '1', '-s', 'T1w', '-s', 'T2w'])
59
+
60
+ # Two result, possible download status before
61
+ lines = result.stdout.strip().splitlines()[-3:]
62
+
63
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T1w.nii.gz' in lines[0]
64
+ assert 'tpl-MNI152Lin/tpl-MNI152Lin_res-01_T2w.nii.gz' in lines[1]
65
+
66
+ paths = [Path(line) for line in lines]
67
+
68
+ stats = [path.stat() for path in paths]
69
+ assert [stat_res.st_size for stat_res in stats] == [10669511, 10096230]
@@ -1 +0,0 @@
1
- 2c49f134299f66f514faa5dd8cf4b64f -
File without changes
File without changes
File without changes
File without changes
File without changes