Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the current object in the model json file #124

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading