NREL-reV 0.8.7__py3-none-any.whl → 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/METADATA +13 -10
  2. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/RECORD +43 -43
  3. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/WHEEL +1 -1
  4. reV/SAM/SAM.py +217 -133
  5. reV/SAM/econ.py +18 -14
  6. reV/SAM/generation.py +611 -422
  7. reV/SAM/windbos.py +93 -79
  8. reV/bespoke/bespoke.py +681 -377
  9. reV/bespoke/cli_bespoke.py +2 -0
  10. reV/bespoke/place_turbines.py +187 -43
  11. reV/config/output_request.py +2 -1
  12. reV/config/project_points.py +218 -140
  13. reV/econ/econ.py +166 -114
  14. reV/econ/economies_of_scale.py +91 -45
  15. reV/generation/base.py +331 -184
  16. reV/generation/generation.py +326 -200
  17. reV/generation/output_attributes/lcoe_fcr_inputs.json +38 -3
  18. reV/handlers/__init__.py +0 -1
  19. reV/handlers/exclusions.py +16 -15
  20. reV/handlers/multi_year.py +57 -26
  21. reV/handlers/outputs.py +6 -5
  22. reV/handlers/transmission.py +44 -27
  23. reV/hybrids/hybrid_methods.py +30 -30
  24. reV/hybrids/hybrids.py +305 -189
  25. reV/nrwal/nrwal.py +262 -168
  26. reV/qa_qc/cli_qa_qc.py +14 -10
  27. reV/qa_qc/qa_qc.py +217 -119
  28. reV/qa_qc/summary.py +228 -146
  29. reV/rep_profiles/rep_profiles.py +349 -230
  30. reV/supply_curve/aggregation.py +349 -188
  31. reV/supply_curve/competitive_wind_farms.py +90 -48
  32. reV/supply_curve/exclusions.py +138 -85
  33. reV/supply_curve/extent.py +75 -50
  34. reV/supply_curve/points.py +735 -390
  35. reV/supply_curve/sc_aggregation.py +357 -248
  36. reV/supply_curve/supply_curve.py +604 -347
  37. reV/supply_curve/tech_mapping.py +144 -82
  38. reV/utilities/__init__.py +274 -16
  39. reV/utilities/pytest_utils.py +8 -4
  40. reV/version.py +1 -1
  41. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/LICENSE +0 -0
  42. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/entry_points.txt +0 -0
  43. {NREL_reV-0.8.7.dist-info → NREL_reV-0.9.0.dist-info}/top_level.txt +0 -0
@@ -2,15 +2,17 @@
2
2
  """
3
3
  reV supply curve extent
4
4
  """
5
+
5
6
  import logging
7
+
6
8
  import numpy as np
7
9
  import pandas as pd
10
+ from rex.utilities.utilities import get_chunk_ranges
8
11
 
9
- from reV.handlers.exclusions import ExclusionLayers
12
+ from reV.handlers.exclusions import LATITUDE, LONGITUDE, ExclusionLayers
13
+ from reV.utilities import SupplyCurveField
10
14
  from reV.utilities.exceptions import SupplyCurveError, SupplyCurveInputError
11
15
 
12
- from rex.utilities.utilities import get_chunk_ranges
13
-
14
16
  logger = logging.getLogger(__name__)
15
17
 
16
18
 
@@ -31,13 +33,17 @@ class SupplyCurveExtent:
31
33
  SC point.
32
34
  """
33
35
 
34
- logger.debug('Initializing SupplyCurveExtent with res {} from: {}'
35
- .format(resolution, f_excl))
36
+ logger.debug(
37
+ "Initializing SupplyCurveExtent with res {} from: {}".format(
38
+ resolution, f_excl
39
+ )
40
+ )
36
41
 
37
42
  if not isinstance(resolution, int):
38
- raise SupplyCurveInputError('Supply Curve resolution needs to be '
39
- 'an integer but received: {}'
40
- .format(type(resolution)))
43
+ raise SupplyCurveInputError(
44
+ "Supply Curve resolution needs to be "
45
+ "an integer but received: {}".format(type(resolution))
46
+ )
41
47
 
42
48
  if isinstance(f_excl, (str, list, tuple)):
43
49
  self._excl_fpath = f_excl
@@ -46,11 +52,12 @@ class SupplyCurveExtent:
46
52
  self._excl_fpath = f_excl.h5_file
47
53
  self._excls = f_excl
48
54
  else:
49
- raise SupplyCurveInputError('SupplyCurvePoints needs an '
50
- 'exclusions file path, or '
51
- 'ExclusionLayers handler but '
52
- 'received: {}'
53
- .format(type(f_excl)))
55
+ raise SupplyCurveInputError(
56
+ "SupplyCurvePoints needs an "
57
+ "exclusions file path, or "
58
+ "ExclusionLayers handler but "
59
+ "received: {}".format(type(f_excl))
60
+ )
54
61
 
55
62
  self._excl_shape = self.exclusions.shape
56
63
  # limit the resolution to the exclusion shape.
@@ -67,13 +74,15 @@ class SupplyCurveExtent:
67
74
  self._points = None
68
75
 
69
76
  self._sc_col_ind, self._sc_row_ind = np.meshgrid(
70
- np.arange(self.n_cols), np.arange(self.n_rows))
77
+ np.arange(self.n_cols), np.arange(self.n_rows)
78
+ )
71
79
  self._sc_col_ind = self._sc_col_ind.flatten()
72
80
  self._sc_row_ind = self._sc_row_ind.flatten()
73
81
 
74
- logger.debug('Initialized SupplyCurveExtent with shape {} from '
75
- 'exclusions with shape {}'
76
- .format(self.shape, self.excl_shape))
82
+ logger.debug(
83
+ "Initialized SupplyCurveExtent with shape {} from "
84
+ "exclusions with shape {}".format(self.shape, self.excl_shape)
85
+ )
77
86
 
78
87
  def __len__(self):
79
88
  """Total number of supply curve points."""
@@ -90,8 +99,10 @@ class SupplyCurveExtent:
90
99
  def __getitem__(self, gid):
91
100
  """Get SC extent meta data corresponding to an SC point gid."""
92
101
  if gid >= len(self):
93
- raise KeyError('SC extent with {} points does not contain SC '
94
- 'point gid {}.'.format(len(self), gid))
102
+ raise KeyError(
103
+ "SC extent with {} points does not contain SC "
104
+ "point gid {}.".format(len(self), gid)
105
+ )
95
106
 
96
107
  return self.points.loc[gid]
97
108
 
@@ -180,8 +191,9 @@ class SupplyCurveExtent:
180
191
  point.
181
192
  """
182
193
  if self._rows_of_excl is None:
183
- self._rows_of_excl = self._chunk_excl(self.excl_rows,
184
- self.resolution)
194
+ self._rows_of_excl = self._chunk_excl(
195
+ self.excl_rows, self.resolution
196
+ )
185
197
 
186
198
  return self._rows_of_excl
187
199
 
@@ -198,8 +210,9 @@ class SupplyCurveExtent:
198
210
  point.
199
211
  """
200
212
  if self._cols_of_excl is None:
201
- self._cols_of_excl = self._chunk_excl(self.excl_cols,
202
- self.resolution)
213
+ self._cols_of_excl = self._chunk_excl(
214
+ self.excl_cols, self.resolution
215
+ )
203
216
 
204
217
  return self._cols_of_excl
205
218
 
@@ -217,8 +230,9 @@ class SupplyCurveExtent:
217
230
  point.
218
231
  """
219
232
  if self._excl_row_slices is None:
220
- self._excl_row_slices = self._excl_slices(self.excl_rows,
221
- self.resolution)
233
+ self._excl_row_slices = self._excl_slices(
234
+ self.excl_rows, self.resolution
235
+ )
222
236
 
223
237
  return self._excl_row_slices
224
238
 
@@ -236,8 +250,9 @@ class SupplyCurveExtent:
236
250
  point.
