pyphi.provenance.format_stem#

pyphi.provenance.format_stem(name, params=None, run_label=None)[source]#

Build a filename stem encoding a script’s parameters.

Joins name, one {key}{value} segment per params entry (in insertion order), and run_label when given, with underscores. Values and the run label are formatted with str(); . becomes p (so 0.7 → 0p7 and the filename keeps a single suffix) and any character outside [A-Za-z0-9_+-] becomes -. name is used verbatim.

Examples

>>> format_stem("study", {"seed": 42, "noise": 0.7}, "pilot")
'study_seed42_noise0p7_pilot'
Parameters:
Return type:

str