gwkokab.analysis.utils.common ============================= .. py:module:: gwkokab.analysis.utils.common Functions --------- .. autoapisummary:: gwkokab.analysis.utils.common.expand_arguments gwkokab.analysis.utils.common.read_json gwkokab.analysis.utils.common.write_json Module Contents --------------- .. py:function:: expand_arguments(arg: str, n: int) -> List[str] Extend the argument with a number of strings. .. code:: python >>> expand_arguments("physics", 3) ["physics_0", "physics_1", "physics_2"] :param arg: argument to extend :type arg: str :param n: number of strings to extend :type n: int :returns: list of extended arguments :rtype: List[str] .. py:function:: read_json(json_file: str) -> Dict Read json file and return. :param json_file: path of the json file :type json_file: str :returns: json file content as dict :rtype: dict :raises ValueError: If the file is not found or if the file is not a valid json file .. py:function:: write_json(json_file: str, content: Dict) -> None Write a dictionary to a json file. :param json_file: path of the json file :type json_file: str :param content: content to write to the json file :type content: dict :raises ValueError: If the file is not writable or if the content is not a valid json serializable object