mirror of
https://github.com/logos-co/SimulationsFramework.git
synced 2025-02-22 10:48:17 +00:00
Created file parser and simulation config class
This commit is contained in:
parent
fb2415ea7a
commit
ce54734892
23
Utilities/file_parser.py
Normal file
23
Utilities/file_parser.py
Normal 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
|
11
Utilities/simulation_config.py
Normal file
11
Utilities/simulation_config.py
Normal 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user