gwkokab.analysis.utils.common¶
Functions¶
|
Extend the argument with a number of strings. |
|
Read json file and return. |
|
Write a dictionary to a json file. |
Module Contents¶
- gwkokab.analysis.utils.common.expand_arguments(arg: str, n: int) List[str]¶
Extend the argument with a number of strings.
>>> expand_arguments("physics", 3) ["physics_0", "physics_1", "physics_2"]
- gwkokab.analysis.utils.common.read_json(json_file: str) Dict¶
Read json file and return.
- Parameters:
json_file (str) – path of the json file
- Returns:
json file content as dict
- Return type:
- Raises:
ValueError – If the file is not found or if the file is not a valid json file
- gwkokab.analysis.utils.common.write_json(json_file: str, content: Dict) None¶
Write a dictionary to a json file.
- Parameters:
- Raises:
ValueError – If the file is not writable or if the content is not a valid json serializable object