diff --git a/program/ftot_postprocess.py b/program/ftot_postprocess.py index a3a7b89..6d88bbc 100644 --- a/program/ftot_postprocess.py +++ b/program/ftot_postprocess.py @@ -872,7 +872,9 @@ def make_optimal_scenario_results_db(the_scenario, logger): db_cur = db_con.execute(sql_mode_commodity) mode_and_commodity_list = db_cur.fetchall() - attributes_dict = ftot_supporting_gis.get_commodity_vehicle_attributes_dict(the_scenario, logger) + attributes_dict = ftot_supporting_gis.get_commodity_vehicle_attributes_dict(the_scenario, logger) + + with sqlite3.connect(the_scenario.main_db) as db_con: logger.debug("start: summarize vehicle loads") for row in mode_and_commodity_list: diff --git a/program/ftot_report.py b/program/ftot_report.py index 8dcccc4..2f3a2ca 100644 --- a/program/ftot_report.py +++ b/program/ftot_report.py @@ -737,8 +737,10 @@ def generate_artificial_link_summary(timestamp_directory, the_scenario, logger): db_cur = db_con.execute(sql_mode_commodity) mode_and_commodity_list = db_cur.fetchall() - # use method from ftot_supporting_gis - attributes_dict = get_commodity_vehicle_attributes_dict(the_scenario, logger) + # use method from ftot_supporting_gis + attributes_dict = get_commodity_vehicle_attributes_dict(the_scenario, logger) + + with sqlite3.connect(the_scenario.main_db) as db_con: # CO2 on artificial links only logger.debug("start: summarize emissions for artificial links")