osmose.config.multivalue

Multi-value (per-stage array) config entries, recognised the way the engine parses them.

Which separators make an array depends on the KEY, not just the value:

  • ; marks an array on any key (the config writer round-trips it, and every array-capable engine parser accepts it).

  • , marks an array only on fields flagged array=True in the schema: the ones the engine reads with _parse_floats (re.split(r"[;,]")), i.e. size ratios and stage thresholds. EEC full writes “2.3;1.8”, Benguela “15, 5”; both are two-stage values. On any other key a ‘,’ is not a separator (the engine reads it with float() and fails), so “0,2” on a scalar key is a decimal-comma typo that the validator must keep reporting.

Every place that handles config values outside the engine (the validator, the form tabs, the species and resource tables, the sync guard, the Advanced editor) must use this one test, or an array is validated as one bad number, or flattened to a single value the engine then refuses.

Functions

is_multi_value(value[, field])

True when the engine would split value (the value of field) into several values.

split_multi_value(value[, field, keep_empty])

The parts of a multi-value entry of field, stripped: split on ';' and ',' for an array-capable field, on ';' alone otherwise.