environmentaltools.common.read_json

environmentaltools.common.read_json(file_name: str, conversion_type: str = None)[source]

Read data from JSON files with optional type conversion.

Loads JSON files and converts keys to integers or numpy arrays based on the specified conversion type.

Parameters:
  • file_name (str) – Path to the JSON file.

  • conversion_type (str, optional) – Type of data conversion: - “td” (temporal dependency): Converts values to numpy arrays - None or other: Converts keys to integers Defaults to None.

Returns:

Loaded and converted dictionary data.

Return type:

dict