To set objects of the ConfigMapper, we explicitly import modules that contain the objects we want to get from the ConfigMapper. For example, in run.py, we need to import modules at line (1) to load dataset classes at line (2). This happens in many files in the repo, and create unnecessary import statements. We may need a way to implicitly import all the modules that ConfigMapper needs to load.
...
from src.datasets import * <- (1)
from src.models import *
from src.trainers import *
from src.utils.configuration import Config
from src.utils.import_related_ops import pandas_related_ops
from src.utils.mapper import ConfigMapper
...
train_data = ConfigMapper.get_object("datasets", config.dataset.name)(
config.dataset.params.train
) <- (2)
To set objects of the ConfigMapper, we explicitly import modules that contain the objects we want to get from the ConfigMapper. For example, in
run.py
, we need to import modules at line (1) to load dataset classes at line (2). This happens in many files in the repo, and create unnecessary import statements. We may need a way to implicitly import all the modules that ConfigMapper needs to load.