"""AnalysisContainer (:mod:`qurry.qurrium.experiment.analyses`)"""fromtypingimportAny,TypeVarfromcollections.abcimportHashablefrom..analysisimportAnalysisPrototype_R=TypeVar("_R",bound=AnalysisPrototype)"""Type variable for :class:`~qurry.qurrium.analysis.AnalysisPrototype`."""
[docs]classAnalysesContainer(dict[Hashable,_R]):"""A customized dictionary for storing :class:`~qurry.qurrium.analysis.AnalysisPrototype` objects."""__name__="AnalysisContainer"def__init__(self,*args,**kwargs):super().__init__(*args,**kwargs)
[docs]defexport(self,)->tuple[dict[Hashable,dict[str,Any]],dict[str,dict[Hashable,dict[str,Any]]]]:"""Export the analysis container. Returns: tuple[dict[str, dict[str, Any]], dict[str, dict[str, dict[str, Any]]]]: The first element is a dictionary of reports formats. The second element is a dictionary of tales_reports formats. """# reportsreports:dict[Hashable,dict[str,Any]]={}# reports formats.# tales_reports formats.tales_reports:dict[str,dict[Hashable,dict[str,Any]]]={}fork,alinself.items():report_main,report_tales=al.export()reports[k]=report_mainfortk,tvinreport_tales.items():iftknotintales_reports:tales_reports[tk]={}tales_reports[tk][k]=tvreturnreports,tales_reports