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

Add a config file #86

Open
leo-desbureaux-tellae opened this issue Nov 14, 2023 · 0 comments
Open

Add a config file #86

leo-desbureaux-tellae opened this issue Nov 14, 2023 · 0 comments
Labels
enhancement New feature or request io Inputs/Outputs

Comments

@leo-desbureaux-tellae
Copy link
Contributor

leo-desbureaux-tellae commented Nov 14, 2023

A config file already exists in Starling, but we should move most of the global variables used in Starling in the config (like the data folder)

A default config containing default value for each attributes should be stored in the package.

Some of the config values are related to the actual simulation (walking speed, distance factor?), while others are related to the environment and the inputs/outputs. Should we separate these two types of configs ?

Maybe use a class like this:

class StarlingConfig:
    def __init__(self, config_dict):
        self.provided_config = config_dict
        
        final_config = copy.deepcopy(DEFAULT_CONFIG)
        final_config.update(config_dict)
        self._config = final_config
        
    @property
    def config(self):
        return self._config
    
    def __getitem__(self, item):
        return self._config[item]
@leo-desbureaux-tellae leo-desbureaux-tellae added enhancement New feature or request io Inputs/Outputs labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request io Inputs/Outputs
Projects
None yet
Development

No branches or pull requests

1 participant