移除--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

26
main.py
View File

@@ -410,11 +410,8 @@ def main():
show_window = '--show' in sys.argv # 检查是否包含--show参数
display_only = '--display-only' in sys.argv # 检查是否只显示不保存
if command == '--yearly':
print("生成8760小时全年数据...")
solar_output, wind_output, thermal_output, load_demand = generate_yearly_data()
print(f"数据长度: {len(solar_output)} 小时")
elif command == '--excel':
if command == '--excel':
if len(sys.argv) < 3:
print("错误请指定Excel文件路径")
print("用法python main.py --excel <文件路径>")
@@ -513,22 +510,7 @@ def main():
available_wind_energy=1200.0
)
# 对于 --yearly 参数,也需要设置默认参数
if command == '--yearly':
params = SystemParameters(
max_curtailment_wind=0.1,
max_curtailment_solar=0.1,
max_grid_ratio=0.2,
storage_efficiency=0.9,
discharge_rate=1.0,
charge_rate=1.0,
rated_thermal_capacity=100.0,
rated_solar_capacity=100.0,
rated_wind_capacity=100.0,
available_thermal_energy=2400.0,
available_solar_energy=600.0,
available_wind_energy=1200.0
)
# 显示当前使用的系统参数
print("\n=== 当前使用的系统参数 ===")
@@ -576,7 +558,7 @@ def print_usage():
print("多能互补系统储能容量优化程序")
print("\n使用方法:")
print(" python main.py --excel <文件路径> # 从Excel文件读取数据")
print(" python main.py --yearly # 使用8760小时全年数据")
print(" python main.py --create-template [类型] # 创建Excel模板(24或8760)")
print(" python main.py # 使用24小时示例数据")
print(" python main.py --show # 显示图形窗口(可与其他参数组合使用)")