You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the /config/config.yaml file is called upon using many "functions.get_from_yaml()" calls throughout the codebase. For example: regions = functions.get_from_yaml('regions_dict')
continent = functions.get_from_yaml('continent')
do_something_with_regions(regions)
do_something_with_continent(continent)
It seems like a good idea to instead add all of the /config/config.yaml values to a class in the functions.py file. This class can then be instantiated as an object in every script file that requires information from the .yaml file. Then, instead of calling the example, we could do something like: settings = functions.YamlValues()
do_something_with_regions(settings.regions)
do_something_with_continent(settings.continent)
Where settings is the object that has member variables including "regions" and "continent". "settings" is instantiated from the class YamlValues(), which initializes itself in functions with the appropriate member variables.
The end result of this change would be cutting down on a lot of calls of functions.get_from_yaml() at the beginning of almost every function. It would also resolve this comment: #133 (review)
The text was updated successfully, but these errors were encountered:
Currently, the /config/config.yaml file is called upon using many "functions.get_from_yaml()" calls throughout the codebase. For example:
regions = functions.get_from_yaml('regions_dict')
continent = functions.get_from_yaml('continent')
do_something_with_regions(regions)
do_something_with_continent(continent)
It seems like a good idea to instead add all of the /config/config.yaml values to a class in the functions.py file. This class can then be instantiated as an object in every script file that requires information from the .yaml file. Then, instead of calling the example, we could do something like:
settings = functions.YamlValues()
do_something_with_regions(settings.regions)
do_something_with_continent(settings.continent)
Where settings is the object that has member variables including "regions" and "continent". "settings" is instantiated from the class YamlValues(), which initializes itself in functions with the appropriate member variables.
The end result of this change would be cutting down on a lot of calls of functions.get_from_yaml() at the beginning of almost every function. It would also resolve this comment: #133 (review)
The text was updated successfully, but these errors were encountered: