Skip to content

Commit

Permalink
Always use explicit option when scheduling jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
timcallow committed Dec 13, 2024
1 parent af31cc0 commit a8bc57b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
28 changes: 2 additions & 26 deletions datalad_slurm/reschedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -260,7 +249,6 @@ def __call__(
script=None,
report=False,
assume_ready=None,
explicit=False,
jobs=None
):

Expand All @@ -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",
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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).
Expand Down
11 changes: 2 additions & 9 deletions datalad_slurm/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',),
Expand Down Expand Up @@ -262,15 +256,13 @@ def __call__(
outputs=None,
expand=None,
assume_ready=None,
explicit=False,
message=None,
dry_run=None,
jobs=None):
for r in run_command(cmd, dataset=dataset,
inputs=inputs, outputs=outputs,
expand=expand,
assume_ready=assume_ready,
explicit=explicit,
message=message,
dry_run=dry_run,
jobs=jobs):
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a8bc57b

Please sign in to comment.