示例#1
0
    def forecast_trend(self, region, trend=None):
        """Forecast for a region via one of several interpolation algorithms.

           World:
           Linear: SolarPVUtil 'TAM Data'!BX50:BZ96       Degree2: SolarPVUtil 'TAM Data'!CE50:CH96
           Degree3: SolarPVUtil 'TAM Data'!CM50:CQ96      Exponential: SolarPVUtil 'TAM Data'!CV50:CX96

           OECD90:
           Linear: SolarPVUtil 'TAM Data'!BX168:BZ214     Degree2: SolarPVUtil 'TAM Data'!CE168:CH214
           Degree3: SolarPVUtil 'TAM Data'!CM168:CQ214    Exponential: SolarPVUtil 'TAM Data'!CV168:CX214

           Eastern Europe:
           Linear: SolarPVUtil 'TAM Data'!BX232:BZ278     Degree2: SolarPVUtil 'TAM Data'!CE232:CH278
           Degree3: SolarPVUtil 'TAM Data'!CM232:CQ278    Exponential: SolarPVUtil 'TAM Data'!CV232:CX278

           Asia (Sans Japan):
           Linear: SolarPVUtil 'TAM Data'!BX295:BZ341     Degree2: SolarPVUtil 'TAM Data'!CE295:CH341
           Degree3: SolarPVUtil 'TAM Data'!CM295:CQ341    Exponential: SolarPVUtil 'TAM Data'!CV295:CX341

           Middle East and Africa:
           Linear: SolarPVUtil 'TAM Data'!BX358:BZ404     Degree2: SolarPVUtil 'TAM Data'!CE358:CH404
           Degree3: SolarPVUtil 'TAM Data'!CM358:CQ404    Exponential: SolarPVUtil 'TAM Data'!CV358:CX404

           Latin America:
           Linear: SolarPVUtil 'TAM Data'!BX421:BZ467     Degree2: SolarPVUtil 'TAM Data'!CE421:CH467
           Degree3: SolarPVUtil 'TAM Data'!CM421:CQ467    Exponential: SolarPVUtil 'TAM Data'!CV421:CX467

           China:
           Linear: SolarPVUtil 'TAM Data'!BX484:BZ530     Degree2: SolarPVUtil 'TAM Data'!CE484:CH530
           Degree3: SolarPVUtil 'TAM Data'!CM484:CQ530    Exponential: SolarPVUtil 'TAM Data'!CV484:CX530

           India:
           Linear: SolarPVUtil 'TAM Data'!BX548:BZ594     Degree2: SolarPVUtil 'TAM Data'!CE548:CH594
           Degree3: SolarPVUtil 'TAM Data'!CM548:CQ594    Exponential: SolarPVUtil 'TAM Data'!CV548:CX594

           EU:
           Linear: SolarPVUtil 'TAM Data'!BX612:BZ658     Degree2: SolarPVUtil 'TAM Data'!CE612:CH658
           Degree3: SolarPVUtil 'TAM Data'!CM612:CQ658    Exponential: SolarPVUtil 'TAM Data'!CV612:CX658

           US:
           Linear: SolarPVUtil 'TAM Data'!BX677:BZ723     Degree2: SolarPVUtil 'TAM Data'!CE677:CH723
           Degree3: SolarPVUtil 'TAM Data'!CM677:CQ723    Exponential: SolarPVUtil 'TAM Data'!CV677:CX723
        """
        main_region = dd.REGIONS[0]
        if main_region in region and 'PDS' in region:
            data_sources = self._get_data_sources(
                data_sources=self.tam_pds_data_sources, region=region)
        else:
            data_sources = self._get_data_sources(
                data_sources=self.tam_ref_data_sources, region=region)
        growth = self.tamconfig.loc['growth', region]
        trend = self._get_trend(trend=trend,
                                tamconfig=self.tamconfig[region],
                                data_sources=data_sources)
        data = self.forecast_low_med_high(region).loc[:, growth]
        result = interpolation.trend_algorithm(data=data, trend=trend)
        result.name = 'forecast_trend_' + self._name_to_identifier(
            region) + '_' + str(trend).lower()
        return result
示例#2
0
 def _adoption_trend(self, low_med_high, growth, trend):
     """Adoption prediction via one of several interpolation algorithms."""
     if growth is None or trend is None:
         result = pd.DataFrame(np.nan, index=low_med_high.index.copy(), columns=['adoption'])
     else:
         data = low_med_high[growth]
         result = interpolation.trend_algorithm(data=data, trend=trend)
     return result
示例#3
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_usa(self, trend=None):
     """Forecast for the 'USA' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX677:BZ723     Degree2: SolarPVUtil 'TAM Data'!CE677:CH723
        Degree3: SolarPVUtil 'TAM Data'!CM677:CQ723    Exponential: SolarPVUtil 'TAM Data'!CV677:CX723
     """
     growth = self.tamconfig.loc['growth', 'USA']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='USA')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['USA'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_usa().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_usa_' + str(trend).lower()
     return result
示例#4
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_india(self, trend=None):
     """Forecast for the 'India' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX548:BZ594     Degree2: SolarPVUtil 'TAM Data'!CE548:CH594
        Degree3: SolarPVUtil 'TAM Data'!CM548:CQ594    Exponential: SolarPVUtil 'TAM Data'!CV548:CX594
     """
     growth = self.tamconfig.loc['growth', 'India']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='India')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['India'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_india().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_india_' + str(trend).lower()
     return result
示例#5
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_eu(self, trend=None):
     """Forecast for the 'EU' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX612:BZ658     Degree2: SolarPVUtil 'TAM Data'!CE612:CH658
        Degree3: SolarPVUtil 'TAM Data'!CM612:CQ658    Exponential: SolarPVUtil 'TAM Data'!CV612:CX658
     """
     growth = self.tamconfig.loc['growth', 'EU']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='EU')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['EU'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_eu().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_eu_' + str(trend).lower()
     return result
示例#6
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_latin_america(self, trend=None):
     """Forecast for the 'Latin America' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX421:BZ467     Degree2: SolarPVUtil 'TAM Data'!CE421:CH467
        Degree3: SolarPVUtil 'TAM Data'!CM421:CQ467    Exponential: SolarPVUtil 'TAM Data'!CV421:CX467
     """
     growth = self.tamconfig.loc['growth', 'Latin America']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='Latin America')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['Latin America'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_latin_america().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_latin_america_' + str(trend).lower()
     return result
示例#7
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_asia_sans_japan(self, trend=None):
     """Forecast for the 'Asia (Sans Japan)' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX295:BZ341     Degree2: SolarPVUtil 'TAM Data'!CE295:CH341
        Degree3: SolarPVUtil 'TAM Data'!CM295:CQ341    Exponential: SolarPVUtil 'TAM Data'!CV295:CX341
     """
     growth = self.tamconfig.loc['growth', 'Asia (Sans Japan)']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='Asia (Sans Japan)')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['Asia (Sans Japan)'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_asia_sans_japan().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_asia_sans_japan_' + str(trend).lower()
     return result
示例#8
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_oecd90(self, trend=None):
     """Forecast for the 'OECD90' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX168:BZ214     Degree2: SolarPVUtil 'TAM Data'!CE168:CH214
        Degree3: SolarPVUtil 'TAM Data'!CM168:CQ214    Exponential: SolarPVUtil 'TAM Data'!CV168:CX214
     """
     growth = self.tamconfig.loc['growth', 'OECD90']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='OECD90')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['OECD90'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_oecd90().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_oecd90_' + str(trend).lower()
     return result
示例#9
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_global(self, trend=None):
     """Forecast for the 'World' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX50:BZ96     Degree2: SolarPVUtil 'TAM Data'!CE50:CH96
        Degree3: SolarPVUtil 'TAM Data'!CM50:CQ96    Exponential: SolarPVUtil 'TAM Data'!CV50:CX96
     """
     growth = self.tamconfig.loc['growth', 'World']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources, region='World')
     trend = self._get_trend(trend=trend,
                             tamconfig=self.tamconfig['World'],
                             data_sources=data_sources)
     data = self.forecast_low_med_high_global().loc[:, growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_global_' + str(trend).lower()
     return result
示例#10
0
文件: tam.py 项目: benibienz/drawdown
 def forecast_trend_middle_east_and_africa(self, trend=None):
     """Forecast for the 'Middle East and Africa' region via one of several interpolation algorithms.
        Linear: SolarPVUtil 'TAM Data'!BX358:BZ404     Degree2: SolarPVUtil 'TAM Data'!CE358:CH404
        Degree3: SolarPVUtil 'TAM Data'!CM358:CQ404    Exponential: SolarPVUtil 'TAM Data'!CV358:CX404
     """
     growth = self.tamconfig.loc['growth', 'Middle East and Africa']
     data_sources = self._get_data_sources(
         data_sources=self.tam_ref_data_sources,
         region='Middle East and Africa')
     trend = self._get_trend(
         trend=trend,
         tamconfig=self.tamconfig['Middle East and Africa'],
         data_sources=data_sources)
     data = self.forecast_low_med_high_middle_east_and_africa().loc[:,
                                                                    growth]
     result = interpolation.trend_algorithm(data=data, trend=trend)
     result.name = 'forecast_trend_middle_east_and_africa_' + str(
         trend).lower()
     return result