-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcall_national_sweep.py
More file actions
56 lines (49 loc) · 1.61 KB
/
call_national_sweep.py
File metadata and controls
56 lines (49 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import sys
#sys.path.append('')
from dotenv import load_dotenv
import pandas as pd
from hybrid.sites.site_info import SiteInfo
import time
import numpy as np
import warnings
warnings.filterwarnings("ignore")
# import yaml
from national_sweep_optimize import opt_national_sweep
# class call_prelim_opt:
# #Step 1: initialize inputs
# # a: costs
# # b: design
# # c: load profile (opt)
# def __init__(self):
def return_frac_of_sites(sitelistfilepath,start_idx,num_sites):
df=pd.read_pickle(sitelistfilepath).iloc[start_idx:start_idx+num_sites]
return df
hub_height = 100
num_sites = 1354
results_subdir ='100mHubHt_Try01'
parent_path = os.path.abspath('') + '/'
main_dir = parent_path + 'NATIONAL_SWEEP/'
default_input_file = main_dir + 'sweep_defaults.csv'
model_params = pd.read_csv(default_input_file,index_col = 'Variable')
model_params.loc['Hub Height']=hub_height
sitelistfilename = '100mSiteObjs_1354'
opt = opt_national_sweep(model_params)
n_run_at_a_time = 25
num_runs = num_sites//n_run_at_a_time
start_count = 425
for i in range(num_runs):
start = time.perf_counter()
site_df=return_frac_of_sites(main_dir + sitelistfilename,start_count,n_run_at_a_time)
opt.run_all(site_df,hub_height,results_subdir)
end = time.perf_counter()
start_count +=n_run_at_a_time
print("Completed run for chunk {}/{}Took {} minutes".format(i,num_runs,round(end - start, 3)))
[]
[]
#50k points is 2km resolution
#can use 10-50km resolution
#west coast lon = -124.58
#east coast lon = -67.924
#northern lat: 49.54
#southern lat: 25.62533