Start fixing up cli and setup
This commit is contained in:
2
src/primaite/config/__init__.py
Normal file
2
src/primaite/config/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# © Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
"""Configuration parameters for running experiments."""
|
||||
22
src/primaite/config/load.py
Normal file
22
src/primaite/config/load.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
import yaml
|
||||
|
||||
from primaite import getLogger
|
||||
|
||||
_LOGGER = getLogger(__name__)
|
||||
|
||||
|
||||
def load(file_path: Union[str, Path]) -> Dict:
|
||||
"""
|
||||
Read a YAML file and return the contents as a dictionary.
|
||||
|
||||
:param file_path: Path to the YAML file.
|
||||
:type file_path: Union[str, Path]
|
||||
:return: Config dictionary
|
||||
:rtype: Dict
|
||||
"""
|
||||
|
||||
if not isinstance(file_path, Path):
|
||||
file_path = Path(file_path)
|
||||
Reference in New Issue
Block a user