def test_get_wrf_fitness(): """Checks to see if the WRF fitness can be calculated for the default simulaiton. For this, you must be on Magma, Cheyenne, or AWS.""" if [on_aws, on_cheyenne, on_magma].count(True) is 0: print( '\n!!!Not running test_wrf_era5_diff -- switch to Magma, Cheyenne, or AWS!!!' ) return fitness, ghi_mean_error, wpd_mean_error, runtime = get_wrf_fitness( param_ids, start_date, end_date, verbose=True) assert fitness >= 0 assert ghi_mean_error >= 0 assert wpd_mean_error >= 0 assert type(runtime) is str
(provided that it's within the ERA5 date range). """ import optwrf.optimize_wrf_physics as owp # Specify desired physics options set below param_ids = [19, 4, 4, 7, 8, 99] # Specify the desired start date below start_date = 'Jul 8 2011' end_date = 'Jul 9 2011' # Run get wrf fitness function fitness, ghi_mean_error, wpd_mean_error, runtime = owp.get_wrf_fitness( param_ids, start_date, end_date, method='wind_only', bc_data='ERA', n_domains=1, wfp=True, disable_timeout=True, verbose=True) print( f'==========================================================================' ) print(f'Physics Options Set: {param_ids}\tStart Date: {start_date}') print( f'Fitness: {fitness}\tGHI Error: {ghi_mean_error}\tWPD Error: {wpd_mean_error}\tSim Runtime: {runtime}' )
""" Get WRF Fitness =============== This example lets you manually determine the fitness for any physics option set on any date (provided that it's within the ERA5 date range). """ import optwrf.optimize_wrf_physics as owp # Specify desired physics options set below param_ids = [4, 4, 2, 2, 2, 1, 2] # Specify the desired start date below start_date = 'Dec 23 2011' end_date = 'Dec 24 2011' # Run the fitness, ghi_mean_error, wpd_mean_error, runtime = owp.get_wrf_fitness( param_ids, start_date, end_date, verbose=True) print( f'==========================================================================' ) print(f'Physics Options Set: {param_ids}\tStart Date: {start_date}') print( f'Fitness: {fitness}\tGHI Error: {ghi_mean_error}\tWPD Error: {wpd_mean_error}\tSim Runtime: {runtime}' )