mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-16 04:18:07 +00:00
chore(Linter): reformatted code with black (#211)
* chore(Linter): reformatted code with black * Create black.yaml
This commit is contained in:
+24
-15
@@ -1,18 +1,27 @@
|
||||
|
||||
from data_loader.types import DataCollection
|
||||
|
||||
|
||||
def hash_data_config(data_config: dict) -> str:
|
||||
|
||||
def hash_data_collection(data_collection: DataCollection) -> str: return ''.join([a[0] + a[1] for a in data_collection])
|
||||
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']),
|
||||
data_config['target_asset'][0] + data_config['target_asset'][1],
|
||||
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']),
|
||||
]))
|
||||
def hash_data_collection(data_collection: DataCollection) -> str:
|
||||
return "".join([a[0] + a[1] for a in data_collection])
|
||||
|
||||
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"]),
|
||||
data_config["target_asset"][0] + data_config["target_asset"][1],
|
||||
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"]),
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user