Read and retrieve data from a log file associated with the given `model_id`. :param model_id: Model identifier, (str). :param header: Header of the data to retrieve from the log, (str). :return: The data associated with the specified header from the log, (any type depending on data
(model_id, header)
| 66 | |
| 67 | |
| 68 | def read_log(model_id, header): |
| 69 | """ |
| 70 | Read and retrieve data from a log file associated with the given `model_id`. |
| 71 | |
| 72 | :param model_id: Model identifier, (str). |
| 73 | :param header: Header of the data to retrieve from the log, (str). |
| 74 | :return: The data associated with the specified header from the log, (any type depending on data stored). |
| 75 | """ |
| 76 | root_path = sys.path[0] |
| 77 | file_path = f"{root_path}/loggers/results/{model_id}/log.yaml" |
| 78 | |
| 79 | with open(file_path, "r") as yamlfile: |
| 80 | log = yaml.safe_load(yamlfile) |
| 81 | |
| 82 | return log[header] |
nothing calls this directly
no outgoing calls
no test coverage detected