I might have a simple solution for configurator.py: a shift from global configuration management to a class-based approach
main goals:
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.
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.
"""
@Liuhong99 Hi 👋🏻,
I might have a simple solution for
configurator.py
: a shift from global configuration management to a class-based approachmain goals:
Config
class to encapsulate configuration management, we separate this concern from the command-line argument parsing. This makes code more maintainable.config.
to every single variable.and then in the scripts where these configs are needed, could do this: