model.helpertables

Helper Tables module.

Provides adoption data for use in the other modules. The source of the adoption data is selectable according to the solution. Helper Tables can pull in one of the Linear/2nd order poly/3rd order poly/etc curve fitting implementations from interpolation.py, or use a simple linear fit implemented here.

class HelperTables:

Implementation for the Helper Tables module.

HelperTables( ac, ref_adoption_data_per_region=None, pds_adoption_data_per_region=None, ref_datapoints=None, pds_datapoints=None, pds_adoption_trend_per_region=None, ref_adoption_limits=None, pds_adoption_limits=None, copy_ref_datapoint=True, copy_pds_datapoint=True, copy_ref_world_too=False, copy_pds_world_too=True, copy_pds_to_ref=False, copy_through_year=None, pds_adoption_is_single_source=False)

Helper Tables are the final step in constructing Adoption Prognostications. The select between the different types of REF and PDS adoption that can be configured, and they handle the interrelationship between the two. Helper Tables code in the Excel diverged in some cases, and so this code has variations that are controlled by parameter (listed in the second section below)

Normal Parameters:

  • ac = AdvancedControls. A number of crucial parameters are retrieved from ac:
    • ac.soln_ref_adoption_basis: choice of REF adoption type
    • ac.soln_pds_adoption_basis: choice of PDS adoption type
    • ac.soln_ref_adoption_regional_data: whether REF world data should be summed from regions
    • ac.soln_pds_adoption_regional_data: whether PDS world data should be summed from regions
    • ac.ref_adoption_use_pds_years: if set to years ys, copy pds[ys,'World'] to ref (from AC!F26, Y-REF)
    • ac.pds_adoption_use_ref_years: if set to years ys, copy ref[ys,'World'] to pds (from AC!F26, Y-PDS)
  • ref_adoption_data_per_region: The REF adoption data to use for Fully Custom REF adoptions only. Not required for default REF adoptions. (Year x Region) dataframe.
  • pds_adoption_data_per_region: The PDS adoption data to use, for Fully Custom PDS adoptions and sometimes for Existing Prognostications (see single_source option below).
    Not required when PDS adoption is forecast. (Year x Region) dataframe.
  • pds_adoption_trend_per_region: The PDS adoption data to use for forecast or Existing Prognostication PDS adoptions. (Year x Region) dataframe.

  • ref_datapoints: The first and last adoption estimates per region. Used for default REF forecasting;
    otherwise not required. (2 x Region) dataframe (from HT!C21:L22)

  • pds_datapoints: The first and last adoption estimates per region. Used for PDS _Linear_ forecast only; otherwise not required. (2 x Region) dataframe (from HT!C85:L86)

  • ref_adoption_limits: TAM or TLA limits for REF adoption. If set, bounds REF adoption. (1 x Regions) dataframe

  • pds_adoption_limits: TAM or TLA limits for PDS adoption. If set, bounds PDS adoption. (1 x Regions) dataframe

Quirks Parameters:
The following parameters all handle weirdnesses in how various Excel spreadsheets evolved. The automated generation code attempts to automatically figure out which of these options apply, but it should not be trusted. You should look at the _formulas_ in the Excel workbook to determine how to set these parameters:

  • copy_ref_datapoint: In some models, the 'current adoption' data is copied from the ref datapoints to the results, overriding them. Can be detected in the Excel by formula (=21) in the first row of the REF table (where is standing in for the current column) Default: True

  • copy_pds_datapoint: The same idea, but in the PDS table. There is one additional quirk, however: if the value of copy_pds_datapoint is 'Ref Table' (instead of just True), the value is copied from the first row of the REF _table_ instead of the PDS current adoption. Look at the actual row number of the Excel formula to see which kind of copy is being done. Default: True

  • copy_pds_world_too: This parameter determines whether copy_pds_datapoint applies to the first (main region) column or not. If True, copy_pds_datapoint overrides the first column. If False, copy_pds_datapoint only overrides regional data. Default: True

  • copy_ref_world_too: Ditto but for ref. Default: False (Note opposite default value)

  • copy_pds_to_ref: In some models, World data (only) is copied from the PDS model to the REF model for years before base year. This can be detected in the Excel by formula of the form =Cxx in the first column of the REF table, extending from 2014 through some number of years. The number of years to copy is determined by the parameter copy_through_year, below. Default: False

  • copy_through_year: Determines how many years copy_pds_to_ref should copy. Defaults to pds base year (that is, it treats the pds data as historical data which is copied to ref).

  • pds_adoption_is_single_source: (bool): whether the adoption data comes from a single source or multiple, to determine how to handle stddev. Only affectes Existing Prognostications. See the inline comment.

def ref_adoption_type(self):
def pds_adoption_type(self):
def soln_ref_funits_adopted(self, suppress_recursion=False):

Cumulative Adoption in funits, interpolated between two ref_datapoints. suppress_recursion: used to avoid potential infinite loops between pds and ref adoption calculations.

SolarPVUtil 'Helper Tables'!B26:L73

def soln_pds_funits_adopted(self, suppress_recursion=False):

Cumulative Adoption in funits in the PDS. suppress_recursion: used to avoid potential infinite loops between pds and ref adoption calculations.

SolarPVUtil 'Helper Tables'!B90:L137