Created file parser and simulation config class

This commit is contained in:
Alberto 2022-09-22 17:59:20 +02:00
parent fb2415ea7a
commit ce54734892
2 changed files with 34 additions and 0 deletions

23
Utilities/file_parser.py Normal file
View File

@ -0,0 +1,23 @@
import json
class ConfigurationFileParser:
def __init__(self, file_path):
self._file_path = file_path
def read_content(self):
# Retrieve raw info
data = self._parse_file()
# Check valid flags depending on simulation ()
print("asd")
# Parse values
return "data"
def _parse_file(self):
with open(self._file_path, "r") as file:
data = json.load(file)
return data

View File

@ -0,0 +1,11 @@
import json
from dataclasses import dataclass
# yaml_obj = yaml_parser.YamlParser(input_yaml, valid_flags.VALID_FLAGS_PLATFORM)
@dataclass
class SimulationConfig:
file: str
data: dict