polaris.tasks.ocean.realistic_global.models.replace_steps

polaris.tasks.ocean.realistic_global.models.replace_steps(task: Task, old_steps: Dict[str, Step], new_steps: Dict[str, Step]) → None[source]

Swap a task’s steps from one model’s set for another’s.

The two sets share their model-neutral steps, which are the same instances in both and are left alone. Every other old step is removed before any new one is added, since the two models’ steps have the same names.

Parameters:
  • task (polaris.Task) – The task to update.

  • old_steps (dict of {str: polaris.Step}) – The steps the task was given, keyed by their symlink names.

  • new_steps (dict of {str: polaris.Step}) – The steps to give the task instead, keyed the same way.