Project-AutoML/automl/params.py [46:72]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @staticmethod
    def parse_file(path):
        path = path or ""
        if not path.strip():
            return {}
        with open(path, "r") as r_f:
            params = json.load(r_f)
        return params

    @staticmethod
    def parse_param_str(param_str):
        param_str = param_str or ""
        if not param_str.strip():
            return {}
        name_value_pairs = param_str.split(";")
        pairs = []
        for name_value_pair in name_value_pairs:
            if not name_value_pair.strip():
                continue
            k_v = name_value_pair.split("=")
            if len(k_v) != 2:
                warnings.warn(f"{name_value_pair} error, will be ignore")
                continue
            key, value = name_value_pair.split("=")
            pairs.append((key.strip(), value.strip()))
        params = dict(pairs)
        return params
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



Project-BasicAlgorithm/core/training/params.py [94:120]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @staticmethod
    def parse_file(path):
        path = path or ""
        if not path.strip():
            return {}
        with open(path, "r") as r_f:
            params = json.load(r_f)
        return params

    @staticmethod
    def parse_param_str(param_str):
        param_str = param_str or ""
        if not param_str.strip():
            return {}
        name_value_pairs = param_str.split(";")
        pairs = []
        for name_value_pair in name_value_pairs:
            if not name_value_pair.strip():
                continue
            k_v = name_value_pair.split("=")
            if len(k_v) != 2:
                warnings.warn(f"{name_value_pair} error, will be ignore")
                continue
            key, value = name_value_pair.split("=")
            pairs.append((key.strip(), value.strip()))
        params = dict(pairs)
        return params
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



