@@ -681,6 +681,7 @@ def summarize_results(
681681 availability_iteration ,
682682 subproblem ,
683683 stage ,
684+ skip_quick_summary ,
684685 summary_results_file ,
685686):
686687 """
@@ -691,58 +692,60 @@ def summarize_results(
691692 :param summary_results_file:
692693 :return:
693694 """
695+ if not skip_quick_summary :
696+ # Get the results CSV as dataframe
697+ capacity_results_agg_df = read_results_file_generic (
698+ scenario_directory = scenario_directory ,
699+ weather_iteration = weather_iteration ,
700+ hydro_iteration = hydro_iteration ,
701+ availability_iteration = availability_iteration ,
702+ subproblem = subproblem ,
703+ stage = stage ,
704+ capacity_type = Path (__file__ ).stem ,
705+ )
694706
695- # Get the results CSV as dataframe
696- capacity_results_agg_df = read_results_file_generic (
697- scenario_directory = scenario_directory ,
698- weather_iteration = weather_iteration ,
699- hydro_iteration = hydro_iteration ,
700- availability_iteration = availability_iteration ,
701- subproblem = subproblem ,
702- stage = stage ,
703- capacity_type = Path (__file__ ).stem ,
704- )
705-
706- # Get all technologies with new build production OR release OR energy capacity
707- new_build_df = pd .DataFrame (
708- capacity_results_agg_df [
709- (capacity_results_agg_df ["new_fuel_prod_capacity_fuelunitperhour" ] > 0 )
710- | (capacity_results_agg_df ["new_fuel_rel_capacity_fuelunitperhour" ] > 0 )
711- | (capacity_results_agg_df ["new_fuel_stor_capacity_fuelunit" ] > 0 )
712- ][
713- [
714- "new_fuel_prod_capacity_fuelunitperhour" ,
715- "new_fuel_rel_capacity_fuelunitperhour" ,
716- "new_fuel_stor_capacity_fuelunit" ,
707+ # Get all technologies with new build production OR release OR energy capacity
708+ new_build_df = pd .DataFrame (
709+ capacity_results_agg_df [
710+ (capacity_results_agg_df ["new_fuel_prod_capacity_fuelunitperhour" ] > 0 )
711+ | (capacity_results_agg_df ["new_fuel_rel_capacity_fuelunitperhour" ] > 0 )
712+ | (capacity_results_agg_df ["new_fuel_stor_capacity_fuelunit" ] > 0 )
713+ ][
714+ [
715+ "new_fuel_prod_capacity_fuelunitperhour" ,
716+ "new_fuel_rel_capacity_fuelunitperhour" ,
717+ "new_fuel_stor_capacity_fuelunit" ,
718+ ]
717719 ]
718- ]
719- )
720+ )
720721
721- # Get the units from the units.csv file
722- power_unit , energy_unit , fuel_unit = get_units (scenario_directory )
722+ # Get the units from the units.csv file
723+ power_unit , energy_unit , fuel_unit = get_units (scenario_directory )
723724
724- # Rename column header
725- columns = [
726- "New Fuel Production Capacity ({} per hour)" .format (fuel_unit ),
727- "New Fuel Release Capacity ({} per hour)" .format (fuel_unit ),
728- "New Fuel Storage Capacity ({})" .format (fuel_unit ),
729- ]
725+ # Rename column header
726+ columns = [
727+ "New Fuel Production Capacity ({} per hour)" .format (fuel_unit ),
728+ "New Fuel Release Capacity ({} per hour)" .format (fuel_unit ),
729+ "New Fuel Storage Capacity ({})" .format (fuel_unit ),
730+ ]
731+
732+ write_summary_results_generic (
733+ results_df = new_build_df ,
734+ columns = columns ,
735+ summary_results_file = summary_results_file ,
736+ title = "New Fuel Production, Release, and Storage Capacity" ,
737+ empty_title = "No new fuel production was built." ,
738+ )
730739
731- write_summary_results_generic (
732- results_df = new_build_df ,
733- columns = columns ,
734- summary_results_file = summary_results_file ,
735- title = "New Fuel Production, Release, and Storage Capacity" ,
736- empty_title = "No new fuel production was built." ,
737- )
738-
739- with open (summary_results_file , "a" ) as outfile :
740- outfile .write ("\n --> New Fuel Production, Release, and Storage Capacity <--\n " )
741- if new_build_df .empty :
742- outfile .write ("No new fuel production was built.\n " )
743- else :
744- new_build_df .to_string (outfile , float_format = "{:,.2f}" .format )
745- outfile .write ("\n " )
740+ with open (summary_results_file , "a" ) as outfile :
741+ outfile .write (
742+ "\n --> New Fuel Production, Release, and Storage Capacity <--\n "
743+ )
744+ if new_build_df .empty :
745+ outfile .write ("No new fuel production was built.\n " )
746+ else :
747+ new_build_df .to_string (outfile , float_format = "{:,.2f}" .format )
748+ outfile .write ("\n " )
746749
747750
748751# Database
0 commit comments