Skip to content

Commit

Permalink
Read the current object in the model json file
Browse files Browse the repository at this point in the history
  • Loading branch information
midays committed Mar 17, 2024
1 parent bdbec62 commit d340e3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/models/configuration/configurations_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from src.models.configuration.options import Options
from src.utils.data_control import from_list
from src.utils.data_control import to_class
from src.utils.general import read_file
from src.utils.general import write_data_to_file


Expand Down Expand Up @@ -50,3 +51,8 @@ def update_model_json(self, model_json_path):

def get_configuration(self, configuration_name) -> Configuration:
return [config for config in self.configurations if config.name == configuration_name][0]

def get_model_object(self, model_json_path):
content = read_file(model_json_path)
configurations = ConfigurationsObject.from_dict(json.loads(content))
return configurations

0 comments on commit d340e3c

Please sign in to comment.