Reporting
Structured reporting helpers build on the Python data surfaces already exposed
by cimba.Dataset and cimba.TimeSeries. They return plain Python
objects that can be formatted, inspected, or plotted.
The C API exposes this area as printer-oriented functions such as
cmb_dataset_fivenum_print(), cmb_dataset_histogram_print(),
cmb_dataset_correlogram_print(), and resource-specific report printers.
Python keeps the same reporting coverage but returns structured values first.
Use format_report() for debug text, or the plotting helpers for figures.
The C functions are not exposed under their cmb_* names.
The reporting backend intentionally stays native and dependency-free for the calculations. For analysis libraries, reporting objects expose plain Python records and column dictionaries, so pandas, Polars, NumPy, CSV writers, and similar tools can consume the results without Cimba importing those libraries.
Install plotting support with the optional extra:
pip install "cimba[plot]"
- class cimba.reporting.SummaryStats
Availability-aware summary statistics. Fields that do not make sense for the available sample count are
None.- as_dict()
Return a plain dictionary, suitable for
pandas.DataFrame([stats.as_dict()]).
- class cimba.reporting.FiveNumberSummary
Five-number summary with
min,q1,median,q3,max, and aweightedflag. This is the Python equivalent of the C five-number printers.- as_dict()
Return a plain dictionary.
- class cimba.reporting.HistogramBin
One histogram bucket with
lower,upper,mass,underflow, andoverflowfields.- as_dict()
Return a plain dictionary.
- class cimba.reporting.Histogram
Histogram data with explicit underflow and overflow buckets.
- as_dict()
- to_records()
- to_columns()
Return nested dictionaries, row records, or column tuples for analysis libraries.
- class cimba.reporting.Correlogram
Autocorrelation or partial-autocorrelation coefficients.
- as_dict()
- to_records()
- to_columns()
Return dictionaries, row records, or column tuples with
kind,lag, andcoefficientfields.
- class cimba.reporting.HistoryReport
Structured report containing a title, summary, histogram, and optional correlogram.
- as_dict()
- to_tables()
Return nested report data or table-shaped records keyed by report section.
- cimba.reporting.summarize(source)
Return
SummaryStatsfor acimba.DataSummary,cimba.WeightedSummary,cimba.Dataset, orcimba.TimeSeries.
- cimba.reporting.histogram(source, bins=20, range=None, weighted='auto')
Return a
Histogramfor acimba.Datasetorcimba.TimeSeries. Time series histograms are duration-weighted by default.
- cimba.reporting.five_number(source)
Return a
FiveNumberSummaryfor acimba.Datasetorcimba.TimeSeries. Time series summaries are duration-weighted.
- cimba.reporting.correlogram(source, lags, kind='acf')
Return a
Correlogramusingsource.acf(lags)orsource.pacf(lags).
- cimba.reporting.history_report(source, *, title=None, bins=20, lags=None, correlation=None)
Return a
HistoryReportfor a dataset or time series.
- cimba.reporting.resource_report(resource, *, bins=None, lags=None, correlation=None)
Return a
HistoryReportfor a recorded buffer, queue, resource, or resource pool.
- cimba.reporting.sample_records(source)
- cimba.reporting.sample_columns(source)
Return raw
cimba.Datasetorcimba.TimeSeriessamples with stable column names. Datasets useindexandvalue; time series usetime,value, andweight.
- cimba.reporting.format_report(report)
Return text for a
HistoryReportmatching the native Cimba report: thecmb_buffer_print_report()summary and character histogram followed by thecmb_dataset_correlogram_print()correlogram.
- cimba.reporting.format_summary(summary_or_source)
Return compact debug text for a
SummaryStats,cimba.DataSummary,cimba.WeightedSummary,cimba.Dataset, orcimba.TimeSeries.
- cimba.reporting.plot_history(history, ax=None, **kwargs)
- cimba.reporting.plot_histogram(histogram_or_source, ax=None, **kwargs)
- cimba.reporting.plot_correlogram(correlogram_or_source, ax=None, **kwargs)
- cimba.reporting.plot_report(report, axes=None, **kwargs)
Plot with Matplotlib. The dependency is imported only when one of these helpers is called.
Analysis Interop
The record adapters are ordinary Python data:
from cimba import reporting
report = reporting.history_report(samples, bins=30, lags=12)
summary_row = report.summary.as_dict()
histogram_rows = report.histogram.to_records()
correlogram_rows = report.correlogram.to_records()
# pandas or Polars can build frames directly from the records.
# pd.DataFrame(histogram_rows)
# pl.DataFrame(report.to_tables()["summary"])
For raw sample data, use sample_records() or sample_columns():
rows = reporting.sample_records(history)
columns = reporting.sample_columns(history)
C API Equivalents
C reporting helper |
Python reporting helper |
|---|---|
|
|
|
|
|
|
|
|
|
|
|