From f609ed24160db06fa95212d172abc1950fd63ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20NAVARRETE=20GUTI=C3=89RREZ?= Date: Thu, 10 Oct 2024 22:20:23 +0200 Subject: [PATCH] ci-cd: update json file generation --- sentier_vocab/custom_products.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sentier_vocab/custom_products.py b/sentier_vocab/custom_products.py index 3ff69c8..da61415 100644 --- a/sentier_vocab/custom_products.py +++ b/sentier_vocab/custom_products.py @@ -1,24 +1,35 @@ +import json +from pathlib import Path + +from loguru import logger + from sentier_vocab.add_terms import add_custom_terms from sentier_vocab.input.custom_products import CUSTOM_PRODUCTS_DATA from sentier_vocab.input.electricity_model_terms import ELECTRICITY_MODEL_TERMS_DATA from sentier_vocab.input.electricity_products import ELECTRICITY_PRODUCTS_DATA +created_ttls = [] + def add_custom_products(): - out_file = add_custom_terms(CUSTOM_PRODUCTS_DATA, "https://vocab.sentier.dev/products/", "custom-products") + out_file = add_custom_terms( + CUSTOM_PRODUCTS_DATA, "https://vocab.sentier.dev/products/", "custom-products" + ) created_ttls.append( {"graph": "https://vocab.sentier.dev/products/", "ttl_file": str(out_file.name)} - ) -add_custom_terms( + ) + + out_file = add_custom_terms( ELECTRICITY_PRODUCTS_DATA, "https://vocab.sentier.dev/products/electricity/", "electricity-custom-products", ) - out_file = created_ttls.append( + created_ttls.append( {"graph": "https://vocab.sentier.dev/products/", "ttl_file": str(out_file.name)} ) logger.info(f"Added {out_file} to outputs") + out_file = add_custom_terms( ELECTRICITY_MODEL_TERMS_DATA, "https://vocab.sentier.dev/model-terms/emission-factor/",