wave-triangleSignal Evaluation

API reference for sovai.extensions.signal_evaluation

Module: sovai.extensions.signal_evaluation

Classes

SignalEvaluator

class SignalEvaluator

Attributes

  • verbose

  • df_factor

  • positions

  • rebalance_mask

  • holdings

  • returns

  • position_returns

  • resampled_returns

  • portfolio_returns

  • cumulative_returns

  • performance_plot

  • performance_table

  • stress_plot

  • distribution_plot

  • drawdown_plot

  • drawdown_table

  • returns_heatmap_plot

  • turnover_plot

  • signal_correlation_plot

  • signal_decile_plot


Functions

enrich_figure_with_llm_metadata()

Enrich a Plotly figure with LLM-ready metadata.

This function adds metadata to fig.layout.meta that can be used for feeding the figure to an LLM. Modifies the figure in-place.

Parameters

Parameter
Type
Description

fig

plotly.graph_objects.Figure The Plotly figure to enrich

title

Optional[str]

str, optional Chart title override

description

Optional[str]

str, optional Chart description

key_stats

Optional[Dict[str, Any]]

dict, optional Dictionary of key statistics

downsample

bool

bool Whether to apply LTTB downsampling in the compressed spec

target_points

int

int Target number of points for downsampling

include_image_export

bool

bool Whether to generate image export metadata

image_format

str

str Image format ('png', 'webp', 'jpeg', 'svg')

image_width

int

int Image width in pixels

image_height

int

int Image height in pixels

image_scale

int

int Image scale factor

Returns

None (modifies fig in-place)


export_figure_for_llm()

Export a figure with LLM metadata for direct use in LLM prompts.

Parameters

Parameter
Type
Description

fig

plotly.graph_objects.Figure The Plotly figure with LLM metadata

include_image

bool

bool Whether to export the actual image

image_format

str

str Image format ('png', 'webp', 'jpeg', 'svg')

return_base64

bool

bool Whether to return image as base64 (vs. raw bytes)

Returns

dict : Contains chart_card, spec_capsule, alt_text, and optionally image


Last updated