Skip to content

Commit

Permalink
Merge pull request #36 from alexpron/datalad-deactivate
Browse files Browse the repository at this point in the history
[ENH]: offer possibility to the user to deactivate datalad saving
  • Loading branch information
quentinduche authored Dec 17, 2024
2 parents 5deb17b + 4e7690f commit 07552da
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion shanoir2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def __init__(self):
)
self.add_sns = False # Add series number suffix to filename
self.debug_mode = False # No debug mode by default
self.datalad = True # Activate datalad save by default

def set_json_config_file(self, json_file):
"""
Expand Down Expand Up @@ -744,10 +745,11 @@ def escape_solr_special_characters(s):
# "with_prov": True,
"debug": self.debug_mode,
"dcmconfig": dcm2niix_config_file.name,
"datalad": True,
"datalad": self.datalad,
"minmeta": True,
"grouping": "all", # other options are too restrictive (tested on EMISEP)
"overwrite": True,

}

if self.longitudinal and bids_seq_session is not None:
Expand Down Expand Up @@ -835,6 +837,11 @@ def main():
action="store_true",
help="Toggle debug mode (keep temporary directories)",
)
group = parser.add_mutually_exclusive_group()
group.add_argument("--activate-datalad", action="store_true", dest="datalad", help="Store outputs as datalad dataset")
group.add_argument("--deactivate-datalad", action="store_false", dest="datalad", help="Store outputs as regular directory")
# by default save as datalad dataset
parser.set_defaults(datalad=True)

args = parser.parse_args()

Expand All @@ -853,6 +860,8 @@ def main():
if args.debug:
stb.debug_mode = True

stb.datalad = args.datalad

if args.longitudinal:
stb.toggle_longitudinal_version()

Expand Down

0 comments on commit 07552da

Please sign in to comment.