environmentaltools.common.npy2json

environmentaltools.common.npy2json(params: dict)[source]

Convert dictionary with numpy arrays to JSON format and save to file.

Serializes numpy arrays to lists and performs custom transformations for specific parameter structures before saving to JSON file.

Parameters:

params (dict) – Dictionary containing parameters to transform. Must include ‘fname’ key for output filename. Arrays are converted to lists, ‘mode’ values to integers, and handles nested structures in ‘all’ and ‘fun’ keys.

Returns:

None