source_patch_id

function of dascore.workflow.identity source

source_patch_id(
    format_name: str ,
    path: str ,
    key: <class ‘object = None,
)-> ’str’

Return the id of data read from a file.

Derived rather than random, so reading the same file twice – in two processes, on two days – gives the same answer and the ids in a result can be traced back to what they came from.

Parameters

Parameter Description
format_name The format the reader was using.
path The resolved path or URI the data came from.
key What names this patch within the file, when a file holds more than
one. The reader’s own key if it has one, else the ordinal.
Note

An id derived this way is stable for a given archive laid out the same way; it is not stable across hosts, because the path is part of it. A format which stores an id – DASDAE does – keeps that one instead, and those are stable everywhere.