reV.rep_profiles.rep_profiles.RegionRepProfile

class RegionRepProfile(gen_fpath, rev_summary, cf_dset='cf_profile', rep_method='meanoid', err_method='rmse', weight=SupplyCurveField.GID_COUNTS, n_profiles=1)[source]

Bases: object

Framework to handle rep profile for one resource region

Parameters:
  • gen_fpath (str) – Filepath to reV gen output file to extract “cf_profile” from.

  • rev_summary (pd.DataFrame) – Aggregated rev supply curve summary file trimmed to just one region to get a rep profile for. Must include “res_gids”, “gen_gids”, and the “weight” column (if weight is not None)

  • cf_dset (str) – Dataset name to pull generation profiles from.

  • rep_method (str) – Method identifier for calculation of the representative profile.

  • err_method (str | None) – Method identifier for calculation of error from the representative profile (e.g. “rmse”, “mae”, “mbe”). If this is None, the representative meanoid / medianoid profile will be returned directly

  • weight (str | None) – Column in rev_summary used to apply weighted mean to profiles. The supply curve table data in the weight column should have weight values corresponding to the res_gids in the same row.

  • n_profiles (int) – Number of representative profiles to retrieve.

Methods

get_region_rep_profile(gen_fpath, rev_summary)

Class method for parallelization of rep profile calc.

Attributes

GEN_GID_COL

RES_GID_COL

i_reps

Get the representative profile index(es) of this region.

rep_gen_gids

Get the representative profile gen gids of this region.

rep_profiles

Get the representative profiles of this region.

rep_res_gids

Get the representative profile resource gids of this region.

source_profiles

Retrieve the cf profile array from the source generation h5 file.

weights

Get the weights array

property source_profiles

Retrieve the cf profile array from the source generation h5 file.

Returns:

profiles (np.ndarray) – Timeseries array of cf profile data.

property weights

Get the weights array

Returns:

weights (np.ndarray | None) – Flat array of weight values from the weight column. The supply curve table data in the weight column should have a list of weight values corresponding to the gen_gids list in the same row.

property rep_profiles

Get the representative profiles of this region.

property i_reps

Get the representative profile index(es) of this region.

property rep_gen_gids

Get the representative profile gen gids of this region.

property rep_res_gids

Get the representative profile resource gids of this region.

classmethod get_region_rep_profile(gen_fpath, rev_summary, cf_dset='cf_profile', rep_method='meanoid', err_method='rmse', weight=SupplyCurveField.GID_COUNTS, n_profiles=1)[source]

Class method for parallelization of rep profile calc.

Parameters:
  • gen_fpath (str) – Filepath to reV gen output file to extract “cf_profile” from.

  • rev_summary (pd.DataFrame) – Aggregated rev supply curve summary file trimmed to just one region to get a rep profile for. Must include “res_gids”, “gen_gids”, and the “weight” column (if weight is not None)

  • cf_dset (str) – Dataset name to pull generation profiles from.

  • rep_method (str) – Method identifier for calculation of the representative profile.

  • err_method (str | None) – Method identifier for calculation of error from the representative profile (e.g. “rmse”, “mae”, “mbe”). If this is None, the representative meanoid / medianoid profile will be returned directly

  • weight (str | None) – Column in rev_summary used to apply weighted mean to profiles. The supply curve table data in the weight column should have weight values corresponding to the res_gids in the same row.

  • n_profiles (int) – Number of representative profiles to retrieve.

Returns:

  • rep_profile (np.ndarray) – (time, n_profiles) array for the most representative profile(s)

  • i_rep (list) – Column Index in profiles of the representative profile(s).

  • gen_gid_reps (list) – Generation gid(s) of the representative profile(s).

  • res_gid_reps (list) – Resource gid(s) of the representative profile(s).