pyphi.provenance.save_json#

pyphi.provenance.save_json(data, directory, name, *, params=None, run_label=None, seed=None, note=None)[source]#

Write data to a self-describing, non-clobbering JSON file.

The file holds the envelope {"provenance": ..., "params": ..., "data": ...}. The filename encodes params and run_label (see format_stem()); an existing file is never overwritten (a _v2/_v3 suffix is added instead). The provenance record stores the seed from seed or, when omitted, from params["seed"]. numpy scalars and arrays in data are converted to JSON-native values.

Returns the written path.

Parameters:
Return type:

Path