environmentaltools.common.to_json
- environmentaltools.common.to_json(params: dict, file_name: str, numpy_array_serialization: bool = False)[source]
Save dictionary to JSON file with optional numpy array serialization.
Exports data to JSON format with optional automatic conversion of numpy arrays to lists for JSON compatibility.
- Parameters:
params (dict) – Data dictionary to save.
file_name (str) – Output file path.
numpy_array_serialization (bool) – If True, recursively converts numpy arrays to lists in nested dictionaries. Defaults to False.
- Returns:
None