emodpy_malaria.weather.weather_request module¶
Weather service methods for submitting and working with weather data requests.
- class emodpy_malaria.weather.weather_request.WeatherArgs(site_file: Union[str, pathlib.Path], start_date: Union[int, str, datetime.datetime], end_date: Optional[Union[int, str, datetime.datetime]] = None, node_column: str = 'node', lat_column: str = 'lat', lon_column: str = 'lon', id_reference: str = 'Default')¶
Bases:
object
Arguments defining weather request space and time scope.
- validate()¶
Validates: site file (exists, is readable, and it contains specified columns) and dates range.
- class emodpy_malaria.weather.weather_request.RequestReport¶
Bases:
object
Specifies an object containing weather request operational reports.
- class emodpy_malaria.weather.weather_request.DataSource(name: Optional[str] = None)¶
Bases:
object
- property weather_variables: List[emodpy_malaria.weather.weather_variable.WeatherVariable]¶
List of weather variables supported by the current data source.
- class emodpy_malaria.weather.weather_request.WeatherRequest(platform: Union[str, idmtools_platform_comps.comps_platform.COMPSPlatform], local_dir: Optional[str] = None, data_source: Optional[str] = None, is_staging: Optional[bool] = None)¶
Bases:
object
Functionality for requesting and downloading weather files. Leverages idmtools API for COMPS SSMT.
- property report: emodpy_malaria.weather.weather_request.RequestReport¶
Returns report object.
- generate(weather_args: emodpy_malaria.weather.weather_request.WeatherArgs, request_name: Optional[str] = None, force: bool = False) Optional[emodpy_malaria.weather.weather_request.WeatherRequest] ¶
Submits the weather request and when data is ready sets the data_id property.
- Parameters
weather_args – Arguments defining space and time scope and weather files’ id reference.
request_name – (Optional) Name to be used for the weather SSMT work item.
force – (Optional) Force the download, even if target weather files already exist in the local dir.
- Returns
Returns this WeatherRequest object (to support method chaining).
- download(data_id: Optional[str] = None, local_dir: Optional[Union[str, pathlib.Path]] = None, force: bool = False) emodpy_malaria.weather.weather_request.WeatherRequest ¶
Downloads weather files.
- Parameters
data_id – (Optional) Asset collection ID to be downloaded, even if not generated by this request.
local_dir – (Optional) Local dir where files will be downloaded. If not specified a temp dir is created.
force – (Optional) Force the download, even if target weather files already exist in the local dir.
- Returns
Returns this WeatherRequest object (to support method chaining).