From 8c9cbb991981bfda4e4a10478883384f66761ce2 Mon Sep 17 00:00:00 2001 From: mathiasg Date: Tue, 24 Jun 2025 13:24:06 -0400 Subject: [PATCH] maint: deprecate --clean-workdir --- nibabies/cli/parser.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/nibabies/cli/parser.py b/nibabies/cli/parser.py index e66b92cd..8bb1d201 100644 --- a/nibabies/cli/parser.py +++ b/nibabies/cli/parser.py @@ -31,6 +31,8 @@ def _build_parser(): deprecations = { # parser attribute name: (replacement flag, version slated to be removed in) + 'clean_workdir', + (None, '26.0.0'), } class DeprecatedAction(Action): @@ -633,10 +635,9 @@ def _str_none(val): ) g_other.add_argument( '--clean-workdir', - action='store_true', + action=DeprecatedAction, default=False, - help='Clears working directory of contents. Use of this flag is not' - 'recommended when running concurrent processes of NiBabies.', + help='Deprecated and has no effect.', ) g_other.add_argument( '--resource-monitor', @@ -857,14 +858,6 @@ def parse_args(args=None, namespace=None): # Ensure the directory is created config.execution.mcribs_dir.mkdir(exist_ok=True, parents=True) - # Wipe out existing work_dir - if opts.clean_workdir and work_dir.exists(): - from niworkflows.utils.misc import clean_directory - - build_log.info(f'Clearing previous NiBabies working directory: {work_dir}') - if not clean_directory(work_dir): - build_log.warning(f'Could not clear all contents of working directory: {work_dir}') - # Ensure input and output folders are not the same if output_dir == bids_dir: parser.error(