def __attrs_post_init__(self): # load additional objects for k in self.postprocessing: k_observed = k if k == 'variant_effects': k = 'kipoi_veff' if is_installed(k): # Load the config properly if the plugin is installed try: parser = get_dataloader_yaml_parser(k) self.postprocessing[k_observed] = parser.from_config(self.postprocessing[k_observed]) object.__setattr__(self, "postprocessing", self.postprocessing) except Exception: logger.warning("Unable to parse {} filed in DataLoaderDescription: {}".format(k_observed, self))
def test_yaml_parsers(): plugin = load_plugin("kipoi_veff") assert plugin.ModelParser == get_model_yaml_parser("kipoi_veff") assert plugin.DataloaderParser == get_dataloader_yaml_parser("kipoi_veff") assert get_model_yaml_parser("kipoi_interpret") is None assert get_dataloader_yaml_parser("kipoi_interpret") is None