Load a YAML file. Args: path (str): Path to the YAML file. subsection (str): Subsection to be considered (i.e. general, model, trading). Returns: A dictionary containing the YAML file.
(path: str, subsection: str)
| 12 | |
| 13 | |
| 14 | def load_yaml(path: str, subsection: str) -> dict[str, Any]: |
| 15 | """ |
| 16 | Load a YAML file. |
| 17 | |
| 18 | Args: |
| 19 | path (str): Path to the YAML file. |
| 20 | subsection (str): Subsection to be considered (i.e. general, model, trading). |
| 21 | |
| 22 | Returns: |
| 23 | A dictionary containing the YAML file. |
| 24 | """ |
| 25 | with open(path) as f: |
| 26 | config = yaml.safe_load(f) |
| 27 | return config[subsection] |
| 28 | |
| 29 | |
| 30 | def data_split( |