Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

cesm_hawc.resume

cesm_hawc.resume

source

Helpers that let long batch runs resume after being interrupted.

They work at two levels, used together:

outputs_already_exist

def outputs_already_exist(expected_paths: list[str]) -> bool

source

Check whether every expected output file exists.

Parameters

Returns

load_completed_keys

def load_completed_keys(
    csv_path: str,
    key_columns: list[str],
    expected_fieldnames: list[str],
) -> set[tuple]

source

Read which items a progress CSV already records as done.

Parameters

Returns

Notes

If the file’s header doesn’t match expected_fieldnames (for example, a file left by an older version), it is renamed to <csv_path>.schema_mismatch.bak and the run starts fresh, rather than appending inconsistent rows or misreading columns.

append_csv_row

def append_csv_row(csv_path: str, row: dict, fieldnames: list[str]) -> None

source

Append one row to a progress CSV, writing it to disk immediately.

Writing each row as it finishes, rather than once at the end of a job, means a killed job loses at most the item in progress.

Parameters