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

Eliminate the use of global variables and global config files. #5

Open
Danfoa opened this issue Jun 19, 2024 · 0 comments
Open

Eliminate the use of global variables and global config files. #5

Danfoa opened this issue Jun 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Danfoa
Copy link
Collaborator

Danfoa commented Jun 19, 2024

Most modules in this repository import a fixed repo-specific config file, config.py, and use it to load class-specific and function-specific attributes. This practice poses a problem, as external users must modify the modules and scripts to avoid using config.py.

For instance, to utilize the Acados_NMPC_Nominal class, the mpc_params used to define its attributes should be passed through the class constructor or as a DataClass configuration. Such that I as an external user can import only this class and use it without having to rely on modifying the config file of the repo, which I dont want to use.

As an example, the Centroidal_Model_Nominal model only uses config.py to load the config.mpc_params["use_foothold_optimization"] argument. This should be a class attribute set during initialization.

Maintaining the modularity of each class is essential for scaling both the code and the user base.

@giulioturrisi giulioturrisi added the enhancement New feature or request label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants