2022-01-26 23:22:43 +01:00
|
|
|
from data_loader.types import DataCollection
|
2022-01-04 11:44:35 +01:00
|
|
|
|
2022-02-17 19:22:17 +01:00
|
|
|
|
2022-01-04 11:44:35 +01:00
|
|
|
def hash_data_config(data_config: dict) -> str:
|
2022-02-17 19:22:17 +01:00
|
|
|
def hash_data_collection(data_collection: DataCollection) -> str:
|
2022-03-10 20:00:06 +01:00
|
|
|
return "".join([a.path + a.file_name for a in data_collection])
|
2022-02-17 19:22:17 +01:00
|
|
|
|
|
|
|
|
def hash_feature_extractors(feature_extractos) -> str:
|
|
|
|
|
return "".join([f[0] for f in feature_extractos])
|
|
|
|
|
|
|
|
|
|
def to_str(x):
|
|
|
|
|
return "".join([str(i) for i in x])
|
|
|
|
|
|
|
|
|
|
return "_".join(
|
|
|
|
|
to_str(
|
|
|
|
|
[
|
|
|
|
|
hash_data_collection(data_config["assets"]),
|
|
|
|
|
hash_data_collection(data_config["other_assets"]),
|
|
|
|
|
hash_data_collection(data_config["exogenous_data"]),
|
2022-03-10 20:00:06 +01:00
|
|
|
data_config["target_asset"].path
|
|
|
|
|
+ data_config["target_asset"].file_name,
|
2022-02-17 19:22:17 +01:00
|
|
|
data_config["load_non_target_asset"],
|
|
|
|
|
hash_feature_extractors(data_config["own_features"]),
|
|
|
|
|
hash_feature_extractors(data_config["other_features"]),
|
|
|
|
|
hash_feature_extractors(data_config["exogenous_features"]),
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
)
|