Skip to content

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

Open

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions