예제 #1
0
    def setUp(self):
        np.random.seed(42)

        # Set up data to use for testing (EIA example plant)
        self.project = Project_EIA('./examples/operational_AEP_analysis/data')
        self.project.prepare()
        self.analysis = plant_analysis.MonteCarloAEP(self.project)
예제 #2
0
 def test_daily_gbm(self):
     reset_prng()
     # ____________________________________________________________________
     # Test GBM regression model (can be used at daily time resolution only)
     self.analysis = plant_analysis.MonteCarloAEP(
         self.project,
         reanal_products=["era5"],
         time_resolution="D",
         reg_model="gbm",
         reg_temperature=True,
         reg_winddirection=False,
     )
     # Run Monte Carlo AEP analysis, confirm the results are consistent
     self.analysis.run(num_sim=5)
     sim_results = self.analysis.results
     self.check_simulation_results_gbm_daily(sim_results)
예제 #3
0
 def test_monthly_lin(self):
     reset_prng()
     # ____________________________________________________________________
     # Test linear regression model, at monthly time resolution
     self.analysis = plant_analysis.MonteCarloAEP(
         self.project,
         reanal_products=["merra2", "era5"],
         time_resolution="M",
         reg_model="lin",
         reg_temperature=False,
         reg_winddirection=False,
     )
     # Run Monte Carlo AEP analysis, confirm the results are consistent
     self.analysis.run(num_sim=10)
     sim_results = self.analysis.results
     self.check_simulation_results_lin_monthly(sim_results)
예제 #4
0
    def test_daily_inputs(self):
        reset_prng()
        # ____________________________________________________________________
        # Test inputs to the regression model, at monthly time resolution
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=["merra2", "era5"],
            time_resolution="D",
            reg_temperature=True,
            reg_winddirection=True,
        )
        df = self.analysis._aggregate.df

        # Check the pre-processing functions
        self.check_process_revenue_meter_energy_daily(df)
        self.check_process_loss_estimates_daily(df)
        self.check_process_reanalysis_data_daily(df)
예제 #5
0
    def test_plant_analysis(self):

        # ____________________________________________________________________
        # Test inputs to the regression model, at monthly time resolution
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='M',
            reg_temperature=True,
            reg_winddirection=True)
        df = self.analysis._aggregate.df

        # Check the pre-processing functions
        self.check_process_revenue_meter_energy_monthly(df)
        self.check_process_loss_estimates_monthly(df)
        self.check_process_reanalysis_data_monthly(df)

        # ____________________________________________________________________
        # Test inputs to the regression model, at daily time resolution
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='D',
            reg_temperature=True,
            reg_winddirection=True)
        df = self.analysis._aggregate.df
        # Check the pre-processing functions
        self.check_process_revenue_meter_energy_daily(df)
        self.check_process_loss_estimates_daily(df)
        self.check_process_reanalysis_data_daily(df)

        # ____________________________________________________________________
        # Test linear regression model, at monthly time resolution
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='M',
            reg_model='lin',
            reg_temperature=False,
            reg_winddirection=False)
        # Run Monte Carlo AEP analysis, confirm the results are consistent
        self.analysis.run(num_sim=30)
        sim_results = self.analysis.results
        self.check_simulation_results_lin_monthly(sim_results)

        # ____________________________________________________________________
        # Test linear regression model, at daily time resolution
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='D',
            reg_model='lin',
            reg_temperature=False,
            reg_winddirection=False)
        # Run Monte Carlo AEP analysis, confirm the results are consistent
        self.analysis.run(num_sim=30)
        sim_results = self.analysis.results
        self.check_simulation_results_lin_daily(sim_results)

        # ____________________________________________________________________
        # Test GAM regression model (can be used at daily time resolution only)
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='D',
            reg_model='gam',
            reg_temperature=False,
            reg_winddirection=True)
        # Run Monte Carlo AEP analysis, confirm the results are consistent
        self.analysis.run(num_sim=10)
        sim_results = self.analysis.results
        self.check_simulation_results_gam_daily(sim_results)

        # ____________________________________________________________________
        # Test GBM regression model (can be used at daily time resolution only)
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='D',
            reg_model='gbm',
            reg_temperature=True,
            reg_winddirection=True)
        # Run Monte Carlo AEP analysis, confirm the results are consistent
        self.analysis.run(num_sim=10)
        sim_results = self.analysis.results
        self.check_simulation_results_gbm_daily(sim_results)

        # ____________________________________________________________________
        # Test ETR regression model (can be used at daily time resolution only)
        self.analysis = plant_analysis.MonteCarloAEP(
            self.project,
            reanal_products=['merra2', 'era5'],
            time_resolution='D',
            reg_model='etr',
            reg_temperature=False,
            reg_winddirection=False)
        # Run Monte Carlo AEP analysis, confirm the results are consistent
        self.analysis.run(num_sim=10)
        sim_results = self.analysis.results
        self.check_simulation_results_etr_daily(sim_results)