src.eddie.tasks =============== .. py:module:: src.eddie.tasks .. autoapi-nested-parse:: Runs backend tasks using Celery. Allowing for multiple long-running tasks to complete in the background. Allows the frontend to send tasks and retrieve status later. Attributes ---------- .. autoapisummary:: src.eddie.tasks.message_broker_url src.eddie.tasks.app src.eddie.tasks.log src.eddie.tasks.eddie_plugins Classes ------- .. autoapisummary:: src.eddie.tasks.OnFailureStateTask Functions --------- .. autoapisummary:: src.eddie.tasks.add_base_data_to_db src.eddie.tasks.wkt_to_gdf Module Contents --------------- .. py:data:: message_broker_url .. py:data:: app .. py:data:: log .. py:class:: OnFailureStateTask Bases: :py:obj:`app` Task that switches state to FAILURE if an exception occurs. .. py:method:: on_failure(exc: Exception, _task_id: str, _args: Tuple, _kwargs: Dict, _einfo: billiard.einfo.ExceptionInfo) -> None Change state to FAILURE and add exception to task data if an exception occurs. :param exc: The exception raised by the task. :type exc: Exception .. py:function:: add_base_data_to_db(selected_polygon_wkt: str, base_data_parameters: Dict[str, str]) -> None Task to ensure static base data for the given area is added to the database. :param selected_polygon_wkt: The polygon defining the selected area to add base data for. Defined in WKT form. :type selected_polygon_wkt: str :param base_data_parameters: The parameters from DEFAULT_MODULES_TO_PARAMETERS[retrieve_from_instructions] for the particular module. :type base_data_parameters: Dict[str, str] .. py:function:: wkt_to_gdf(wkt: str) -> geopandas.GeoDataFrame Transform a WKT string polygon into a GeoDataFrame. :param wkt: The WKT form of the polygon to be transformed. In WGS84 CRS (epsg:4326). :type wkt: str :returns: The GeoDataFrame form of the polygon after being transformed. :rtype: gpd.GeoDataFrame .. py:data:: eddie_plugins