(d)
return pipeline_configs
Given directory, returns generated pipeline config dictionaries. Each entry
    has structure:
    'name': string
    'pipeline': sklearn.BaseEstimator
    'paradigms': list of class names that are compatible with said pipeline
Given directory, returns generated pipeline config dictionaries. Each entry
    has structure:
    'name': string
    'pipeline': sklearn.BaseEstimator
    'paradigms': list of class names that are compatible with said pipeline
Given directory returns generated pipeline config dictionaries . Each entry has structure : name : string pipeline : sklearn . BaseEstimator paradigms : list of class names that are compatible with said pipeline
def parse_pipelines_from_directory(d):
    """
    Given directory, returns generated pipeline config dictionaries. Each entry
    has structure:
    'name': string
    'pipeline': sklearn.BaseEstimator
    'paradigms': list of class names that are compatible with said pipeline
    """
    assert os.path.isdir(
        os.path.abspath(d)
    ), "Given pipeline path {} is not valid".format(d)

    # get list of config files
    yaml_files = glob(os.path.join(d, "*.yml"))

    pipeline_configs = []
    for yaml_file in yaml_files:
        with open(yaml_file, "r") as _file:
            content = _file.read()

            # load config
            config_dict = yaml.load(content, Loader=yaml.FullLoader)
            ppl = create_pipeline_from_config(config_dict["pipeline"])
            pipeline_configs.append(
                {
                    "paradigms": config_dict["paradigms"],
                    "pipeline": ppl,
                    "name": config_dict["name"],
                }
            )

    # we can do the same for python defined pipeline
    python_files = glob(os.path.join(d, "*.py"))

    for python_file in python_files:
        spec = importlib.util.spec_from_file_location("custom", python_file)
        foo = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(foo)

        pipeline_configs.append(foo.PIPELINE)
    return pipeline_configs
def parse_pipelines_from_directory ( d ) : assert os . path . isdir ( os . path . abspath ( d ) ) , "Given pipeline path {} is not valid" . format ( d ) # get list of config files yaml_files = glob ( os . path . join ( d , "*.yml" ) ) pipeline_configs = [ ] for yaml_file in yaml_files : with open ( yaml_file , "r" ) as _file : content = _file . read ( ) # load config config_dict = yaml . load ( content , Loader = yaml . FullLoader ) ppl = create_pipeline_from_config ( config_dict [ "pipeline" ] ) pipeline_configs . append ( { "paradigms" : config_dict [ "paradigms" ] , "pipeline" : ppl , "name" : config_dict [ "name" ] , } ) # we can do the same for python defined pipeline python_files = glob ( os . path . join ( d , "*.py" ) ) for python_file in python_files : spec = importlib . util . spec_from_file_location ( "custom" , python_file ) foo = importlib . util . module_from_spec ( spec ) spec . loader . exec_module ( foo ) pipeline_configs . append ( foo . PIPELINE ) return pipeline_configs