Skip to content

Commit 0f38e5e

Browse files
committed
Merge commit 'v0.10.0-10-g80a6538' (origin/master) into adds_populate_intended_for
Merge is done to update the PR with uptodate CI and testing fixes to simplify local testing etc * commit 'v0.10.0-10-g80a6538': BF(TST): use caplog instead of capfd for testing if we log a warning Travis - Use bionic for the base BF(TST): fix the test for annonimization so it actually tests ENH: anonymize_sid - do sanity check that anonymization script produced output ENH: add HeudiconvVersion to sidecar .json files Changelog etc for 0.10.0 release Revert "BF(TST): workaround for python 3.5" BF(workaround): retry loading json multiple times BF: account for datalad.create no_annex removal, deprecated in 0.13.0 Drop 3.5 (support ended) and add 3.9 BF: make anonymize_script actually output anything and map determinstically RM: reproin - Remove (ancient) DBIC specific craft ENH: reproin - consider all accessions (not assume there is 1) in fix_canceled_runs
2 parents d53e50b + 80a6538 commit 0f38e5e

File tree

16 files changed

+248
-220
lines changed

16 files changed

+248
-220
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# vim ft=yaml
22
language: python
3+
dist: bionic
34
python:
4-
- 3.5
55
- 3.6
66
- 3.7
77
- 3.8
8+
- 3.9
89

910
cache:
1011
- apt

CHANGELOG.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,42 @@ All notable changes to this project will be documented (for humans) in this file
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.10.0] - 2021-09-16
8+
9+
Various improvements and compatibility/support (dcm2niix, datalad) changes.
10+
11+
### Added
12+
13+
- Add "AcquisitionTime" to the seqinfo ([#487][])
14+
- Add support for saving the Phoenix Report in the sourcedata folder ([#489][])
15+
16+
### Changed
17+
18+
- Python 3.5 EOLed, supported (tested) versions now: 3.6 - 3.9
19+
- In reprorin heuristic, allow for having multiple accessions since now there is
20+
`-g all` groupping ([#508][])
21+
- For BIDS, produce a singular `scans.json` at the top level, and not one per
22+
sub/ses (generates too many identical files) ([#507][])
23+
24+
25+
### Fixed
26+
27+
- Compatibility with DataLad 0.15.0. Minimal version is 0.13.0 now.
28+
- Try to open top level BIDS .json files a number of times for adjustment,
29+
so in the case of competition across parallel processes, they just end up
30+
with the last one "winning over" ([#523][])
31+
- Don't fail if etelemetry.get_project returns None ([#501][])
32+
- Consistently use `n/a` for age/sex, also handle ?M for months ([#500][])
33+
- To avoid crashing on unrelated derivatives files etc, make `find_files` to
34+
take list of topdirs (excluding `derivatives/` etc),
35+
and look for _bold only under sub-* directories ([#496][])
36+
- Ensure bvec/bval files are only created for dwi output ([#491][])
37+
38+
### Removed
39+
40+
- In reproin heuristic, old hardcoded sequence renamings and filters ([#508][])
41+
42+
743
## [0.9.0] - 2020-12-23
844

945
Various improvements and compatibility/support (dcm2niix, datalad,
@@ -22,12 +58,12 @@ target output directory during conversion.
2258
directory (with a `_heudiconv???` suffix, renamed into ultimate target
2359
name later on), which avoids hitting file size limits of /tmp ([#481][]) and
2460
helped to avoid a regression in dcm2nixx 1.0.20201102
25-
- #477 replaced `rec-<magnitude|phase>` with `part-<mag|phase>` now
26-
that BIDS supports the part entity
27-
- #473 made default for CogAtlasID to be a TODO URL
28-
- #459 made AcquisitionTime used for acq_time scans file field
29-
- #451 retained sub-second resolution in scans files
30-
- #442 refactored code so there is now heudiconv.main.workflow for
61+
- [#477][] replaced `rec-<magnitude|phase>` with `part-<mag|phase>` now
62+
hat BIDSsupports the part entity
63+
- [#473][] made default for CogAtlasID to be a TODO URL
64+
- [#459][] made AcquisitionTime used for acq_time scans file field
65+
- [#451][] retained sub-second resolution in scans files
66+
- [#442][] refactored code so there is now heudiconv.main.workflow for
3167
more convenient use as a Python module
3268

3369
### Fixed
@@ -350,6 +386,11 @@ TODO Summary
350386
[#368]: https://github.com/nipy/heudiconv/issues/368
351387
[#373]: https://github.com/nipy/heudiconv/issues/373
352388
[#485]: https://github.com/nipy/heudiconv/issues/485
389+
[#442]: https://github.com/nipy/heudiconv/issues/442
390+
[#451]: https://github.com/nipy/heudiconv/issues/451
391+
[#459]: https://github.com/nipy/heudiconv/issues/459
392+
[#473]: https://github.com/nipy/heudiconv/issues/473
393+
[#477]: https://github.com/nipy/heudiconv/issues/477
353394
[#293]: https://github.com/nipy/heudiconv/issues/293
354395
[#304]: https://github.com/nipy/heudiconv/issues/304
355396
[#306]: https://github.com/nipy/heudiconv/issues/306
@@ -391,3 +432,12 @@ TODO Summary
391432
[#464]: https://github.com/nipy/heudiconv/issues/464
392433
[#480]: https://github.com/nipy/heudiconv/issues/480
393434
[#481]: https://github.com/nipy/heudiconv/issues/481
435+
[#487]: https://github.com/nipy/heudiconv/issues/487
436+
[#489]: https://github.com/nipy/heudiconv/issues/489
437+
[#491]: https://github.com/nipy/heudiconv/issues/491
438+
[#496]: https://github.com/nipy/heudiconv/issues/496
439+
[#500]: https://github.com/nipy/heudiconv/issues/500
440+
[#501]: https://github.com/nipy/heudiconv/issues/501
441+
[#507]: https://github.com/nipy/heudiconv/issues/507
442+
[#508]: https://github.com/nipy/heudiconv/issues/508
443+
[#523]: https://github.com/nipy/heudiconv/issues/523

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '0.9.0'
29+
release = '0.10.0'
3030

3131

3232
# -- General configuration ---------------------------------------------------

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If `Docker <https://docs.docker.com/install/>`_ is available on your system, you
2626
can visit `our page on Docker Hub <https://hub.docker.com/r/nipy/heudiconv/tags>`_
2727
to view available releases. To pull the latest release, run::
2828

29-
$ docker pull nipy/heudiconv:0.9.0
29+
$ docker pull nipy/heudiconv:0.10.0
3030

3131

3232
Singularity
@@ -35,4 +35,4 @@ If `Singularity <https://www.sylabs.io/singularity/>`_ is available on your syst
3535
you can use it to pull and convert our Docker images! For example, to pull and
3636
build the latest release, you can run::
3737

38-
$ singularity pull docker://nipy/heudiconv:0.9.0
38+
$ singularity pull docker://nipy/heudiconv:0.10.0

docs/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The second script processes a DICOM directory with ``heudiconv`` using the built
8282
DCMDIR=${DCMDIRS[${SLURM_ARRAY_TASK_ID}]}
8383
echo Submitted directory: ${DCMDIR}
8484
85-
IMG="/singularity-images/heudiconv-0.9.0-dev.sif"
85+
IMG="/singularity-images/heudiconv-0.10.0-dev.sif"
8686
CMD="singularity run -B ${DCMDIR}:/dicoms:ro -B ${OUTDIR}:/output -e ${IMG} --files /dicoms/ -o /output -f reproin -c dcm2niix -b notop --minmeta -l ."
8787
8888
printf "Command:\n${CMD}\n"
@@ -97,7 +97,7 @@ This script creates the top-level bids files (e.g.,
9797
set -eu
9898

9999
OUTDIR=${1}
100-
IMG="/singularity-images/heudiconv-0.9.0-dev.sif"
100+
IMG="/singularity-images/heudiconv-0.10.0-dev.sif"
101101
CMD="singularity run -B ${OUTDIR}:/output -e ${IMG} --files /output -f reproin --command populate-templates"
102102

103103
printf "Command:\n${CMD}\n"

heudiconv/bids.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
remove_suffix,
2929
remove_prefix,
3030
)
31+
from . import __version__
3132

3233
lgr = logging.getLogger(__name__)
3334

@@ -45,6 +46,10 @@
4546
("Description", "md5 hash of UIDs")])),
4647
])
4748

49+
#: JSON Key where we will embed our version in the newly produced .json files
50+
HEUDICONV_VERSION_JSON_KEY = 'HeudiconvVersion'
51+
52+
4853
class BIDSError(Exception):
4954
pass
5055

@@ -180,7 +185,7 @@ def populate_aggregated_jsons(path):
180185
# TODO: if we are to fix it, then old ones (without _acq) should be
181186
# removed first
182187
task = re.sub('.*_(task-[^_\.]*(_acq-[^_\.]*)?)_.*', r'\1', fpath)
183-
json_ = load_json(fpath)
188+
json_ = load_json(fpath, retry=100)
184189
if task not in tasks:
185190
tasks[task] = json_
186191
else:
@@ -235,7 +240,7 @@ def populate_aggregated_jsons(path):
235240
"CogAtlasID": "http://www.cognitiveatlas.org/task/id/TODO",
236241
}
237242
if op.lexists(task_file):
238-
j = load_json(task_file)
243+
j = load_json(task_file, retry=100)
239244
# Retain possibly modified placeholder fields
240245
for f in placeholders:
241246
if f in j:
@@ -267,6 +272,10 @@ def tuneup_bids_json_files(json_files):
267272
# Let's hope no word 'Date' comes within a study name or smth like
268273
# that
269274
raise ValueError("There must be no dates in .json sidecar")
275+
# Those files should not have our version field already - should have been
276+
# freshly produced
277+
assert HEUDICONV_VERSION_JSON_KEY not in json_
278+
json_[HEUDICONV_VERSION_JSON_KEY] = str(__version__)
270279
save_json(jsonfile, json_)
271280

272281
# Load the beast

heudiconv/external/dlad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def add_to_datalad(topdir, studydir, msg, bids):
5858
ds_ = dl.create(curdir_, dataset=superds,
5959
force=True,
6060
# initiate annex only at the bottom repository
61-
no_annex=isubdir<(len(subdirs)-1),
61+
annex=isubdir==(len(subdirs)-1),
6262
fake_dates=True,
6363
# shared_access='all',
6464
)

0 commit comments

Comments
 (0)