Skip to content

Commit

Permalink
fix typos and pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbore committed Jun 17, 2024
1 parent c833933 commit 4532d44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ENV FSLTCLSH="${FSLDIR}/bin/fsltclsh"
ENV FSLWISH="${FSLDIR}/bin/fslwish"
ENV FSLGECUDAQ="cuda.q"

# Install dc fro FSL bet and wget for fetching data
# Update and install some utils
RUN apt-get -y update && apt-get -y install dc wget npm unzip

# Fetch data
Expand Down
4 changes: 2 additions & 2 deletions dcm2bids/sidecar.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def searchDcmTagEntity(self, sidecar, desc):
# If dir found in custom_entities and concatenated_matches.keys we keep it
if "custom_entities" in desc.keys():
entities = set(concatenated_matches.keys()).intersection(set(descWithTask["custom_entities"]))

# custom_entities not a key for extractor or auto_extract_entities
complete_entities = [ent for ent in descWithTask["custom_entities"] if '-' in ent]
entities = entities.union(set(complete_entities))
Expand All @@ -478,7 +478,7 @@ def searchDcmTagEntity(self, sidecar, desc):
if left_auto_entities:
self.logger.warning(f"{left_auto_entities} have not been found for datatype '{descWithTask['datatype']}' "
f"and suffix '{descWithTask['suffix']}'.")

entities = list(entities) + list(auto_entities)
entities = list(set(entities))
descWithTask["custom_entities"] = entities
Expand Down
13 changes: 7 additions & 6 deletions dcm2bids/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import os
from pathlib import Path
from subprocess import check_output, Popen, PIPE
from subprocess import Popen, PIPE


class DEFAULT(object):
Expand Down Expand Up @@ -74,7 +74,7 @@ class DEFAULT(object):
"fmap_TB1SRGE": ["echo", "inv"],
"perf_physio": ["task"],
"perf_stim": ["task"]}

compKeys = ["AcquisitionTime", "SeriesNumber", "SidecarFilename"]
search_methodChoices = ["fnmatch", "re"]
search_method = "fnmatch"
Expand Down Expand Up @@ -148,9 +148,10 @@ def run_shell_command(commandLine, log=True):

pipes = Popen(commandLine, stdout=PIPE, stderr=PIPE)
std_out, std_err = pipes.communicate()

return std_out


def convert_dir(dir):
""" Convert Direction
Args:
Expand All @@ -163,15 +164,15 @@ def convert_dir(dir):


def combine_dict_extractors(d1, d2):
""" combine dict
""" combine dict
Args:
d1 (dic): dictionary
d2 (dic): dictionary
Returns:
dict: dictionary with combined information
if d1 d2 use the same keys, return dict will return a list of items.
"""
"""
return {
k: [d[k][0] for d in (d1, d2) if k in d]
for k in set(d1.keys()) | set(d2.keys())
Expand Down

0 comments on commit 4532d44

Please sign in to comment.