Skip to content

Load ConfigMapper objects without explicit import statements #32

@dalgu90

Description

@dalgu90

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions