NREL-reV 0.8.9__py3-none-any.whl → 0.9.2__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.
@@ -28,7 +28,7 @@ from reV.supply_curve.aggregation import (
28
28
  from reV.supply_curve.exclusions import FrictionMask
29
29
  from reV.supply_curve.extent import SupplyCurveExtent
30
30
  from reV.supply_curve.points import GenerationSupplyCurvePoint
31
- from reV.utilities import SupplyCurveField, log_versions
31
+ from reV.utilities import ResourceMetaField, SupplyCurveField, log_versions
32
32
  from reV.utilities.exceptions import (
33
33
  EmptySupplyCurvePointError,
34
34
  FileInputError,
@@ -170,14 +170,14 @@ class SupplyCurveAggFileHandler(AbstractAggFileHandler):
170
170
 
171
171
  if self._pdf.endswith(".csv"):
172
172
  self._power_density = pd.read_csv(self._pdf)
173
- if (SupplyCurveField.GID in self._power_density
173
+ if (ResourceMetaField.GID in self._power_density
174
174
  and 'power_density' in self._power_density):
175
175
  self._power_density = \
176
- self._power_density.set_index(SupplyCurveField.GID)
176
+ self._power_density.set_index(ResourceMetaField.GID)
177
177
  else:
178
178
  msg = ('Variable power density file must include "{}" '
179
179
  'and "power_density" columns, but received: {}'
180
- .format(SupplyCurveField.GID,
180
+ .format(ResourceMetaField.GID,
181
181
  self._power_density.columns.values))
182
182
  logger.error(msg)
183
183
  raise FileInputError(msg)
@@ -712,13 +712,6 @@ class SupplyCurveAggregation(BaseAggregation):
712
712
 
713
713
  logger.debug("Resource class bins: {}".format(self._res_class_bins))
714
714
 
715
- if self._cap_cost_scale is not None:
716
- if self._h5_dsets is None:
717
- self._h5_dsets = []
718
-
719
- self._h5_dsets += list(BaseGen.LCOE_ARGS)
720
- self._h5_dsets = list(set(self._h5_dsets))
721
-
722
715
  if self._power_density is None:
723
716
  msg = (
724
717
  "Supply curve aggregation power density not specified. "
@@ -784,7 +777,7 @@ class SupplyCurveAggregation(BaseAggregation):
784
777
 
785
778
  @staticmethod
786
779
  def _get_res_gen_lcoe_data(
787
- gen, res_class_dset, res_class_bins, cf_dset, lcoe_dset
780
+ gen, res_class_dset, res_class_bins, lcoe_dset
788
781
  ):
789
782
  """Extract the basic resource / generation / lcoe data to be used in
790
783
  the aggregation process.
@@ -800,8 +793,6 @@ class SupplyCurveAggregation(BaseAggregation):
800
793
  res_class_bins : list | None
801
794
  List of two-entry lists dictating the resource class bins.
802
795
  None if no resource classes.
803
- cf_dset : str
804
- Dataset name from f_gen containing capacity factor mean values.
805
796
  lcoe_dset : str
806
797
  Dataset name from f_gen containing LCOE mean values.
807
798
 
@@ -811,16 +802,14 @@ class SupplyCurveAggregation(BaseAggregation):
811
802
  Extracted resource data from res_class_dset
812
803
  res_class_bins : list
813
804
  List of resouce class bin ranges.
814
- cf_data : np.ndarray | None
815
- Capacity factor data extracted from cf_dset in gen
816
805
  lcoe_data : np.ndarray | None
817
806
  LCOE data extracted from lcoe_dset in gen
818
807
  """
819
808
 
820
- dset_list = (res_class_dset, cf_dset, lcoe_dset)
809
+ dset_list = (res_class_dset, lcoe_dset)
821
810
  gen_dsets = [] if gen is None else gen.datasets
822
- labels = ("res_class_dset", "cf_dset", "lcoe_dset")
823
- temp = [None, None, None]
811
+ labels = ("res_class_dset", "lcoe_dset")
812
+ temp = [None, None]
824
813
 
825
814
  if isinstance(gen, Resource):
826
815
  source_fps = [gen.h5_file]
@@ -847,12 +836,12 @@ class SupplyCurveAggregation(BaseAggregation):
847
836
  logger.warning(w)
848
837
  warn(w, OutputWarning)
849
838
 
850
- res_data, cf_data, lcoe_data = temp
839
+ res_data, lcoe_data = temp
851
840
 
852
841
  if res_class_dset is None or res_class_bins is None:
853
842
  res_class_bins = [None]
854
843
 
855
- return res_data, res_class_bins, cf_data, lcoe_data
844
+ return res_data, res_class_bins, lcoe_data
856
845
 
857
846
  @staticmethod
858
847
  def _get_extra_dsets(gen, h5_dsets):
@@ -886,7 +875,6 @@ class SupplyCurveAggregation(BaseAggregation):
886
875
  'system_capacity')
887
876
  missing_lcoe_source = [k for k in lcoe_recalc_req
888
877
  if k not in gen_dsets]
889
- missing_lcoe_request = []
890
878
 
891
879
  if isinstance(gen, Resource):
892
880
  source_fps = [gen.h5_file]
@@ -901,9 +889,6 @@ class SupplyCurveAggregation(BaseAggregation):
901
889
 
902
890
  h5_dsets_data = None
903
891
  if h5_dsets is not None:
904
- missing_lcoe_request = [
905
- k for k in lcoe_recalc_req if k not in h5_dsets
906
- ]
907
892
 
908
893
  if not isinstance(h5_dsets, (list, tuple)):
909
894
  e = (
@@ -937,17 +922,6 @@ class SupplyCurveAggregation(BaseAggregation):
937
922
  logger.warning(msg)
938
923
  warn(msg, InputWarning)
939
924
 
940
- if any(missing_lcoe_request):
941
- msg = (
942
- "It is strongly advised that you include the following "
943
- "datasets in the h5_dsets request in order to re-calculate "
944
- "the LCOE from the multi-year mean CF and AEP: {}".format(
945
- missing_lcoe_request
946
- )
947
- )
948
- logger.warning(msg)
949
- warn(msg, InputWarning)
950
-
951
925
  return h5_dsets_data
952
926
 
953
927
  @classmethod
@@ -1079,7 +1053,6 @@ class SupplyCurveAggregation(BaseAggregation):
1079
1053
  summary = []
1080
1054
 
1081
1055
  with SupplyCurveExtent(excl_fpath, resolution=resolution) as sc:
1082
- points = sc.points
1083
1056
  exclusion_shape = sc.exclusions.shape
1084
1057
  if gids is None:
1085
1058
  gids = sc.valid_sc_points(tm_dset)
@@ -1110,9 +1083,9 @@ class SupplyCurveAggregation(BaseAggregation):
1110
1083
  excl_fpath, gen_fpath, **file_kwargs
1111
1084
  ) as fh:
1112
1085
  temp = cls._get_res_gen_lcoe_data(
1113
- fh.gen, res_class_dset, res_class_bins, cf_dset, lcoe_dset
1086
+ fh.gen, res_class_dset, res_class_bins, lcoe_dset
1114
1087
  )
1115
- res_data, res_class_bins, cf_data, lcoe_data = temp
1088
+ res_data, res_class_bins, lcoe_data = temp
1116
1089
  h5_dsets_data = cls._get_extra_dsets(fh.gen, h5_dsets)
1117
1090
 
1118
1091
  n_finished = 0
@@ -1131,7 +1104,7 @@ class SupplyCurveAggregation(BaseAggregation):
1131
1104
  gen_index,
1132
1105
  res_class_dset=res_data,
1133
1106
  res_class_bin=res_bin,
1134
- cf_dset=cf_data,
1107
+ cf_dset=cf_dset,
1135
1108
  lcoe_dset=lcoe_data,
1136
1109
  h5_dsets=h5_dsets_data,
1137
1110
  data_layers=fh.data_layers,
@@ -1151,11 +1124,6 @@ class SupplyCurveAggregation(BaseAggregation):
1151
1124
  except EmptySupplyCurvePointError:
1152
1125
  logger.debug("SC point {} is empty".format(gid))
1153
1126
  else:
1154
- pointsum[SupplyCurveField.SC_POINT_GID] = gid
1155
- pointsum[SupplyCurveField.SC_ROW_IND] = \
1156
- points.loc[gid, 'row_ind']
1157
- pointsum[SupplyCurveField.SC_COL_IND] = \
1158
- points.loc[gid, 'col_ind']
1159
1127
  pointsum['res_class'] = ri
1160
1128
 
1161
1129
  summary.append(pointsum)