diff --git a/src/hyfi/composer/base.py b/src/hyfi/composer/base.py index 0c8c7d87..fdaec101 100644 --- a/src/hyfi/composer/base.py +++ b/src/hyfi/composer/base.py @@ -66,6 +66,10 @@ def validate_model_config_before(cls, data): if not _config_group_: logger.debug("There is no config group specified.") return data + config_group = f"{_config_group_}={_config_name_}" + if not Composer.is_composable(config_group): + logger.debug("Config group `%s` is not composable.", config_group) + return data # Initialize the config with the given config_name. logger.info( "Composing `%s` class with `%s` config in `%s` group.", @@ -73,10 +77,7 @@ def validate_model_config_before(cls, data): _config_name_, _config_group_, ) - cfg = Composer( - config_group=f"{_config_group_}={_config_name_}", - config_data=data, - ).config_as_dict + cfg = Composer(config_group=config_group, config_data=data).config_as_dict data = Composer.update(cfg, data) # Exclude any attributes specified in the class's `exclude` list. exclude = getattr(cls._exclude_, "default", set()) # type: ignore