Skip to content

Commit 637e5d6

Browse files
authored
Merge pull request #593 from dbic/dcmstack-dev
install dcmstack straight from github until it is released
2 parents 33a0262 + 431ad0f commit 637e5d6

File tree

7 files changed

+19
-61
lines changed

7 files changed

+19
-61
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
- '3.7'
1818
- '3.8'
1919
- '3.9'
20-
# causes issues, disabled for now
21-
# - '3.10'
20+
- '3.10'
2221
steps:
2322
- name: Check out repository
2423
uses: actions/checkout@v3

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-r requirements.txt
2-
# Fix version to older pytest to ease backward compatibility testing
3-
pytest==3.6.4
42
tinydb
53
inotify
4+
# we need master version until it gets released
5+
# see https://github.com/moloney/dcmstack/issues/75
6+
git+https://github.com/moloney/dcmstack.git

heudiconv/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def add_taskname_to_infofile(infofiles):
895895
for infofile in infofiles:
896896
meta_info = load_json(infofile)
897897
try:
898-
meta_info['TaskName'] = (re.search('(?<=_task-)\w+',
898+
meta_info['TaskName'] = (re.search(r'(?<=_task-)\w+',
899899
op.basename(infofile))
900900
.group(0).split('_')[0])
901901
except AttributeError:

heudiconv/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Ensure they are cleaned up upon exit
2323
atexit.register(tempdirs.cleanup)
2424

25-
_VCS_REGEX = '%s\.(?:git|gitattributes|svn|bzr|hg)(?:%s|$)' % (op.sep, op.sep)
25+
_VCS_REGEX = r'%s\.(?:git|gitattributes|svn|bzr|hg)(?:%s|$)' % (op.sep, op.sep)
2626

2727

2828
@docstring_parameter(_VCS_REGEX)
@@ -161,7 +161,7 @@ def get_study_sessions(dicom_dir_template, files_opt, heuristic, outdir,
161161
for f in files_opt:
162162
if op.isdir(f):
163163
files += sorted(find_files(
164-
'.*', topdir=f, exclude_vcs=True, exclude="/\.datalad/"))
164+
'.*', topdir=f, exclude_vcs=True, exclude=r"/\.datalad/"))
165165
else:
166166
files.append(f)
167167

heudiconv/tests/test_heuristics.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,18 @@ def test_reproin_largely_smoke(tmpdir, heuristic, invocation):
9090

9191
# but there should be nothing new
9292
assert not ds.repo.dirty
93-
assert head == ds.repo.get_hexsha()
93+
# TODO: remove whenever https://github.com/datalad/datalad/issues/6843
94+
# is fixed/released
95+
buggy_datalad = (ds.pathobj / ".gitmodules").read_text().splitlines().count('[submodule "Halchenko"]') > 1
96+
assert head == ds.repo.get_hexsha() or buggy_datalad
9497

9598
# unless we pass 'overwrite' flag
9699
runner(args + ['--overwrite'])
97100
# but result should be exactly the same, so it still should be clean
98101
# and at the same commit
99102
assert ds.is_installed()
100103
assert not ds.repo.dirty
101-
assert head == ds.repo.get_hexsha()
104+
assert head == ds.repo.get_hexsha() or buggy_datalad
102105

103106

104107
@pytest.mark.parametrize(
@@ -121,7 +124,7 @@ def test_scans_keys_reproin(tmpdir, invocation):
121124
if i != 0:
122125
assert(os.path.exists(pjoin(dirname(scans_keys[0]), row[0])))
123126
assert(re.match(
124-
'^[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}.[\d]{6}$',
127+
r'^[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}.[\d]{6}$',
125128
row[1]))
126129

127130

heudiconv/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,20 +259,20 @@ def json_dumps_pretty(j, indent=2, sort_keys=True):
259259
'[\n ]+("?[-+.0-9e]+"?,?) *\n(?= *"?[-+.0-9e]+"?)', r' \1',
260260
js, flags=re.MULTILINE)
261261
# uniform no spaces before ]
262-
js_ = re.sub(" *\]", "]", js_)
262+
js_ = re.sub(r" *\]", "]", js_)
263263
# uniform spacing before numbers
264264
# But that thing could screw up dates within strings which would have 2 spaces
265265
# in a date like Mar 3 2017, so we do negative lookahead to avoid changing
266266
# in those cases
267267
#import pdb; pdb.set_trace()
268268
js_ = re.sub(
269-
'(?<!\w{3})' # negative lookbehind for the month
270-
' *("?[-+.0-9e]+"?)'
271-
'(?! [123]\d{3})' # negative lookahead for a year
272-
'(?P<space> ?)[ \n]*',
269+
r'(?<!\w{3})' # negative lookbehind for the month
270+
r' *("?[-+.0-9e]+"?)'
271+
r'(?! [123]\d{3})' # negative lookahead for a year
272+
r'(?P<space> ?)[ \n]*',
273273
r' \1\g<space>', js_)
274274
# no spaces after [
275-
js_ = re.sub('\[ ', '[', js_)
275+
js_ = re.sub(r'\[ ', '[', js_)
276276
# the load from the original dump and reload from tuned up
277277
# version should result in identical values since no value
278278
# must be changed, just formatting.

0 commit comments

Comments
 (0)