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

A new configurator? #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

A new configurator? #13

wants to merge 1 commit into from

Conversation

arman-hk
Copy link

@Liuhong99 Hi 👋🏻,

I might have a simple solution for configurator.py: a shift from global configuration management to a class-based approach

main goals:

  1. separation of concerns: By using a Config class to encapsulate configuration management, we separate this concern from the command-line argument parsing. This makes code more maintainable.
  2. selective import: Instead of importing every variable globally, we can selectively import frequently used or important variables, without needing to prepend config. to every single variable.

and then in the scripts where these configs are needed, could do this:

from configurator import config

batch_size = config.batch_size
learning_rate = config.learning_rate

"""
now we use 'batch_size' and 'learning_rate' directly in the script
and avoid typing 'config.' before each variable.
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant