π sections.causalityΒΆ
Builds the causality analysis section for the report.
This function retrieves configuration for causality analysis from the report builder,
initializes the appropriate analyzer class with its parameters,
computes the causality results, and returns a dictionary
containing both the computed data and chart metadata (currently set to None).
FunctionsΒΆ
- owlmix.reporting.sections.causality.build_causality_section(report_builder)ΒΆ
- Parameters:
report_builder (
ReportBuilderProtocol) β The report builder instance containing the dataframe and configuration.- Returns:
A dictionary with keys:
data: The computed causality results.chart: Metadata and image for the generated plot (currentlyNone).
- Return type:
dict
Workflow:
Retrieves the causality configuration from the report builder.
Fetches the analyzer class and its parameter class from the registry.
Initializes the analyzer parameter object using the configuration.
Instantiates the analyzer with the DataFrame and parameters, then computes the causality results.
Returns a dictionary containing both the computed data and chart metadata (currently
None).
Example Usage:
section = build_causality_section(report_builder)
data = section["data"]
chart = section["chart"]
DependenciesΒΆ
os: For file path operations.register_section,ANALYZERS_REGISTRY: For section registration and dynamic class retrieval.ReportBuilderProtocol: Protocol for the report builder object.
RegistriesΒΆ
ANALYZERS_REGISTRY["causality"]: Provides the analyzer class and its parameter class for causality.
Section RegistrationΒΆ
The function is registered as a report section under the name "causality" using the @register_section decorator.
@register_section("causality")
def build_causality_section(report_builder: ReportBuilderProtocol) -> Dict[str, Any]:
...