Closed WesIngwersen closed 5 years ago
import electricitylci
from electricitylci.utils import fill_default_provider_uuids
all_generation_db = electricitylci.get_generation_process_df()
all_gen_dict = electricitylci.write_generation_process_database_to_dict(all_generation_db)
all_gen_mix_db = electricitylci.get_generation_mix_process_df() all_gen_mix_dict = electricitylci.write_generation_mix_database_to_dict(all_gen_mix_db,all_gen_dict)
all_gen_dict = fill_default_provider_uuids(all_gen_dict)
Actually I found, using your modified build_model.py example, that adding the code
all_gen_dict=electricitylci.write_process_dicts_to_jsonld(all_gen_dict)
before
all_gen_mix_dict = electricitylci.write_generation_mix_database_to_dict(all_gen_mix_db,all_gen_dict)
modifies the dict to add the uuid
field, so then it no longer causes the error.
Closing the issue
Using the model config that recreates the old EPA ELCI_3, it works except the generation_mix dictionary is not being written. The attached script shows the errors.
Changes were made to the olcaschema_genmix function including a matching_dict check which looks up processes in the process dictionaries matching by name. It finds processes but those processes do not have a
uuid
field. I guess that there was a change at some point to add theuuid
field to the generation process dictionaries before JSON-LD creation? Previously, the process UUIDs were not created until the JSON-LD files were created in olca_jsonld_writer.