set_metadata
Builtin index · Signal processing
set_metadata(s, key, value)
Input: s, key, value · Output: no output
What it is
Added in v0.2.4. Writes one field of the named schema: channel, comment, experiment, gain, instrument, offset, operator, sample, sampling_rate, sensor, start_time, temperature, unit. Keys match ignoring case and underscores, so the spec's samplingRate/startTime resolve too. An off-schema key is an error listing the schema โ a typo that silently became its own field would be one nobody ever reads back. sampling_rate, start_time and unit are derived from the signal and are refused with a pointer at their real setter, so a stored copy can never contradict the value. Values must be a number, string or boolean.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
set_metadata(s, key, value) | s —Keys match ignoring case and underscores, so the spec's samplingRate/startTime resolve too.key —An off-schema key is an error listing the schema โ a typo that silently became its own field would be one nobody ever reads back.value —sampling_rate, start_time and unit are derived from the signal and are refused with a pointer at their real setter, so a stored copy can never contradict the value. | not documented yet | Added in v0.2.4. Writes one field of the named schema: channel, comment, experiment, gain, instrument, offset, operator, sample, sampling_rate, sensor, start_time, temperature, unit. Values must be a number, string or boolean. |
Examples
No documentation example calls this form yet. The Signal processing chapter is where one belongs.
How it works
set_metadata(s, key, value) -- write one field of the ยง10 schema. An unknown key is an ERROR naming the whole schema, not a new field: a typo that silently becomes its own key is a field nobody will ever read back.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.