237
251
  """
238
252
  if self._excl_col_slices is None:
239
- self._excl_col_slices = self._excl_slices(self.excl_cols,
240
- self.resolution)
253
+ self._excl_col_slices = self._excl_slices(
254
+ self.excl_cols, self.resolution
255
+ )
241
256
 
242
257
  return self._excl_col_slices
243
258
 
@@ -282,16 +297,17 @@ class SupplyCurveExtent:
282
297
  lats = []
283
298
  lons = []
284
299
 
285
- sc_cols, sc_rows = np.meshgrid(np.arange(self.n_cols),
286
- np.arange(self.n_rows))
300
+ sc_cols, sc_rows = np.meshgrid(
301
+ np.arange(self.n_cols), np.arange(self.n_rows)
302
+ )
287
303
  for r, c in zip(sc_rows.flatten(), sc_cols.flatten()):
288
304
  r = self.excl_row_slices[r]
289
305
  c = self.excl_col_slices[c]
290
- lats.append(self.exclusions['latitude', r, c].mean())
291
- lons.append(self.exclusions['longitude', r, c].mean())
306
+ lats.append(self.exclusions[LATITUDE, r, c].mean())
307
+ lons.append(self.exclusions[LONGITUDE, r, c].mean())
292
308
 
293
- self._latitude = np.array(lats, dtype='float32')
294
- self._longitude = np.array(lons, dtype='float32')
309
+ self._latitude = np.array(lats, dtype="float32")
310
+ self._longitude = np.array(lons, dtype="float32")
295
311
 
296
312
  return self._latitude
297
313
 
@@ -308,16 +324,17 @@ class SupplyCurveExtent:
308
324
  lats = []
309
325
  lons = []
310
326
 
311
- sc_cols, sc_rows = np.meshgrid(np.arange(self.n_cols),
312
- np.arange(self.n_rows))
327
+ sc_cols, sc_rows = np.meshgrid(
328
+ np.arange(self.n_cols), np.arange(self.n_rows)
329
+ )
313
330
  for r, c in zip(sc_rows.flatten(), sc_cols.flatten()):
314
331
  r = self.excl_row_slices[r]
315
332
  c = self.excl_col_slices[c]
316
- lats.append(self.exclusions['latitude', r, c].mean())
317
- lons.append(self.exclusions['longitude', r, c].mean())
333
+ lats.append(self.exclusions[LATITUDE, r, c].mean())
334
+ lons.append(self.exclusions[LONGITUDE, r, c].mean())
318
335
 
319
- self._latitude = np.array(lats, dtype='float32')
320
- self._longitude = np.array(lons, dtype='float32')
336
+ self._latitude = np.array(lats, dtype="float32")
337
+ self._longitude = np.array(lons, dtype="float32")
321
338
 
322
339
  return self._longitude
323
340
 
@@ -367,10 +384,14 @@ class SupplyCurveExtent:
367
384
  """
368
385
 
369
386
  if self._points is None:
370
- self._points = pd.DataFrame({'row_ind': self.row_indices.copy(),
371
- 'col_ind': self.col_indices.copy()})
387
+ self._points = pd.DataFrame(
388
+ {
389
+ "row_ind": self.row_indices.copy(),
390
+ "col_ind": self.col_indices.copy(),
391
+ }
392
+ )
372
393
 
373
- self._points.index.name = 'gid' # sc_point_gid
394
+ self._points.index.name = "gid" # sc_point_gid
374
395
 
375
396
  return self._points
376
397
 
@@ -436,8 +457,8 @@ class SupplyCurveExtent:
436
457
  col_ind : int
437
458
  Column index that the gid is located at in the sc grid.
438
459
  """
439
- row_ind = self.points.loc[gid, 'row_ind']
440
- col_ind = self.points.loc[gid, 'col_ind']
460
+ row_ind = self.points.loc[gid, "row_ind"]
461
+ col_ind = self.points.loc[gid, "col_ind"]
441
462
  return row_ind, col_ind
442
463
 
443
464
  def get_excl_slices(self, gid):
@@ -458,9 +479,10 @@ class SupplyCurveExtent:
458
479
  """
459
480
 
460
481
  if gid >= len(self):
461
- raise SupplyCurveError('Requested gid "{}" is out of bounds for '
462
- 'supply curve points with length "{}".'
463
- .format(gid, len(self)))
482
+ raise SupplyCurveError(
483
+ 'Requested gid "{}" is out of bounds for '
484
+ 'supply curve points with length "{}".'.format(gid, len(self))
485
+ )
464
486
 
465
487
  row_slice = self.excl_row_slices[self.row_indices[gid]]
466
488
  col_slice = self.excl_col_slices[self.col_indices[gid]]
@@ -559,9 +581,12 @@ class SupplyCurveExtent:
559
581
 
560
582
  valid_gids = np.where(valid_bool == 1)[0].astype(np.uint32)
561
583
 
562
- logger.info('Found {} valid SC points out of {} total possible '
563
- '(valid SC points that map to valid resource gids)'
564
- .format(len(valid_gids), len(valid_bool)))
584
+ logger.info(
585
+ "Found {} valid SC points out of {} total possible "
586
+ "(valid SC points that map to valid resource gids)".format(
587
+ len(valid_gids), len(valid_bool)
588
+ )
589
+ )
565
590
 
566
591
  return valid_gids
567
592