spvctrl.spvctrl_interactive.get_sample#

get_sample(sample: Sample | str | None) → Sample | str | None[source]#

Resolve a sample argument to the value recorded as sample metadata with a measurement.

A Sample object is returned as-is. A string is looked up in the sample database and the entry is returned; if the string is not in the database, a warning is logged and the plain string is returned. None is returned unchanged and recorded as null.

Parameters:

sample – Sample object, a sample database key, or None.

Returns:

The Sample object, the unknown sample name as plain string, or None.