prereise.gather package¶
Subpackages¶
- prereise.gather.demanddata package
- Subpackages
- prereise.gather.demanddata.bldg_electrification package
- Subpackages
- Submodules
- prereise.gather.demanddata.bldg_electrification.const module
- prereise.gather.demanddata.bldg_electrification.ff2elec_profile_generator_cook module
- prereise.gather.demanddata.bldg_electrification.ff2elec_profile_generator_dhw module
- prereise.gather.demanddata.bldg_electrification.ff2elec_profile_generator_htg module
- prereise.gather.demanddata.bldg_electrification.ff_model module
- prereise.gather.demanddata.bldg_electrification.floor_area_avg_slopes module
- prereise.gather.demanddata.bldg_electrification.helper module
- prereise.gather.demanddata.bldg_electrification.load_projection module
- prereise.gather.demanddata.bldg_electrification.load_projection_scenario module
- prereise.gather.demanddata.bldg_electrification.puma_data_agg module
- prereise.gather.demanddata.bldg_electrification.puma_hp_estimator module
- prereise.gather.demanddata.bldg_electrification.weather_data_agg module
- prereise.gather.demanddata.bldg_electrification.zone_profile_generator module
- Module contents
- prereise.gather.demanddata.eia package
- prereise.gather.demanddata.nrel_efs package
- prereise.gather.demanddata.transportation_electrification package
- Subpackages
- Submodules
- prereise.gather.demanddata.transportation_electrification.charging_optimization module
- prereise.gather.demanddata.transportation_electrification.const module
- prereise.gather.demanddata.transportation_electrification.data_helper module
- prereise.gather.demanddata.transportation_electrification.data_process module
- prereise.gather.demanddata.transportation_electrification.dwelling module
- prereise.gather.demanddata.transportation_electrification.generate_BEV_vehicle_profiles module
- prereise.gather.demanddata.transportation_electrification.generate_scaling_factors module
- prereise.gather.demanddata.transportation_electrification.immediate module
- prereise.gather.demanddata.transportation_electrification.immediate_charging_HDV module
- prereise.gather.demanddata.transportation_electrification.smart_charging module
- Module contents
- prereise.gather.demanddata.bldg_electrification package
- Module contents
- Subpackages
- prereise.gather.flexibilitydata package
- prereise.gather.griddata package
- prereise.gather.hydrodata package
- prereise.gather.solardata package
- prereise.gather.tests package
- prereise.gather.winddata package
- Subpackages
- prereise.gather.winddata.hrrr package
- Subpackages
- Submodules
- prereise.gather.winddata.hrrr.calculations module
- prereise.gather.winddata.hrrr.constants module
- prereise.gather.winddata.hrrr.downloader module
- prereise.gather.winddata.hrrr.grib module
- prereise.gather.winddata.hrrr.helpers module
- prereise.gather.winddata.hrrr.hrrr module
- prereise.gather.winddata.hrrr.hrrr_api module
- Module contents
- prereise.gather.winddata.rap package
- prereise.gather.winddata.hrrr package
- Submodules
- prereise.gather.winddata.const module
- prereise.gather.winddata.impute module
- prereise.gather.winddata.power_curves module
- Module contents
- Subpackages
Submodules¶
prereise.gather.const module¶
prereise.gather.helpers module¶
- prereise.gather.helpers.get_monthly_net_generation(state, eia_form_923, resource, hps=True)[source]¶
Return monthly total net generation for a given resource and state from EIA form 923.
- Parameters:
state (str) – state abbreviation.
eia_form_923 (pandas.DataFrame) – EIA form 923. The reduced form as returned by
trim_eia_form_923()
can be used.resource (str) – type of generator.
hps (bool) – determine whether pumped hydro storage is included in the result if resource is ‘hydro’.
- Returns:
(list) – monthly net generation of the query fuel type in state.
- Raises:
TypeError – if eia_form_923 is not a data frame or resource is not a str.
ValueError – if state or resource is invalid.
- prereise.gather.helpers.trim_eia_form_923(filename)[source]¶
Remove columns in EIA form 923 that are unnecessary to calculate the monthly generation per resource as performed by
get_monthly_net_generation()
.- Parameters:
filename (str) – name of the reference file.
- Returns:
(pandas.DataFrame) – EIA form 923 with only relevant columns.
prereise.gather.request_util module¶
- class prereise.gather.request_util.RateLimit(interval=None)[source]¶
Bases:
object
Provides a way to call an arbitrary function at most once per interval.
- Parameters:
interval (int/float) – the amount of time in seconds to wait between actions
- exception prereise.gather.request_util.TransientError[source]¶
Bases:
Exception
Used for errors which can be retried
- prereise.gather.request_util.retry(_func=None, max_attempts=5, interval=None, raises=False, allowed_exceptions=<class 'urllib.error.HTTPError'>)[source]¶
Creates a decorator to handle retry logic.
- Parameters:
max_attempts (int) – the max number of retries
interval (int/float) – minimum spacing between retries
raises (bool) – whether to re-raise the error after max_attempts is reached
allowed_exceptions (tuple) – exceptions for which the function will be retried, all others will be surfaced to the caller
- Returns:
(Any) – the return value of the decorated function, or None if raises is False and all attempts failed