Created file parser and simulation config class
This commit is contained in:
parent
fb2415ea7a
commit
ce54734892
|
@ -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
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue