"""Availability for the post-processing module. (:mod:`qurry.process.availability`)"""fromtypingimportUnion,Literal,Optional,CallablePostProcessingBackendLabel=Union[Literal["Cython","Rust","Python"],str]"""The backend label for post-processing."""BACKEND_TYPES:list[PostProcessingBackendLabel]=["Python","Cython","Rust","JAX"]"""The backend types for post-processing.- Python: The default backend for post-processing.- Cython: The Cython backend for post-processing.- Rust: The Rust backend for post-processing.- JAX: The Python backend for post-processing with JAX."""
[docs]defavailablility(module_location:str,import_statement:list[tuple[PostProcessingBackendLabel,Union[bool,Literal["Depr."]],Optional[ImportError]]],)->tuple[str,dict[PostProcessingBackendLabel,Literal["Yes","Error","Depr.","No"]],dict[PostProcessingBackendLabel,Optional[ImportError]],]:"""Returns the availablility of the post-processing backend. Args: module_location (str): The location of the module. import_statement (list[tuple[ PostProcessingBackendLabel, bool, Optional[QurryPostProcessingError] ]]): The import statement for the post-processing backend. Returns: tuple[ str, dict[PostProcessingBackendLabel, Literal["Yes", "Error", "Depr.", "No"]], dict[PostProcessingBackendLabel, Optional[QurryPostProcessingError] ]: The location of the module, the availablility of the post-processing backend and the errors. """avails:dict[PostProcessingBackendLabel,Literal["Yes","Error","Depr.","No"]]={"Python":"Yes"}errors:dict[PostProcessingBackendLabel,Optional[ImportError]]={}forbackend,available,errorinimport_statement:ifavailableisTrue:avails[backend]="Yes"eliferrorisnotNone:avails[backend]="Error"errors[backend]=errorelifavailable=="Depr.":avails[backend]="Depr."else:avails[backend]="No"returnmodule_location,avails,errors
default_postprocessing_backend:Callable[[bool,bool],PostProcessingBackendLabel]=(lambdarust_available=False,cython_available=False:("Rust"ifrust_availableelse"Cython"ifcython_availableelse"Python"))"""Return the default post-processing backend.Args: rust_available (bool): Rust availability. cython_available (bool): Cython availability.Returns: PostProcessingBackendLabel: The default post-processing backend."""