:mod:`weaver.processes.utils` ============================= .. py:module:: weaver.processes.utils Module Contents --------------- .. data:: LOGGER .. function:: _get_data(output) -> Optional[Any] Extract the data from the output value. .. function:: _read_reference(url) -> Optional[AnyStr] Read a reference HTTP(S) URL and return the content. .. function:: _get_multi_json_references(output, container) -> Optional[List[JSON]] Since WPS standard does not allow to return multiple values for a single output, a lot of process actually return a json array containing references to these outputs. Because the multi-output references are contained within this JSON file, it is not very convenient to retrieve the list of URLs as one always needs to open and read the file to get them. This function goal is to detect this particular format and expand the references to make them quickly available in the job output response. :return: Array of HTTP(S) references if the specified output is effectively a JSON containing that, ``None`` otherwise. .. function:: map_progress(progress, range_min, range_max) -> Number Calculates the relative progression of the percentage process within min/max values. .. function:: jsonify_output(output, process_description, container=None) -> JSON Utility method to jsonify an output element from a WPS1 process description. In the case that a reference JSON output is specified and that it refers to a file that contains an array list of URL references to simulate a multiple-output, this specific output gets expanded to contain both the original URL ``reference`` field and the loaded URL list under ``data`` field for easier access from the response body. .. function:: convert_process_wps_to_db(service, process, container) -> ProcessDB Converts an owslib WPS Process to local storage Process. .. function:: _check_deploy(payload) Validate minimum deploy payload field requirements with exception handling. .. function:: _get_deploy_process_info(process_info, reference, package) Obtain the process definition from deploy payload with exception handling. .. function:: deploy_process_from_payload(payload, container) -> HTTPException Adds a :class:`weaver.datatype.Process` instance to storage using the provided JSON ``payload`` matching :class:`weaver.wps_restapi.swagger_definitions.ProcessDescription`. :returns: HTTPOk if the process registration was successful :raises HTTPException: otherwise .. function:: register_wps_processes_from_config(wps_processes_file_path, container) -> None Loads a `wps_processes.yml` file and registers `WPS-1` providers processes to the current `Weaver` instance as equivalent `WPS-2` processes. .. seealso:: - `weaver.wps_processes.yml.example` for additional file format details