FrameBackend#

class eclypse.report.backend.FrameBackend[source]#

Bases: ABC

Abstract base class defining the minimal DataFrame backend API.

Subclasses must implement tabular reading and filtering primitives required by Report. This keeps Report independent from a concrete DataFrame library.

Methods

__init__(name)

Initialize the FrameBackend.

columns(df)

Return the set of column names.

filter_eq(df, col, value)

Filter rows where col equals value.

filter_events(df, col, events)

Filter rows where col is contained in events.

filter_in(df, col, values)

Filter rows where col is contained in values.

filter_range_step(df, col, start, stop, step)

Filter rows where col is in the inclusive range and matches the step.

is_empty(df)

Return whether the DataFrame is empty.

max(df, col)

Return the maximum value of an integer-like column.

read_frame(stats_path, report_type, ...)

Read a report into a backend-specific DataFrame.

Attributes

name

Return the backend name.

__init__(name)[source]#

Initialize the FrameBackend.

Parameters:

name (str) – The backend name.

read_frame(stats_path, report_type, report_format)[source]#

Read a report into a backend-specific DataFrame.

Parameters:
  • stats_path (Path) – Base path of the selected report format folder.

  • report_type (str) – Event report type to load.

  • report_format (str) – Storage format, e.g. csv, parquet, json.

Returns:

A backend-specific DataFrame instance.

Return type:

Any

abstractmethod is_empty(df)[source]#

Return whether the DataFrame is empty.

Parameters:

df (Any) – The DataFrame to inspect.

Returns:

True if the DataFrame has no rows, otherwise False.

Return type:

bool

abstractmethod columns(df)[source]#

Return the set of column names.

Parameters:

df (Any) – The DataFrame to inspect.

Returns:

A set containing the DataFrame column names.

Return type:

set[str]

abstractmethod max(df, col)[source]#

Return the maximum value of an integer-like column.

Parameters:
  • df (Any) – The DataFrame to inspect.

  • col (str) – The name of the column.

Returns:

The maximum value as a Python int.

Return type:

int

abstractmethod filter_events(df, col, events)[source]#

Filter rows where col is contained in events.

Parameters:
  • df (Any) – The DataFrame to filter.

  • col (str) – The column name to test membership against.

  • events (Iterable[int]) – The allowed values for col.

Returns:

A filtered DataFrame.

Return type:

Any

abstractmethod filter_range_step(df, col, start, stop, step)[source]#

Filter rows where col is in the inclusive range and matches the step.

Parameters:
  • df (Any) – The DataFrame to filter.

  • col (str) – The column name to filter on.

  • start (int) – Inclusive range start.

  • stop (int) – Inclusive range end.

  • step (int) – Allowed step from start.

Returns:

A filtered DataFrame.

Return type:

Any

abstractmethod filter_eq(df, col, value)[source]#

Filter rows where col equals value.

Parameters:
  • df (Any) – The DataFrame to filter.

  • col (str) – The column name to compare.

  • value (Any) – The value to match.

Returns:

A filtered DataFrame.

Return type:

Any

abstractmethod filter_in(df, col, values)[source]#

Filter rows where col is contained in values.

Parameters:
  • df (Any) – The DataFrame to filter.

  • col (str) – The column name to test membership against.

  • values (Iterable[Any]) – The allowed values for col.

Returns:

A filtered DataFrame.

Return type:

Any

property name: str#

Return the backend name.

Returns:

A short backend identifier (e.g. “pandas”, “polars”, “polars_lazy”).