From a8bc57b87abb63c039e1e80d4e3028367574b583 Mon Sep 17 00:00:00 2001 From: Tim Callow Date: Fri, 13 Dec 2024 11:58:19 +0100 Subject: [PATCH] Always use explicit option when scheduling jobs --- datalad_slurm/reschedule.py | 28 ++-------------------------- datalad_slurm/schedule.py | 11 ++--------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/datalad_slurm/reschedule.py b/datalad_slurm/reschedule.py index 0f7572a..0c042f5 100644 --- a/datalad_slurm/reschedule.py +++ b/datalad_slurm/reschedule.py @@ -204,17 +204,6 @@ class Reschedule(Interface): to set --output-format to 'json' or 'json_pp'. CMD]""", ), assume_ready=reschedule_assume_ready_opt, - explicit=Parameter( - args=("--explicit",), - action="store_true", - doc="""Consider the specification of inputs and outputs in the run - record to be explicit. Don't warn if the repository is dirty, and - only save modifications to the outputs from the original record. - Note that when several run commits are specified, this applies to - every one. Care should also be taken when using [CMD: --onto - CMD][PY: `onto` PY] because checking out a new HEAD can easily fail - when the working tree has modifications.""", - ), jobs=jobs_opt, ) @@ -260,7 +249,6 @@ def __call__( script=None, report=False, assume_ready=None, - explicit=False, jobs=None ): @@ -271,18 +259,6 @@ def __call__( lgr.debug("rescheduling command output underneath %s", ds) - if script is None and not (report or explicit) and ds_repo.dirty: - yield get_status_dict( - "run", - ds=ds, - status="impossible", - message=( - "clean dataset required to detect changes from command; " - "use `datalad status` to inspect unsaved changes" - ), - ) - return - if not ds_repo.get_hexsha(): yield get_status_dict( "run", @@ -354,7 +330,7 @@ def __call__( handler = _report else: handler = partial( - _rerun, assume_ready=assume_ready, explicit=explicit, jobs=jobs + _rerun, assume_ready=assume_ready, explicit=True, jobs=jobs ) for res in handler(ds, results): @@ -484,7 +460,7 @@ def _mark_nonrun_result(result, which): return result -def _rerun(dset, results, assume_ready=None, explicit=False, jobs=None): +def _rerun(dset, results, assume_ready=None, explicit=True, jobs=None): ds_repo = dset.repo # Keep a map from an original hexsha to a new hexsha created by the rerun # (i.e. a reran, cherry-picked, or merged commit). diff --git a/datalad_slurm/schedule.py b/datalad_slurm/schedule.py index 34b558d..b868c3e 100644 --- a/datalad_slurm/schedule.py +++ b/datalad_slurm/schedule.py @@ -213,12 +213,6 @@ class Schedule(Interface): commit message.""", constraints=EnsureChoice(None, "inputs", "outputs", "both")), assume_ready=assume_ready_opt, - explicit=Parameter( - args=("--explicit",), - action="store_true", - doc="""Consider the specification of inputs and outputs to be - explicit. Don't warn if the repository is dirty, and only save - modifications to the listed outputs."""), message=save_message_opt, sidecar=Parameter( args=('--sidecar',), @@ -262,7 +256,6 @@ def __call__( outputs=None, expand=None, assume_ready=None, - explicit=False, message=None, dry_run=None, jobs=None): @@ -270,7 +263,6 @@ def __call__( inputs=inputs, outputs=outputs, expand=expand, assume_ready=assume_ready, - explicit=explicit, message=message, dry_run=dry_run, jobs=jobs): @@ -408,8 +400,9 @@ def _create_record(run_info, sidecar_flag, ds): def run_command(cmd, dataset=None, inputs=None, outputs=None, expand=None, - assume_ready=None, explicit=False, message=None, sidecar=None, + assume_ready=None, message=None, sidecar=None, dry_run=False, jobs=None, + explicit=True, extra_info=None, rerun_info=None, extra_inputs=None,