diff --git a/reV/supply_curve/cli_supply_curve.py b/reV/supply_curve/cli_supply_curve.py index 1ef3566b8..b578f7a30 100644 --- a/reV/supply_curve/cli_supply_curve.py +++ b/reV/supply_curve/cli_supply_curve.py @@ -194,18 +194,24 @@ def direct(ctx, sc_points, trans_table, fixed_charge_rate, sc_features, if isinstance(transmission_costs, str): transmission_costs = dict_str_load(transmission_costs) - if simple: - sc_fun = SupplyCurve.simple - else: - sc_fun = SupplyCurve.full - try: - out = sc_fun(sc_points, trans_table, fixed_charge_rate, - sc_features=sc_features, - transmission_costs=transmission_costs, - line_limited=line_limited, - sort_on=sort_on, wind_dirs=wind_dirs, n_dirs=n_dirs, - downwind=downwind, max_workers=max_workers) + if simple: + out = SupplyCurve.simple(sc_points, trans_table, + fixed_charge_rate, + sc_features=sc_features, + transmission_costs=transmission_costs, + sort_on=sort_on, wind_dirs=wind_dirs, + n_dirs=n_dirs, downwind=downwind, + max_workers=max_workers) + else: + out = SupplyCurve.full(sc_points, trans_table, + fixed_charge_rate, + sc_features=sc_features, + transmission_costs=transmission_costs, + line_limited=line_limited, + sort_on=sort_on, wind_dirs=wind_dirs, + n_dirs=n_dirs, downwind=downwind, + max_workers=max_workers) except Exception as e: logger.exception('Supply curve compute failed. Received the ' 'following error:\n{}'.format(e)) @@ -213,7 +219,7 @@ def direct(ctx, sc_points, trans_table, fixed_charge_rate, sc_features, fn_out = '{}.csv'.format(name) fpath_out = os.path.join(out_dir, fn_out) - out.to_csv(fpath_out) + out.to_csv(fpath_out, index=False) runtime = (time.time() - t0) / 60 logger.info('Supply curve complete. Time elapsed: {:.2f} min. ' @@ -270,8 +276,7 @@ def get_node_cmd(name, sc_points, trans_table, fixed_charge_rate, sc_features, if simple: args += '-s ' - - if line_limited: + elif line_limited: args += '-ll ' if verbose: diff --git a/reV/supply_curve/competitive_wind_farms.py b/reV/supply_curve/competitive_wind_farms.py index f5b888c10..6bf120670 100644 --- a/reV/supply_curve/competitive_wind_farms.py +++ b/reV/supply_curve/competitive_wind_farms.py @@ -36,6 +36,8 @@ def __init__(self, wind_dirs, sc_points, n_dirs=2, offshore=False): self._sc_gids, self._sc_point_gids, self._mask = \ self._parse_sc_points(sc_points, offshore=offshore) + self._offshore = offshore + valid = np.isin(self.sc_point_gids, self._wind_dirs.index) if not np.all(valid): msg = ("'sc_points contains sc_point_gid values that do not " @@ -211,11 +213,13 @@ def _parse_sc_points(sc_points, offshore=False): """ sc_points = CompetitiveWindFarms._parse_table(sc_points) if 'offshore' in sc_points and not offshore: - logger.debug('Not including offshore supply curve points in' + logger.debug('Not including offshore supply curve points in ' 'CompetitiveWindFarm') mask = sc_points['offshore'] == 0 sc_points = sc_points.loc[mask] + mask = np.ones(int(1 + sc_points['sc_point_gid'].max()), dtype=bool) + sc_points = sc_points[['sc_gid', 'sc_point_gid']] sc_gids = sc_points.set_index('sc_gid') sc_gids = {k: int(v[0]) for k, v in sc_gids.iterrows()} @@ -225,8 +229,6 @@ def _parse_sc_points(sc_points, offshore=False): sc_point_gids = {int(k): v['sc_gid'] for k, v in sc_point_gids.iterrows()} - mask = np.ones(int(1 + sc_points['sc_point_gid'].max()), dtype=bool) - return sc_gids, sc_point_gids, mask @staticmethod @@ -405,6 +407,10 @@ def remove_noncompetitive_farm(self, sc_points, sort_on='total_lcoe', wind farms """ sc_points = self._parse_table(sc_points) + if 'offshore' in sc_points and not self._offshore: + mask = sc_points['offshore'] == 0 + sc_points = sc_points.loc[mask] + sc_points = sc_points.sort_values(sort_on) sc_point_gids = sc_points['sc_point_gid'].values.astype(int) @@ -427,8 +433,8 @@ def remove_noncompetitive_farm(self, sc_points, sort_on='total_lcoe', return sc_points.loc[mask].reset_index(drop=True) @classmethod - def run(cls, wind_dirs, sc_points, n_dirs=2, sort_on='total_lcoe', - downwind=False, out_fpath=None): + def run(cls, wind_dirs, sc_points, n_dirs=2, offshore=False, + sort_on='total_lcoe', downwind=False, out_fpath=None): """ Exclude given number of neighboring Supply Point gids based on most prominent wind directions @@ -443,6 +449,9 @@ def run(cls, wind_dirs, sc_points, n_dirs=2, sort_on='total_lcoe', Supply curve point summary table n_dirs : int, optional Number of prominent directions to use, by default 2 + offshore : bool + Flag as to whether offshore farms should be included during + CompetitiveWindFarms sort_on : str, optional column to sort on before excluding neighbors, by default 'total_lcoe' @@ -459,7 +468,7 @@ def run(cls, wind_dirs, sc_points, n_dirs=2, sort_on='total_lcoe', Updated supply curve points after removing non-competative wind farms """ - cwf = cls(wind_dirs, sc_points, n_dirs=n_dirs) + cwf = cls(wind_dirs, sc_points, n_dirs=n_dirs, offshore=offshore) sc_points = cwf.remove_noncompetitive_farm(sc_points, sort_on=sort_on, downwind=downwind) diff --git a/reV/supply_curve/supply_curve.py b/reV/supply_curve/supply_curve.py index bfa1417ce..9132ace4d 100644 --- a/reV/supply_curve/supply_curve.py +++ b/reV/supply_curve/supply_curve.py @@ -16,7 +16,7 @@ from reV.supply_curve.competitive_wind_farms import CompetitiveWindFarms from reV.utilities.exceptions import SupplyCurveInputError, SupplyCurveError -from rex.utilities.execution import SpawnProcessPool +from rex.utilities import parse_table, SpawnProcessPool logger = logging.getLogger(__name__) @@ -100,36 +100,6 @@ def __getitem__(self, gid): return self._sc_points.iloc[i] - @staticmethod - def _load_table(table): - """ - Extract features and their capacity from supply curve transmission - mapping table - - Parameters - ---------- - table : str | pd.DataFrame - Path to .csv or .json or DataFrame to parse - - Returns - ------- - table : pandas.DataFrame - DataFrame extracted from file path - """ - if isinstance(table, str): - if table.endswith('.csv'): - table = pd.read_csv(table) - elif table.endswith('.json'): - table = pd.read_json(table) - else: - raise ValueError('Cannot parse {}'.format(table)) - - elif not isinstance(table, pd.DataFrame): - raise ValueError("Table must be a .csv, .json, or " - "a pandas DataFrame") - - return table - @staticmethod def _parse_sc_points(sc_points, sc_features=None): """ @@ -149,12 +119,12 @@ def _parse_sc_points(sc_points, sc_features=None): DataFrame of supply curve point summary with additional features added if supplied """ - sc_points = SupplyCurve._load_table(sc_points) + sc_points = parse_table(sc_points) logger.debug('Supply curve points table imported with columns: {}' .format(sc_points.columns.values.tolist())) if sc_features is not None: - sc_features = SupplyCurve._load_table(sc_features) + sc_features = parse_table(sc_features) merge_cols = [c for c in sc_features if c in sc_points] sc_points = sc_points.merge(sc_features, on=merge_cols, how='left') @@ -401,7 +371,7 @@ def _parse_trans_table(trans_table): Loaded transmission feature table. """ - trans_table = SupplyCurve._load_table(trans_table) + trans_table = parse_table(trans_table) drop_cols = ['sc_point_gid', 'sc_gid', 'cap_left'] for col in drop_cols: @@ -581,26 +551,19 @@ def _exclude_noncompetitive_wind_farms(self, comp_wind_dirs, sc_gid, gid = comp_wind_dirs.check_sc_gid(sc_gid) if gid is not None: if comp_wind_dirs.mask[gid]: - upwind_gids = comp_wind_dirs['upwind', gid] - for n in upwind_gids: + exclude_gids = comp_wind_dirs['upwind', gid] + if downwind: + exclude_gids = np.append(exclude_gids, + comp_wind_dirs['downwind', gid]) + for n in exclude_gids: check = comp_wind_dirs.exclude_sc_point_gid(n) if check: sc_gids = comp_wind_dirs['sc_gid', n] for sc_id in sc_gids: - logger.debug('Excluding upwind sc_gid {}' - .format(sc_id)) - self._mask[sc_id] = False - - if downwind: - downwind_gids = comp_wind_dirs['downwind', gid] - for n in downwind_gids: - check = comp_wind_dirs.exclude_sc_point_gid(n) - if check: - sc_gids = comp_wind_dirs['sc_gid', n] - for sc_id in sc_gids: - logger.debug('Excluding downind sc_gid {}' - .format(sc_id)) - self._mask[sc_id] = False + if self._mask[sc_id]: + logger.debug('Excluding sc_gid {}' + .format(sc_id)) + self._mask[sc_id] = False return comp_wind_dirs @@ -698,6 +661,7 @@ def _full_sort(self, trans_table, comp_wind_dirs=None, capacities[i]) if connect: connected += 1 + logger.debug('Connecting sc gid {}'.format(sc_gid)) self._mask[sc_gid] = False conn_lists['trans_gid'][sc_gid] = trans_gid @@ -730,7 +694,13 @@ def _full_sort(self, trans_table, comp_wind_dirs=None, connections = connections[columns] connections = connections.reset_index() - unconnected = np.where(self._mask[self._sc_gids])[0].tolist() + sc_gids = self._sc_points['sc_gid'].values + connected = connections['sc_gid'].values + logger.debug('Connected gids {} out of total supply curve gids {}' + .format(len(connected), len(sc_gids))) + unconnected = ~np.isin(sc_gids, connected) + unconnected = sc_gids[unconnected].tolist() + if unconnected: msg = ("{} supply curve points were not connected to tranmission! " "Unconnected sc_gid's: {}" @@ -739,12 +709,8 @@ def _full_sort(self, trans_table, comp_wind_dirs=None, warn(msg) supply_curve = self._sc_points.merge(connections, on='sc_gid') - if comp_wind_dirs is not None: - sc_gids = comp_wind_dirs.sc_gids - mask = supply_curve['sc_gid'].isin(sc_gids) - supply_curve = supply_curve.loc[mask] - return supply_curve + return supply_curve.reset_index(drop=True) def full_sort(self, trans_table=None, sort_on='total_lcoe', columns=('trans_gid', 'trans_capacity', 'trans_type', @@ -819,7 +785,7 @@ def full_sort(self, trans_table=None, sort_on='total_lcoe', total_lcoe_fric=total_lcoe_fric, sort_on=sort_on, columns=columns, downwind=downwind) - supply_curve = supply_curve.reset_index(drop=True) + sum_cols = {'combined_cap_cost': ['array_cable_CAPEX', 'export_cable_CAPEX', 'trans_cap_cost']} @@ -830,7 +796,7 @@ def full_sort(self, trans_table=None, sort_on='total_lcoe', def simple_sort(self, trans_table=None, sort_on='total_lcoe', columns=('trans_gid', 'trans_type', 'lcot', 'total_lcoe', 'trans_cap_cost'), - wind_dirs=None, n_dirs=2, downwind=False): + wind_dirs=None, n_dirs=2, downwind=False, offshore=False): """ Run simple supply curve sorting that does not take into account available capacity @@ -854,6 +820,9 @@ def simple_sort(self, trans_table=None, sort_on='total_lcoe', Number of prominent directions to use, by default 2 downwind : bool, optional Flag to remove downwind neighbors as well as upwind neighbors + offshore : bool + Flag as to whether offshore farms should be included during + CompetitiveWindFarms Returns ------- @@ -882,6 +851,7 @@ def simple_sort(self, trans_table=None, sort_on='total_lcoe', supply_curve = CompetitiveWindFarms.run(wind_dirs, supply_curve, n_dirs=n_dirs, + offshore=offshore, sort_on=sort_on, downwind=downwind) @@ -898,7 +868,8 @@ def full(cls, sc_points, trans_table, fcr, sc_features=None, transmission_costs=None, line_limited=False, sort_on='total_lcoe', columns=('trans_gid', 'trans_capacity', 'trans_type', 'trans_cap_cost', 'dist_mi', 'lcot', 'total_lcoe'), - max_workers=None, wind_dirs=None, n_dirs=2, downwind=False): + max_workers=None, wind_dirs=None, n_dirs=2, downwind=False, + offshore=False): """ Run full supply curve taking into account available capacity of tranmission features when making connections. @@ -940,6 +911,9 @@ def full(cls, sc_points, trans_table, fcr, sc_features=None, Number of prominent directions to use, by default 2 downwind : bool, optional Flag to remove downwind neighbors as well as upwind neighbors + offshore : bool + Flag as to whether offshore farms should be included during + CompetitiveWindFarms Returns ------- @@ -952,7 +926,7 @@ def full(cls, sc_points, trans_table, fcr, sc_features=None, line_limited=line_limited, max_workers=max_workers) supply_curve = sc.full_sort(sort_on=sort_on, columns=columns, wind_dirs=wind_dirs, n_dirs=n_dirs, - downwind=downwind) + downwind=downwind, offshore=offshore) return supply_curve @@ -961,7 +935,8 @@ def simple(cls, sc_points, trans_table, fcr, sc_features=None, transmission_costs=None, sort_on='total_lcoe', columns=('trans_gid', 'trans_type', 'lcot', 'total_lcoe', 'trans_cap_cost'), - max_workers=None, wind_dirs=None, n_dirs=2, downwind=False): + max_workers=None, wind_dirs=None, n_dirs=2, downwind=False, + offshore=False): """ Run simple supply curve by connecting to the cheapest tranmission feature. @@ -1000,6 +975,9 @@ def simple(cls, sc_points, trans_table, fcr, sc_features=None, Number of prominent directions to use, by default 2 downwind : bool, optional Flag to remove downwind neighbors as well as upwind neighbors + offshore : bool + Flag as to whether offshore farms should be included during + CompetitiveWindFarms Returns ------- @@ -1012,6 +990,6 @@ def simple(cls, sc_points, trans_table, fcr, sc_features=None, max_workers=max_workers) supply_curve = sc.simple_sort(sort_on=sort_on, columns=columns, wind_dirs=wind_dirs, n_dirs=n_dirs, - downwind=downwind) + downwind=downwind, offshore=offshore) return supply_curve diff --git a/tests/data/comp_wind_farms/sc_full_downwind.csv b/tests/data/comp_wind_farms/sc_full_downwind.csv index 93a6eb4df..3417ffc94 100644 --- a/tests/data/comp_wind_farms/sc_full_downwind.csv +++ b/tests/data/comp_wind_farms/sc_full_downwind.csv @@ -37,6 +37,7 @@ sc_gid,res_gids,gen_gids,gid_counts,n_gids,mean_cf,mean_lcoe,mean_res,capacity,a 69,"[1322779, 1323717, 1324853, 1322992, 1323587, 1325752]","[89, 108, 119, 94, 105, 133]","[67.0, 251.0, 44.0, 12.0, 121.0, 73.0]",568,0.12795598804950714,119.26293182373048,4.037088394165038,165.62879999999996,4.6008,41.63000106811523,-71.52999877929688,United States,Rhode Island,Kent,88.14166259765625,-5,2.627016305923462,40.0,2.0,117,7,5,1,1.0,68927.0,407.25,Substation,4530.984375,4.48098434189115,0.4042293612561689,119.66716118498665 72,[1328393],[160],[40.0],40,0.125,124.8421859741211,3.9260001182556152,11.663999999999998,0.32399999999999995,41.63000106811523,-71.39099884033203,United States,Rhode Island,Washington,13.800000190734865,-5,2.3171226978302,29.0,2.0,119,7,7,0,1.0,47926.0,15.0,TransLine,7114.9873046875,6.914987111762249,0.6497705189604738,125.49195649308157 73,[1327670],[154],[109.0],109,0.12800002098083496,120.3904037475586,4.030999660491943,31.7844,0.8828999999999999,41.63000106811523,-71.39099884033203,United States,Rhode Island,Washington,10.947368621826172,-5,2.2437584400177,29.0,2.0,119,7,7,1,1.0,68927.0,407.25,Substation,5863.9658203125,5.813965795611991,0.5229706320699864,120.91337437962858 +75,[1335726],[181],[30.0],31,0.1300000250339508,118.75968933105469,4.104001045227052,9.0396,0.2511,41.63000106811523,-71.18399810791016,United States,Rhode Island,Newport,45.2400016784668,-5,2.6573445796966557,3.0,2.0,122,7,10,1,1.0,69116.0,22.5,Substation,1047.6053466796875,0.9976053900570309,0.09199202320006614,118.85168135425475 77,[1318383],[39],[14.0],14,0.12699998915195465,121.6649398803711,4.033000469207764,4.0824,0.1134,41.57799911499024,-71.66799926757812,United States,Rhode Island,Kent,111.9000015258789,-5,3.165879487991333,1.0,2.0,131,8,3,1,1.0,68954.0,7.5,Substation,10132.7001953125,10.082700576784099,0.9107882160162798,122.57572809638738 79,"[1323587, 1325752, 1323586, 1325750, 1323131]","[105, 133, 104, 132, 97]","[21.0, 37.0, 111.0, 94.0, 5.0]",268,0.1288246065378189,119.0018081665039,4.0587124824523935,78.1488,2.1708,41.57799911499024,-71.52999877929688,United States,Rhode Island,Washington,75.71800231933594,-5,2.6481242179870605,1.0,2.0,133,8,5,1,1.0,68927.0,407.25,Substation,7730.15869140625,7.680158661537349,0.6849919673711395,119.68680013387504 83,"[1333850, 1333856, 1332502]","[178, 179, 171]","[2.0, 128.0, 3.0]",137,0.1309172809123993,119.08048248291016,4.10382604598999,39.9492,1.1097,41.57799911499024,-71.25299835205078,United States,Rhode Island,Newport,33.96825408935547,-5,3.3769621849060063,24.0,2.0,137,8,9,1,1.0,69107.0,130.5,Substation,7513.71044921875,7.46371062154455,0.6551690375959147,119.73565152050607 @@ -49,7 +50,10 @@ sc_gid,res_gids,gen_gids,gid_counts,n_gids,mean_cf,mean_lcoe,mean_res,capacity,a 99,"[1320894, 1319508, 1319175, 1321975, 1319579]","[71, 51, 46, 78, 54]","[2.0, 44.0, 13.0, 6.0, 8.0]",73,0.12719178199768064,120.999267578125,4.0699729919433585,21.2868,0.5912999999999999,41.474998474121094,-71.66799926757812,United States,Rhode Island,Washington,44.00400161743164,-5,2.656401395797729,30.0,2.0,163,10,3,1,1.0,47922.0,31.5,TransLine,13423.5244140625,13.2235240074055,1.2047679093371573,122.20403548746216 102,"[1326266, 1325749, 1326763, 1325415]","[135, 131, 144, 127]","[155.0, 22.0, 147.0, 5.0]",380,0.12999999523162842,118.69474029541016,4.085507869720459,110.808,3.0780000000000003,41.474998474121094,-71.46099853515625,United States,Rhode Island,Washington,35.25749969482422,-5,2.6192328929901123,12.0,2.0,166,10,6,1,1.0,68927.0,407.25,Substation,14465.7685546875,14.41576856894,1.270264275866703,119.96500457127686 105,[1332514],[173],[8.0],250,0.12700000405311584,122.65933227539062,4.004000186920166,72.89999999999998,2.025,41.4739990234375,-71.25399780273438,United States,Rhode Island,Newport,20.578947067260746,-5,0.7052849531173706,4.0,2.0,169,10,9,1,1.0,69085.0,189.0,Substation,16823.611328125,16.7736114150263,1.5122075579435088,124.17153983333414 +109,"[1319579, 1321975, 1319672, 1320843]","[54, 78, 56, 67]","[46.0, 2.0, 14.0, 22.0]",84,0.12826189398765564,120.93048095703124,4.0876426696777335,24.4944,0.6804,41.42300033569336,-71.66699981689453,United States,Rhode Island,Washington,39.02000045776367,-5,2.8279712200164795,2.0,2.0,179,11,3,1,1.0,43448.0,378.0,TransLine,20644.15234375,20.4441519351921,1.8373644563302105,122.76784541336144 111,"[1324024, 1325415, 1324385, 1325951, 1322907]","[111, 127, 114, 134, 93]","[70.0, 16.0, 212.0, 61.0, 13.0]",372,0.12996505200862885,118.45469665527344,4.103295803070068,108.4752,3.0132,41.42300033569336,-71.52999877929688,United States,Rhode Island,Washington,30.782001495361328,-5,2.6370327472686768,12.0,2.0,181,11,5,1,1.0,68927.0,407.25,Substation,18199.958984375,18.1499587314082,1.5985997313332707,120.0532963866067 +113,"[1316348, 1316429, 1314973, 1314958]","[2, 5, 1, 0]","[34.0, 89.0, 67.0, 15.0]",209,0.1274341493844986,121.18006896972656,4.085513114929198,60.9444,1.6928999999999998,41.37099838256836,-71.80500030517578,United States,Rhode Island,Washington,22.395790100097656,-5,2.552753210067749,6.0,2.0,193,12,1,1,1.0,43418.0,117.0,TransLine,31242.365234375,31.042364315917002,2.7986847501646928,123.97875371989126 +114,"[1316348, 1318158, 1316429, 1317598, 1318341]","[2, 34, 5, 31, 37]","[28.0, 3.0, 3.0, 184.0, 16.0]",251,0.12866663932800293,120.28498840332031,4.121812820434569,73.1916,2.0331,41.37099838256836,-71.73600006103516,United States,Rhode Island,Washington,30.229999542236328,-5,2.6575350761413574,6.0,2.0,194,12,2,1,1.0,43419.0,117.0,TransLine,26505.40234375,26.305402082399997,2.3516048392195987,122.63659324253992 115,[1319790],[59],[416.0],416,0.125,125.85134887695312,3.984000205993652,121.30559999999998,3.3696,41.37099838256836,-71.66699981689453,United States,Rhode Island,Washington,18.07999992370605,-5,1.8465117216110232,2.0,2.0,195,12,3,0,1.0,80843.0,,PCALoadCen,29045.71484375,28.9457143394672,2.652576742651256,128.5039256196044 116,"[1321073, 1318341]","[73, 37]","[18.0, 66.0]",127,0.12735716998577118,121.65518188476562,4.091785907745361,37.0332,1.0287,41.37099838256836,-71.66699981689453,United States,Rhode Island,Washington,18.92954635620117,-5,2.791832447052002,2.0,2.0,195,12,3,1,1.0,43418.0,117.0,TransLine,27675.76171875,27.4757624271102,2.4806876047030912,124.13586948946872 119,[1323025],[95],[36.0],36,0.125,125.01075744628906,3.997999906539917,10.497599999999998,0.2916,41.37099838256836,-71.52999877929688,United States,Rhode Island,Washington,13.470588684082033,-5,2.68419885635376,12.0,2.0,197,12,5,0,1.0,80855.0,12.299999999999999,LoadCen,13870.7421875,13.8607417512551,1.266734446347032,126.27749189263609 @@ -57,3 +61,4 @@ sc_gid,res_gids,gen_gids,gid_counts,n_gids,mean_cf,mean_lcoe,mean_res,capacity,a 122,[1314958],[0],[4.0],7,0.12700000405311584,122.04087829589844,4.0399999618530265,2.0412,0.0567,41.31900024414063,-71.87300109863281,United States,Rhode Island,Washington,15.263157844543455,-5,2.318667411804199,6.0,2.0,208,13,0,1,1.0,80851.0,8.4,LoadCen,4825.49755859375,4.81549759526675,0.43374479449329906,122.47462309039173 123,"[1316747, 1314958]","[13, 0]","[84.0, 120.0]",204,0.12699998915195465,121.39640808105469,4.048235893249512,59.4864,1.6524,41.31900024414063,-71.80500030517578,United States,Rhode Island,Washington,15.866872787475586,-5,2.5956122875213623,6.0,2.0,209,13,1,1,1.0,68942.0,175.5,Substation,34796.890625,34.746890854463395,3.127754562804605,124.5241626438593 126,[1323129],[96],[19.0],24,0.13199999928474426,117.9526596069336,4.0899996757507315,6.998399999999998,0.1944,41.21500015258789,-71.52899932861328,United States,Rhode Island,None,6.785714149475098,-5,0.032254558056592934,27.0,2.0,245,15,5,1,1.0,47843.0,18.0,TransLine,16394.291015625,16.1942908328871,1.417798780641911,119.37045838757551 +128,[1322857],[92],[5.0],28,0.1330000013113022,116.6462173461914,4.119999885559082,8.1648,0.2268,41.16400146484375,-71.52899932861328,United States,Rhode Island,Washington,23.0,-5,0.05076904967427254,27.0,2.0,261,16,5,1,1.0,47843.0,18.0,TransLine,19860.28515625,19.660285724371,1.7046284760463188,118.35084582223773 diff --git a/tests/data/comp_wind_farms/sc_full_upwind.csv b/tests/data/comp_wind_farms/sc_full_upwind.csv index 3c7472886..8a6f47b2d 100644 --- a/tests/data/comp_wind_farms/sc_full_upwind.csv +++ b/tests/data/comp_wind_farms/sc_full_upwind.csv @@ -1,39 +1,71 @@ sc_gid,res_gids,gen_gids,gid_counts,n_gids,mean_cf,mean_lcoe,mean_res,capacity,area_sq_km,latitude,longitude,country,state,county,elevation,timezone,pct_slope,reeds_region,padus,sc_point_gid,sc_row_ind,sc_col_ind,res_class,transmission_multiplier,trans_gid,trans_capacity,trans_type,trans_cap_cost,dist_mi,lcot,total_lcoe 0,[1316631],[7],[2.0],2,0.12399999797344208,124.00283813476562,3.990999937057495,0.5831999999999999,0.0162,41.99300003051758,-71.80799865722656,United States,Rhode Island,Providence,194.63999938964844,-5,2.6557598114013667,31.0,2.0,1,0,1,0,2.25,43413.0,378.0,TransLine,5753.69482421875,2.4683087448279504,0.5296891260120432,124.53252726077767 +1,[1318507],[40],[3.0],18,0.12399999052286148,123.88894653320312,4.000999927520752,5.248799999999999,0.1458,41.99300003051758,-71.73799896240234,United States,Rhode Island,Providence,135.30000305175778,-5,1.3927282094955444,31.0,2.0,2,0,2,1,2.25,43413.0,378.0,TransLine,1254.159423828125,0.468515325964581,0.11545879045681177,124.00440532365994 3,"[1322761, 1322531, 1321872]","[88, 85, 76]","[40.0, 7.0, 6.0]",75,0.12400001287460327,122.74934387207031,4.026075839996338,21.87,0.6074999999999999,41.99300003051758,-71.5989990234375,United States,Rhode Island,Providence,99.6399917602539,-5,2.8970715999603267,11.0,2.0,4,0,4,1,2.25,43440.0,378.0,TransLine,1062.3775634765625,0.383278926450897,0.09780319615497843,122.8471470682253 +5,"[1322761, 1324549, 1325125, 1323879, 1322531]","[88, 116, 123, 110, 85]","[1.0, 24.0, 22.0, 34.0, 14.0]",95,0.1246105208992958,122.2333755493164,4.0215468406677255,27.702,0.7695,41.99300003051758,-71.52999877929688,United States,Rhode Island,Providence,88.5719985961914,-5,2.9391584396362305,11.0,2.0,5,0,5,1,2.25,43424.0,117.0,TransLine,1858.7222900390625,0.7372099170564741,0.1702768905400148,122.40365243985642 +7,"[1326337, 1328195, 1325125, 1327465, 1327023]","[139, 159, 123, 151, 147]","[45.0, 8.0, 1.0, 29.0, 11.0]",94,0.12490426003932953,122.06692504882812,4.017690658569337,27.4104,0.7614,41.99300003051758,-71.45999908447266,United States,Rhode Island,Providence,86.09199523925781,-5,3.0588090419769287,9.0,2.0,6,0,6,1,2.25,43431.0,117.0,TransLine,896.1426391601562,0.309396726201638,0.08190224235877978,122.1488272911869 9,[1316636],[8],[37.0],37,0.12400000542402267,123.7449188232422,3.996000051498413,10.7892,0.2997,41.941001892089844,-71.80799865722656,United States,Rhode Island,Providence,192.6000061035156,-5,3.3951504230499268,35.0,2.0,17,1,1,0,1.0,68784.0,378.0,Substation,618.241455078125,0.5682414571540171,0.056915730930948,123.80183455417315 +12,"[1320695, 1318658]","[65, 41]","[5.0, 5.0]",10,0.12399999052286148,123.09645080566406,4.0290002822875985,2.9159999999999995,0.08099999999999999,41.941001892089844,-71.66899871826172,United States,Rhode Island,Providence,143.3562469482422,-5,2.9158215522766118,31.0,2.0,19,1,3,1,1.0,68838.0,21.75,Substation,3837.773681640625,3.78777376377602,0.3533081120186362,123.4497589176827 +13,"[1322531, 1321903, 1322539]","[85, 77, 86]","[21.0, 21.0, 25.0]",67,0.12437312304973602,122.77610778808594,4.0268964767456055,19.5372,0.5427,41.941001892089844,-71.5989990234375,United States,Rhode Island,Providence,121.09000396728516,-5,2.740012884140014,35.0,2.0,20,1,4,1,1.0,43439.0,43.5,TransLine,1902.573974609375,1.70257403232914,0.17462680685746254,122.9507345949434 +14,"[1322531, 1323879, 1325125, 1323872, 1325269, 1322539]","[85, 110, 123, 109, 125, 86]","[4.0, 37.0, 2.0, 17.0, 51.0, 1.0]",112,0.12509821355342865,121.89188385009766,4.024116516113281,32.6592,0.9072,41.941001892089844,-71.52999877929688,United States,Rhode Island,Providence,105.3912582397461,-5,2.849443197250366,36.0,2.0,21,1,5,1,1.0,43430.0,43.5,TransLine,2028.5611572265625,1.8285611756636102,0.18511129154655717,122.07699514164422 17,"[1316636, 1316414, 1316416]","[8, 3, 4]","[20.0, 3.0, 2.0]",25,0.12399999797344208,123.88001251220705,3.9958002567291264,7.289999999999999,0.2025,41.88899993896485,-71.80699920654297,United States,Rhode Island,Providence,195.7466583251953,-5,2.6578214168548584,35.0,2.0,33,2,1,0,1.0,68784.0,378.0,Substation,3939.165283203125,3.88916540243335,0.36264227137804583,124.2426547835851 +18,"[1318658, 1317037, 1317475, 1319098, 1319097]","[41, 20, 29, 45, 44]","[22.0, 7.0, 72.0, 124.0, 8.0]",233,0.12399998307228087,123.08216857910156,4.022953510284424,67.9428,1.8873,41.88899993896485,-71.73799896240234,United States,Rhode Island,Providence,171.37649536132812,-5,3.004549503326416,35.0,2.0,34,2,2,1,1.0,68784.0,378.0,Substation,4979.759765625,4.92975988742343,0.4584401703552166,123.54060874945678 +20,"[1321903, 1322022, 1323276]","[77, 81, 101]","[33.0, 130.0, 6.0]",169,0.12480474263429643,122.31550598144531,4.036633014678955,49.2804,1.3689,41.88999938964844,-71.5989990234375,United States,Rhode Island,Providence,140.83999633789062,-5,2.9703657627105717,35.0,2.0,36,2,4,1,1.0,43451.0,378.0,TransLine,5329.10009765625,5.129100165715309,0.48743723598624045,122.80294321743155 +21,"[1323276, 1323684, 1325653, 1323263, 1323683]","[101, 107, 130, 100, 106]","[8.0, 100.0, 12.0, 2.0, 17.0]",139,0.125,121.71656036376952,4.0426902770996085,40.5324,1.1259,41.88999938964844,-71.52999877929688,United States,Rhode Island,Providence,101.7199935913086,-5,2.594797134399414,36.0,2.0,37,2,5,1,1.0,43420.0,117.0,TransLine,236.36669921875,0.0363667039085275,0.021586000973775506,121.73814636474329 23,"[1327467, 1327686, 1329568, 1327763, 1329567]","[152, 155, 163, 156, 162]","[9.0, 45.0, 20.0, 23.0, 17.0]",114,0.1246754229068756,123.23019409179688,4.0182456970214835,33.2424,0.9234,41.88999938964844,-71.39099884033203,United States,Rhode Island,Providence,39.30799865722656,-5,2.6569621562957764,7.0,2.0,39,2,7,1,1.0,80849.0,33.9,LoadCen,1251.2340087890625,1.24123400729044,0.11456543270959509,123.34475952450647 25,[1316416],[4],[9.0],9,0.12399999052286148,124.18778228759766,3.997999906539917,2.6244,0.07289999999999999,41.83700180053711,-71.80699920654297,United States,Rhode Island,Providence,210.0399932861328,-5,3.108460664749145,34.0,2.0,49,3,1,0,1.0,68784.0,378.0,Substation,7503.06689453125,7.4530666609025005,0.6907375524791978,124.87851984007685 26,[1316748],[14],[136.0],150,0.12400000542402267,123.3012237548828,4.0159993171691895,43.74,1.215,41.83700180053711,-71.80699920654297,United States,Rhode Island,Providence,208.75999450683597,-5,2.3195979595184326,34.0,2.0,49,3,1,1,1.0,68784.0,378.0,Substation,7503.06689453125,7.4530666609025005,0.6907374694728173,123.99196122435562 +28,"[1317494, 1319097, 1317375, 1319194]","[30, 44, 27, 48]","[91.0, 1.0, 7.0, 41.0]",140,0.12499286234378815,122.9398193359375,4.029085636138916,40.824,1.1340000000000001,41.8380012512207,-71.73799896240234,United States,Rhode Island,Providence,165.49249267578125,-5,2.7623326778411865,34.0,2.0,50,3,2,1,1.0,68784.0,378.0,Substation,8100.59912109375,8.05059904237869,0.7398230087666983,123.67964234470419 +29,"[1319539, 1322010, 1319967]","[52, 79, 61]","[10.0, 30.0, 15.0]",55,0.1252727210521698,122.43793487548828,4.056454658508302,16.037999999999997,0.4455,41.8380012512207,-71.66799926757812,United States,Rhode Island,Providence,162.413330078125,-5,3.177010059356689,15.0,2.0,51,3,3,1,1.0,68901.0,138.75,Substation,7775.77783203125,7.7257779390773,0.7085707930553258,123.14650566854361 +31,"[1323683, 1325650, 1325499, 1324107]","[106, 129, 128, 112]","[183.0, 1.0, 20.0, 49.0]",253,0.12573914229869845,121.18431854248048,4.05478572845459,73.77479999999998,2.0493,41.8380012512207,-71.52999877929688,United States,Rhode Island,Providence,89.69499969482422,-5,3.0292208194732666,10.0,2.0,53,3,5,1,2.25,43420.0,117.0,TransLine,877.8457641601562,0.301264784432907,0.07969730176240276,121.26401584424289 33,"[1327763, 1329567, 1327951, 1329775]","[156, 162, 158, 164]","[15.0, 14.0, 6.0, 18.0]",53,0.12428302317857742,123.5050048828125,4.011490345001222,15.4548,0.4293,41.8380012512207,-71.39099884033203,United States,Rhode Island,Providence,24.76291656494141,-5,2.3697705268859863,8.0,2.0,55,3,7,1,2.25,68959.0,58.5,Substation,2277.522216796875,0.990009862816322,0.2091927931563309,123.71419767596883 35,"[1316748, 1316770]","[14, 17]","[23.0, 21.0]",44,0.12400000542402267,123.28600311279295,4.020294666290283,12.8304,0.3564,41.78499984741211,-71.80699920654297,United States,Rhode Island,Providence,195.25999450683597,-5,2.458043336868286,34.0,2.0,65,4,1,1,1.0,68784.0,378.0,Substation,11076.81640625,11.0268165726443,1.0197392769302003,124.30574238972315 39,"[1322360, 1324108]","[84, 113]","[13.0, 73.0]",86,0.12669764459133148,121.20907592773438,4.064069747924806,25.0776,0.6966,41.7859992980957,-71.52999877929688,United States,Rhode Island,Providence,118.62000274658205,-5,3.130956649780273,17.0,2.0,69,4,5,1,1.0,43423.0,117.0,TransLine,556.2551879882812,0.35625518067976103,0.05011888807279241,121.25919481580716 41,[1330678],[167],[6.0],6,0.12400000542402267,124.1031494140625,3.996000051498413,1.7495999999999998,0.0486,41.7859992980957,-71.39099884033203,United States,Rhode Island,Providence,16.15999984741211,-5,1.5256010293960571,37.0,2.0,71,4,7,0,1.0,43437.0,43.5,TransLine,1804.881103515625,1.60488115375296,0.16615858880946038,124.26930800287197 42,"[1327951, 1329775, 1327946]","[158, 164, 157]","[27.0, 33.0, 190.0]",262,0.12399999797344208,123.45364379882812,4.016528606414795,76.3992,2.1222,41.7859992980957,-71.39099884033203,United States,Rhode Island,Providence,17.817222595214844,-5,2.439574241638184,8.0,2.0,71,4,7,1,1.0,43443.0,117.0,TransLine,2224.418212890625,2.02441812109245,0.20478146806664999,123.65842526689478 44,"[1316770, 1316772]","[17, 18]","[79.0, 3.0]",82,0.12407317757606505,123.20441436767578,4.025000095367432,23.9112,0.6642,41.73400115966797,-71.80699920654297,United States,Rhode Island,Providence,172.47999572753906,-5,2.606196880340576,34.0,2.0,81,5,1,1,1.0,68784.0,378.0,Substation,14653.1865234375,14.603186321900699,1.3481868554477254,124.5526012231235 +45,"[1317401, 1317956, 1318373, 1318119]","[28, 32, 38, 33]","[2.0, 46.0, 58.0, 13.0]",119,0.12657982110977173,121.07318115234376,4.036218166351318,34.7004,0.9639,41.73400115966797,-71.73699951171875,United States,Rhode Island,Providence,167.86062622070312,-5,2.70615553855896,13.0,2.0,82,5,2,1,1.0,68905.0,138.75,Substation,12390.513671875,12.3405139561391,1.117431052955148,122.19061220529892 47,"[1322021, 1322851, 1321085, 1321125, 1322740]","[80, 91, 74, 75, 87]","[2.0, 63.0, 21.0, 4.0, 7.0]",97,0.12695874273777008,120.64743041992188,4.053752422332764,28.2852,0.7857,41.73400115966797,-71.5989990234375,United States,Rhode Island,Providence,103.9020004272461,-5,3.2170712947845463,13.0,2.0,84,5,4,1,2.25,43918.0,43.5,TransLine,13112.3916015625,5.73884087974759,1.1790037426288298,121.82643416255071 +48,"[1324108, 1322360, 1324887, 1324559, 1325238, 1322851, 1322740, 1323522]","[113, 84, 120, 117, 124, 91, 87, 102]","[64.0, 1.0, 5.0, 108.0, 28.0, 13.0, 5.0, 11.0]",235,0.12807658314704895,119.32720184326172,4.0600929260253915,68.52600000000001,1.9035,41.73400115966797,-71.52999877929688,United States,Rhode Island,Providence,91.5615692138672,-5,2.910207271575928,17.0,2.0,85,5,5,1,2.25,43448.0,378.0,TransLine,2061.7666015625,0.8274518307980742,0.18376621657207212,119.51096805983379 50,"[1330678, 1329322]","[167, 161]","[3.0, 17.0]",20,0.12655001878738406,122.17268371582031,3.975600004196167,5.831999999999999,0.16199999999999998,41.73400115966797,-71.39099884033203,United States,Rhode Island,Kent,16.710433959960938,-5,2.0886797904968257,38.0,2.0,87,5,7,0,2.25,80845.0,40.5,LoadCen,3319.75732421875,1.47100323028689,0.2994608311195788,122.47214454693989 51,"[1327946, 1327608]","[157, 153]","[15.0, 22.0]",114,0.1263783574104309,121.40017700195312,4.0207839012146005,33.2424,0.9234,41.73400115966797,-71.39099884033203,United States,Rhode Island,Kent,17.264999389648438,-5,1.5032036304473877,38.0,2.0,87,5,7,1,2.25,80843.0,,PCALoadCen,7243.513671875,3.1748948793625997,0.6542933087899735,122.0544703107431 +53,[1332121],[170],[4.0],207,0.12800000607967374,120.3709716796875,4.024000167846681,60.3612,1.6767,41.73400115966797,-71.3219985961914,United States,Rhode Island,None,8.800000190734863,-5,2.1658296585083012,20.0,2.0,88,5,8,1,2.25,43415.0,117.0,TransLine,14059.76953125,6.15989736731929,1.2539034513507958,121.6248751310383 +54,"[1333080, 1332121]","[175, 170]","[154.0, 6.0]",210,0.12800000607967374,120.60383605957031,4.030737400054932,61.236000000000004,1.7009999999999998,41.73400115966797,-71.25299835205078,United States,Rhode Island,Bristol,9.575000762939453,-5,1.985644578933716,21.0,2.0,89,5,9,1,2.25,43428.0,378.0,TransLine,7995.1767578125,3.46452299684641,0.7130401525223508,121.31687621209267 55,"[1316584, 1316721]","[6, 11]","[3.0, 112.0]",116,0.12697389721870422,121.45254516601562,4.0337910652160645,33.8256,0.9396,41.68199920654297,-71.80599975585938,United States,Rhode Island,Kent,125.77999877929688,-5,2.6640024185180664,13.0,2.0,97,6,1,1,2.25,68905.0,138.75,Substation,38585.5546875,17.1269133079663,3.4690150704446916,124.92156023646032 +56,"[1318119, 1316584, 1319394, 1316721, 1319447, 1317014]","[33, 6, 49, 11, 50, 19]","[24.0, 3.0, 15.0, 86.0, 54.0, 11.0]",193,0.12698444724082947,121.28839111328124,4.036990165710448,56.2788,1.5633,41.68199920654297,-71.73699951171875,United States,Rhode Island,Kent,145.5916748046875,-5,2.811396598815918,13.0,2.0,98,6,2,1,1.0,68905.0,138.75,Substation,14153.697265625,14.1036975750938,1.2723754199162725,122.56076653319751 58,"[1321125, 1322740, 1321009, 1322779]","[75, 87, 72, 89]","[114.0, 54.0, 216.0, 7.0]",391,0.12698207795619965,121.68164825439452,4.032593727111816,114.0156,3.1671,41.68199920654297,-71.5989990234375,United States,Rhode Island,Kent,95.99000549316406,-5,2.529214859008789,13.0,2.0,100,6,4,1,2.25,80843.0,,PCALoadCen,21308.720703125,9.426097806145071,1.9156265218856199,123.59727477628013 +59,"[1323522, 1322740, 1325336, 1322779, 1323717, 1324853]","[102, 87, 126, 89, 108, 119]","[56.0, 27.0, 9.0, 14.0, 29.0, 1.0]",136,0.12759558856487274,119.80059814453124,4.042051315307616,39.6576,1.1016,41.68199920654297,-71.52999877929688,United States,Rhode Island,Kent,79.3166732788086,-5,2.37872314453125,13.0,2.0,101,6,5,1,1.0,43448.0,378.0,TransLine,2520.482666015625,2.3204826176392297,0.22549864888699858,120.02609679341823 61,[1329322],[161],[57.0],57,0.12699998915195465,121.83202362060548,3.971999883651733,16.6212,0.4617,41.68199920654297,-71.39099884033203,United States,Rhode Island,Kent,17.260869979858402,-5,1.9112753868103027,38.0,2.0,103,6,7,0,1.0,68927.0,407.25,Substation,4563.06298828125,4.5130631973279005,0.4101556321758439,122.24217925278133 62,[1327670],[154],[8.0],111,0.12800000607967374,120.39039611816406,4.0310001373291025,32.3676,0.8990999999999999,41.68199920654297,-71.39099884033203,United States,Rhode Island,Washington,10.947368621826172,-5,2.504257202148437,38.0,2.0,103,6,7,1,1.0,80845.0,40.5,LoadCen,2679.638671875,2.66963866451991,0.23898032111506487,120.62937643927913 +64,"[1333081, 1332121, 1332697]","[176, 170, 174]","[69.0, 16.0, 32.0]",144,0.12827348709106445,120.5862808227539,4.023735046386719,41.9904,1.1664,41.68199920654297,-71.25299835205078,United States,Rhode Island,Bristol,16.161806106567386,-5,2.5884075164794917,20.0,2.0,105,6,9,1,1.0,43414.0,43.5,TransLine,1357.8687744140625,1.1578688190759598,0.12084169375874797,120.70712251651265 65,[1316721],[11],[17.0],17,0.12700000405311584,121.45680236816406,4.0339999198913565,4.9571999999999985,0.1377,41.63000106811523,-71.80599975585938,United States,Rhode Island,Kent,123.76000213623048,-5,3.017388105392456,40.0,2.0,113,7,1,1,2.25,43448.0,378.0,TransLine,37207.953125,16.4479795371698,3.3444749680092767,124.80127733617334 +66,"[1319447, 1317014]","[50, 19]","[5.0, 2.0]",7,0.12699998915195465,121.21698760986328,4.043999671936035,2.0412,0.0567,41.63000106811523,-71.73699951171875,United States,Rhode Island,Kent,154.22999572753906,-5,2.6274335384368896,40.0,2.0,114,7,2,1,1.0,47843.0,18.0,TransLine,12999.80078125,12.7998007842392,1.1685005335457845,122.38548814340906 +67,"[1320643, 1319447, 1320852]","[63, 50, 70]","[33.0, 2.0, 9.0]",44,0.12699998915195465,121.3245849609375,4.039590835571288,12.8304,0.3564,41.63000106811523,-71.66799926757812,United States,Rhode Island,Kent,143.1133270263672,-5,3.0499482154846187,40.0,2.0,115,7,3,1,1.0,80854.0,13.799999999999999,LoadCen,9255.7509765625,9.24575139469194,0.8319627632202846,122.15654772415779 +69,"[1322779, 1323717, 1324853, 1322992, 1323587, 1325752]","[89, 108, 119, 94, 105, 133]","[67.0, 251.0, 44.0, 12.0, 121.0, 73.0]",568,0.12795598804950714,119.26293182373048,4.037088394165038,165.62879999999996,4.6008,41.63000106811523,-71.52999877929688,United States,Rhode Island,Kent,88.14166259765625,-5,2.627016305923462,40.0,2.0,117,7,5,1,1.0,68927.0,407.25,Substation,4530.984375,4.48098434189115,0.4042293612561689,119.66716118498665 72,[1328393],[160],[40.0],40,0.125,124.8421859741211,3.9260001182556152,11.663999999999998,0.32399999999999995,41.63000106811523,-71.39099884033203,United States,Rhode Island,Washington,13.800000190734865,-5,2.3171226978302,29.0,2.0,119,7,7,0,1.0,47926.0,15.0,TransLine,7114.9873046875,6.914987111762249,0.6497705189604738,125.49195649308157 73,[1327670],[154],[109.0],109,0.12800002098083496,120.3904037475586,4.030999660491943,31.7844,0.8828999999999999,41.63000106811523,-71.39099884033203,United States,Rhode Island,Washington,10.947368621826172,-5,2.2437584400177,29.0,2.0,119,7,7,1,1.0,68929.0,138.75,Substation,6260.4169921875,6.21041687584602,0.5583276116540976,120.94873135921269 74,[1333850],[178],[3.0],5,0.12999999523162842,120.03134155273438,4.079999923706056,1.4579999999999995,0.0405,41.63000106811523,-71.25299835205078,United States,Rhode Island,Newport,22.90476226806641,-5,3.505939483642578,24.0,2.0,121,7,9,1,1.0,47931.0,15.0,TransLine,530.8727416992188,0.33087271443863897,0.04661685845273095,120.07795841118711 +75,[1335726],[181],[30.0],31,0.1300000250339508,118.75968933105469,4.104001045227052,9.0396,0.2511,41.63000106811523,-71.18399810791016,United States,Rhode Island,Newport,45.2400016784668,-5,2.6573445796966557,3.0,2.0,122,7,10,1,1.0,69116.0,22.5,Substation,1047.6053466796875,0.9976053900570309,0.09199202320006614,118.85168135425475 +76,"[1316712, 1316642, 1317140]","[10, 9, 25]","[6.0, 1.0, 35.0]",42,0.12699998915195465,121.5307159423828,4.049262046813965,12.2472,0.3402,41.57799911499024,-71.73699951171875,United States,Rhode Island,Washington,111.15999603271484,-5,3.346097707748413,1.0,2.0,130,8,2,1,1.0,47919.0,15.0,TransLine,13802.0615234375,13.602061780251699,1.2406125684498543,122.77132851083265 79,"[1323587, 1325752, 1323586, 1325750, 1323131]","[105, 133, 104, 132, 97]","[21.0, 37.0, 111.0, 94.0, 5.0]",268,0.1288246065378189,119.0018081665039,4.0587124824523935,78.1488,2.1708,41.57799911499024,-71.52999877929688,United States,Rhode Island,Washington,75.71800231933594,-5,2.6481242179870605,1.0,2.0,133,8,5,1,1.0,68927.0,407.25,Substation,7730.15869140625,7.680158661537349,0.6849919673711395,119.68680013387504 83,"[1333850, 1333856, 1332502]","[178, 179, 171]","[2.0, 128.0, 3.0]",137,0.1309172809123993,119.08048248291016,4.10382604598999,39.9492,1.1097,41.57799911499024,-71.25299835205078,United States,Rhode Island,Newport,33.96825408935547,-5,3.3769621849060063,24.0,2.0,137,8,9,1,1.0,69107.0,130.5,Substation,7513.71044921875,7.46371062154455,0.6551690375959147,119.73565152050607 +84,"[1335726, 1335742, 1337197]","[181, 183, 187]","[49.0, 210.0, 8.0]",405,0.13002994656562805,118.77490234375,4.104150295257568,118.098,3.2805,41.57799911499024,-71.18399810791016,United States,Rhode Island,Newport,37.92000198364258,-5,1.5623930692672732,3.0,2.0,138,8,10,1,1.0,69085.0,189.0,Substation,9356.369140625,9.30636893312628,0.8214097469824586,119.59631209073245 86,[1316764],[16],[31.0],31,0.12800000607967374,120.87117004394531,4.078000545501709,9.0396,0.2511,41.5260009765625,-71.80599975585938,United States,Rhode Island,Washington,105.5999984741211,-5,3.1201190948486333,28.0,2.0,145,9,1,1,1.0,47922.0,31.5,TransLine,17661.77734375,17.461778181953303,1.575144166029951,122.44631420997527 89,"[1323131, 1320850, 1323133, 1320894, 1323139]","[97, 69, 98, 71, 99]","[1.0, 81.0, 434.0, 38.0, 121.0]",675,0.1268799901008606,121.9178466796875,4.042473793029785,196.83,5.4674999999999985,41.527000427246094,-71.5989990234375,United States,Rhode Island,Washington,70.093994140625,-5,2.799856662750244,1.0,2.0,148,9,4,1,1.0,80843.0,,PCALoadCen,17798.6171875,17.6986171851566,1.6013601400239232,123.51920681971143 +90,"[1323131, 1325750, 1323586, 1323133, 1324965, 1324391, 1323139, 1325749, 1323585]","[97, 132, 104, 98, 121, 115, 99, 131, 103]","[5.0, 1.0, 2.0, 21.0, 204.0, 3.0, 4.0, 39.0, 18.0]",297,0.12966667115688324,119.59071350097656,4.0724711418151855,86.6052,2.4057,41.527000427246094,-71.52999877929688,United States,Rhode Island,Washington,59.18527603149414,-5,2.8259580135345463,29.0,2.0,149,9,5,1,1.0,68929.0,138.75,Substation,12145.498046875,12.0954981005402,1.0692588676875674,120.65997236866413 92,"[1329875, 1329876]","[165, 166]","[262.0, 20.0]",315,0.1289999932050705,120.03125,4.058568000793457,91.854,2.5515,41.527000427246094,-71.39199829101562,United States,Rhode Island,Newport,18.79166603088379,-5,2.661834955215454,25.0,2.0,151,9,7,1,1.0,68942.0,175.5,Substation,15209.0537109375,15.1590539696946,1.34588640722434,121.37713640722434 +93,"[1332502, 1332504, 1332514]","[171, 172, 173]","[24.0, 30.0, 13.0]",67,0.12959700822830197,119.9215850830078,4.073133945465088,19.5372,0.5427,41.5260009765625,-71.322998046875,United States,Rhode Island,Newport,24.592981338500977,-5,2.67724347114563,4.0,2.0,152,9,8,1,1.0,69075.0,22.5,Substation,6321.75,6.271749997775119,0.5568500035879246,120.47843508659572 +94,"[1332502, 1333856, 1332504, 1333846]","[171, 179, 172, 177]","[2.0, 2.0, 26.0, 338.0]",412,0.1319728046655655,117.94115447998048,4.1428751945495605,120.1392,3.3372,41.5260009765625,-71.25399780273438,United States,Rhode Island,Newport,41.4375,-5,2.75262188911438,4.0,2.0,153,9,9,1,1.0,69107.0,130.5,Substation,10713.228515625,10.6632281148582,0.9266843443291974,118.86783882430969 +96,"[1337197, 1337193]","[187, 186]","[8.0, 94.0]",177,0.13007843494415286,118.46939849853516,4.102549076080321,51.6132,1.4337,41.5260009765625,-71.11599731445312,United States,Rhode Island,Newport,37.30500030517578,-5,2.45177960395813,22.0,2.0,155,9,11,1,1.0,69107.0,130.5,Substation,10439.1962890625,10.389195811075199,0.9161312021822791,119.38552970071744 97,[1316764],[16],[2.0],2,0.12800000607967374,120.87120056152344,4.078000068664552,0.5831999999999999,0.0162,41.4739990234375,-71.80500030517578,United States,Rhode Island,Washington,105.5999984741211,-5,2.696624755859375,28.0,2.0,161,10,1,1,1.0,47843.0,18.0,TransLine,4473.77587890625,4.27377595158775,0.39898827477957893,121.27018883630302 99,"[1320894, 1319508, 1319175, 1321975, 1319579]","[71, 51, 46, 78, 54]","[2.0, 44.0, 13.0, 6.0, 8.0]",73,0.12719178199768064,120.999267578125,4.0699729919433585,21.2868,0.5912999999999999,41.474998474121094,-71.66799926757812,United States,Rhode Island,Washington,44.00400161743164,-5,2.656401395797729,30.0,2.0,163,10,3,1,1.0,47922.0,31.5,TransLine,13423.5244140625,13.2235240074055,1.2047679093371573,122.20403548746216 +101,"[1323585, 1323139, 1325749, 1324024, 1325415]","[103, 99, 131, 111, 127]","[81.0, 17.0, 58.0, 55.0, 71.0]",282,0.1298191398382187,118.70182037353516,4.094712734222412,82.23119999999999,2.2842,41.474998474121094,-71.52999877929688,United States,Rhode Island,Washington,42.75,-5,2.8545379638671875,12.0,2.0,165,10,5,1,1.0,68927.0,407.25,Substation,14666.966796875,14.616967117229303,1.2897260391639314,119.9915464126991 +102,"[1326266, 1325749, 1326763, 1325415]","[135, 131, 144, 127]","[155.0, 22.0, 147.0, 5.0]",380,0.12999999523162842,118.69474029541016,4.085507869720459,110.808,3.0780000000000003,41.474998474121094,-71.46099853515625,United States,Rhode Island,Washington,35.25749969482422,-5,2.6192328929901123,12.0,2.0,166,10,6,1,1.0,68927.0,407.25,Substation,14465.7685546875,14.41576856894,1.270264275866703,119.96500457127686 107,[1316348],[2],[34.0],49,0.12699998915195465,121.4473114013672,4.076000213623047,14.2884,0.3969,41.42200088500977,-71.80500030517578,United States,Rhode Island,Washington,31.36000061035156,-5,2.817620754241944,28.0,2.0,177,11,1,1,1.0,68927.0,407.25,Substation,24727.626953125,24.677626274596896,2.222668272507614,123.66997967387482 109,"[1319579, 1321975, 1319672, 1320843]","[54, 78, 56, 67]","[46.0, 2.0, 14.0, 22.0]",84,0.12826189398765564,120.93048095703124,4.0876426696777335,24.4944,0.6804,41.42300033569336,-71.66699981689453,United States,Rhode Island,Washington,39.02000045776367,-5,2.8279712200164795,2.0,2.0,179,11,3,1,1.0,43418.0,117.0,TransLine,24438.3671875,24.238366276476697,2.175055896420153,123.10553685345138 111,"[1324024, 1325415, 1324385, 1325951, 1322907]","[111, 127, 114, 134, 93]","[70.0, 16.0, 212.0, 61.0, 13.0]",372,0.12996505200862885,118.45469665527344,4.103295803070068,108.4752,3.0132,41.42300033569336,-71.52999877929688,United States,Rhode Island,Washington,30.782001495361328,-5,2.6370327472686768,12.0,2.0,181,11,5,1,1.0,43416.0,378.0,TransLine,18349.958984375,18.1499587314082,1.611775033005982,120.06647168827942 113,"[1316348, 1316429, 1314973, 1314958]","[2, 5, 1, 0]","[34.0, 89.0, 67.0, 15.0]",209,0.1274341493844986,121.18006896972656,4.085513114929198,60.9444,1.6928999999999998,41.37099838256836,-71.80500030517578,United States,Rhode Island,Washington,22.395790100097656,-5,2.552753210067749,6.0,2.0,193,12,1,1,1.0,80843.0,,PCALoadCen,32565.416015625,32.4654167575825,2.9172034568189473,124.09727242654552 +114,"[1316348, 1318158, 1316429, 1317598, 1318341]","[2, 34, 5, 31, 37]","[28.0, 3.0, 3.0, 184.0, 16.0]",251,0.12866663932800293,120.28498840332031,4.121812820434569,73.1916,2.0331,41.37099838256836,-71.73600006103516,United States,Rhode Island,Washington,30.229999542236328,-5,2.6575350761413574,6.0,2.0,194,12,2,1,1.0,80843.0,,PCALoadCen,30646.994140625,30.546994761474,2.7190539730178442,123.00404237633816 115,[1319790],[59],[416.0],416,0.125,125.85134887695312,3.984000205993652,121.30559999999998,3.3696,41.37099838256836,-71.66699981689453,United States,Rhode Island,Washington,18.07999992370605,-5,1.8465117216110232,2.0,2.0,195,12,3,0,1.0,80843.0,,PCALoadCen,29045.71484375,28.9457143394672,2.652576742651256,128.5039256196044 116,"[1321073, 1318341]","[73, 37]","[18.0, 66.0]",127,0.12735716998577118,121.65518188476562,4.091785907745361,37.0332,1.0287,41.37099838256836,-71.66699981689453,United States,Rhode Island,Washington,18.92954635620117,-5,2.791832447052002,2.0,2.0,195,12,3,1,1.0,80843.0,,PCALoadCen,29045.71484375,28.9457143394672,2.6034819466265735,124.2586638313922 119,[1323025],[95],[36.0],36,0.125,125.01075744628906,3.997999906539917,10.497599999999998,0.2916,41.37099838256836,-71.52999877929688,United States,Rhode Island,Washington,13.470588684082033,-5,2.68419885635376,12.0,2.0,197,12,5,0,1.0,80855.0,12.299999999999999,LoadCen,13870.7421875,13.8607417512551,1.266734446347032,126.27749189263609 @@ -41,4 +73,6 @@ sc_gid,res_gids,gen_gids,gid_counts,n_gids,mean_cf,mean_lcoe,mean_res,capacity,a 122,[1314958],[0],[4.0],7,0.12700000405311584,122.04087829589844,4.0399999618530265,2.0412,0.0567,41.31900024414063,-71.87300109863281,United States,Rhode Island,Washington,15.263157844543455,-5,2.318667411804199,6.0,2.0,208,13,0,1,1.0,80851.0,8.4,LoadCen,4825.49755859375,4.81549759526675,0.43374479449329906,122.47462309039173 123,"[1316747, 1314958]","[13, 0]","[84.0, 120.0]",204,0.12699998915195465,121.39640808105469,4.048235893249512,59.4864,1.6524,41.31900024414063,-71.80500030517578,United States,Rhode Island,Washington,15.866872787475586,-5,2.5956122875213623,6.0,2.0,209,13,1,1,1.0,80843.0,,PCALoadCen,35552.77734375,35.452775516189604,3.1956981768551214,124.5921062579098 125,[1323129],[96],[203.0],204,0.13199998438358307,117.95265197753906,4.0900001525878915,59.4864,1.6524,41.21500015258789,-71.5979995727539,United States,Rhode Island,None,6.785714149475098,-5,0.1630154550075531,27.0,2.0,244,15,4,1,1.0,68929.0,138.75,Substation,33891.1796875,33.8411802261233,2.9309519171817033,120.88360389472076 +126,[1323129],[96],[19.0],24,0.13199999928474426,117.9526596069336,4.0899996757507315,6.998399999999998,0.1944,41.21500015258789,-71.52899932861328,United States,Rhode Island,None,6.785714149475098,-5,0.032254558056592934,27.0,2.0,245,15,5,1,1.0,47843.0,18.0,TransLine,16394.291015625,16.1942908328871,1.417798780641911,119.37045838757551 127,[1322857],[92],[272.0],392,0.13300001621246338,116.64622497558594,4.119999408721924,114.3072,3.1752,41.16400146484375,-71.5979995727539,United States,Rhode Island,Washington,23.0,-5,0.021250182762742043,27.0,2.0,260,16,4,1,1.0,68927.0,407.25,Substation,36436.90625,36.386905510929395,3.127416340224507,119.77364131581045 +128,[1322857],[92],[5.0],28,0.1330000013113022,116.6462173461914,4.119999885559082,8.1648,0.2268,41.16400146484375,-71.52899932861328,United States,Rhode Island,Washington,23.0,-5,0.05076904967427254,27.0,2.0,261,16,5,1,1.0,47843.0,18.0,TransLine,19860.28515625,19.660285724371,1.7046284760463188,118.35084582223773 diff --git a/tests/test_supply_curve_wind_dirs.py b/tests/test_supply_curve_wind_dirs.py index a53164575..6c19c5614 100644 --- a/tests/test_supply_curve_wind_dirs.py +++ b/tests/test_supply_curve_wind_dirs.py @@ -89,11 +89,12 @@ def test_upwind_exclusion(): sc_out = os.path.join(TESTDATADIR, 'comp_wind_farms', 'sc_full_upwind.csv') - sc_out = pd.read_csv(sc_out) + sc_out = pd.read_csv(sc_out).sort_values('total_lcoe') sc_point_gids = sc_out['sc_point_gid'].values.tolist() - - for sc_gid in sc_out['sc_gid'].values: + for _, row in sc_out.iterrows(): + sc_gid = row['sc_gid'] + sc_point_gids.remove(row['sc_point_gid']) sc_point_gid = cwf['sc_point_gid', sc_gid] for gid in cwf['upwind', sc_point_gid]: msg = 'Upwind gid {} was not excluded!'.format(gid) @@ -108,11 +109,12 @@ def test_upwind_downwind_exclusion(): sc_out = os.path.join(TESTDATADIR, 'comp_wind_farms', 'sc_full_downwind.csv') - sc_out = pd.read_csv(sc_out) + sc_out = pd.read_csv(sc_out).sort_values('total_lcoe') sc_point_gids = sc_out['sc_point_gid'].values.tolist() - - for sc_gid in sc_out['sc_gid'].values: + for _, row in sc_out.iterrows(): + sc_gid = row['sc_gid'] + sc_point_gids.remove(row['sc_point_gid']) sc_point_gid = cwf['sc_point_gid', sc_gid] for gid in cwf['upwind', sc_point_gid]: msg = 'Upwind gid {} was not excluded!'.format(gid)