MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / read_log

Function read_log

loggers/logger.py:68–82  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

66
67
68def 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]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected