移除--yearly参数。

This commit is contained in:
dmy
2025-12-26 09:22:56 +08:00
parent 269e985d83
commit 53b23490ae
3 changed files with 30 additions and 40 deletions

View File

@@ -110,20 +110,28 @@ def read_system_parameters(file_path: str) -> SystemParameters:
max_storage_capacity = None
try:
# 获取各参数值区分None、NaN、0和有效值
def get_param_with_default(param_name, default_value):
value = get_param_value(param_name)
if value is None or pd.isna(value):
return default_value
else:
return value
return SystemParameters(
max_curtailment_wind=get_param_value('最大弃风率') or 0.1,
max_curtailment_solar=get_param_value('最大弃光率') or 0.1,
max_grid_ratio=get_param_value('最大上网电量比例') or 0.2,
storage_efficiency=get_param_value('储能效率') or 0.9,
discharge_rate=get_param_value('放电倍率') or 1.0,
charge_rate=get_param_value('充电倍率') or 1.0,
max_curtailment_wind=get_param_with_default('最大弃风率', 0.1),
max_curtailment_solar=get_param_with_default('最大弃光率', 0.1),
max_grid_ratio=get_param_with_default('最大上网电量比例', 0.2),
storage_efficiency=get_param_with_default('储能效率', 0.9),
discharge_rate=get_param_with_default('放电倍率', 1.0),
charge_rate=get_param_with_default('充电倍率', 1.0),
max_storage_capacity=max_storage_capacity,
rated_thermal_capacity=get_param_value('额定火电装机容量') or 100.0,
rated_solar_capacity=get_param_value('额定光伏装机容量') or 100.0,
rated_wind_capacity=get_param_value('额定风电装机容量') or 100.0,
available_thermal_energy=get_param_value('火电可用发电量') or 2400.0,
available_solar_energy=get_param_value('光伏可用发电量') or 600.0,
available_wind_energy=get_param_value('风电可用发电量') or 1200.0
rated_thermal_capacity=get_param_with_default('额定火电装机容量', 100.0),
rated_solar_capacity=get_param_with_default('额定光伏装机容量', 100.0),
rated_wind_capacity=get_param_with_default('额定风电装机容量', 100.0),
available_thermal_energy=get_param_with_default('火电可用发电量', 2400.0),
available_solar_energy=get_param_with_default('光伏可用发电量', 600.0),
available_wind_energy=get_param_with_default('风电可用发电量', 1200.0)
)
except (KeyError, IndexError, Exception) as e:
print(f"读取参数失败:{str(e)},使用默认参数")
@@ -307,7 +315,7 @@ def create_excel_template(file_path: str, data_type: str = "8760"):
1.0, # 放电倍率
1.0, # 充电倍率
'', # 最大储能容量(空表示无限制)
100.0, # 额定火电装机容量
0.0, # 额定火电装机容量可以为0
100.0, # 额定光伏装机容量
100.0, # 额定风电装机容量
2400.0, # 火电可用发电量
@@ -322,7 +330,7 @@ def create_excel_template(file_path: str, data_type: str = "8760"):
'储能放电倍率C-rate>0',
'储能充电倍率C-rate>0',
'储能容量上限MWh空表示无限制',
'额定火电装机容量MW',
'额定火电装机容量MW可以为0',
'额定光伏装机容量MW',
'额定风电装机容量MW',
'火电可用发电量MWh',
@@ -337,7 +345,7 @@ def create_excel_template(file_path: str, data_type: str = "8760"):
'>0',
'>0',
'>0或空',
'>0',
'0',
'>0',
'>0',
'≥0',
@@ -352,7 +360,7 @@ def create_excel_template(file_path: str, data_type: str = "8760"):
'1.0',
'1.0',
'无限制',
'100.0',
'0.0',
'100.0',
'100.0',
'2400.0',