plesty.lib.report.tables ======================== .. py:module:: plesty.lib.report.tables .. autoapi-nested-parse:: Tables built from what a data kind declares about its arrays. :func:`data_table` reads :attr:`~plesty.lib.data.ExperimentData.columns` and lays the one-dimensional arrays out as columns — label and unit in the header, ``value ± error`` in each cell, meanings under the table. It is what an analyzer's default report is made of, and a starting point for one that is written by hand. Attributes ---------- .. autoapisummary:: plesty.lib.report.tables.MAX_ROWS Functions --------- .. autoapisummary:: plesty.lib.report.tables.heading plesty.lib.report.tables.data_table plesty.lib.report.tables.array_table Module Contents --------------- .. py:data:: MAX_ROWS :value: 200 .. py:function:: heading(label: str, unit: Optional[str]) -> str Return a column heading: the label, and the unit in parentheses. .. py:function:: data_table(data: plesty.lib.data.experiment_data.ExperimentData, title: str = '', *, result_only: bool = True, max_rows: int = MAX_ROWS) -> Optional[plesty.lib.report.blocks.Table] Tabulate a piece of data from its kind's declared columns. Only the declared, one-dimensional arrays of one common length are tabulated, in declaration order. An array named as another's ``error`` is shown in that column rather than as its own. :param data: The data. :param title: The table's title. :param result_only: Leave out the columns declared ``result: False``. :param max_rows: Refuse arrays longer than this. :returns: The table, or ``None`` when the kind declares no columns or none of them can be tabulated. .. py:function:: array_table(array: plesty.lib.data.array.PlestyArray, title: str = '', *, max_rows: int = MAX_ROWS) -> Optional[plesty.lib.report.blocks.Table] Tabulate one one-dimensional array as a single column. :param array: The array; its name, unit and description head the column. :param title: The table's title. :param max_rows: Refuse arrays longer than this. :returns: The table, or ``None`` for an array that is not 1-D or too long.