Commit 9c337fb4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update the API documentation.

parent 16b64c87
......@@ -10,9 +10,10 @@ API Documentation
:maxdepth: 1
callback
model
report
selector
dataframes
matplotlib_tools
models
report_tools
user_interface
Indices and tables
......
Matplotlib tools
----------------
A collection of functions to help in building graph.
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
bicolor
create_pdf
header_footer
plot_references
plot_values
style
table_only
ticks_and_labels
xticks_and_labels
\ No newline at end of file
Model
-----
Models
------
A collection of classes to define the model for the database.
......
Reports
-------
A collection of methods and classes to build report: *list*, *graph* or
*metric*.
Helper functions
^^^^^^^^^^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
do_title
get_value
split_dbfield
Classes
^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
BaseReport
Graph
List
Metric1D
Metric2D
\ No newline at end of file
Selector
--------
Report tools
------------
A collection of classes to build report: *list*, *graph* or
*metric*.
Classes
^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
SelectorActiveItems
EvtSelector
BaseReport
Graph
List
Metric2D
\ No newline at end of file
......@@ -36,7 +36,8 @@ from model_core import Core
from model_report import Report
from model_selector import Selector
from report_tools import (Graph,
from report_tools import (BaseReport,
Graph,
List,
Metric2D,
ReportException)
......
......@@ -233,6 +233,7 @@ def debug_df(df, opt=""):
Args
df (pandas.DataFrame):
opt (str): debug options:
* ``a``: equivalent to icIht
* ``c``: show columns
* ``I``: show index
......@@ -240,7 +241,6 @@ def debug_df(df, opt=""):
* ``t``: show tail
* ``f``: show the whole dataframe
"""
if "i" in opt or "a" in opt:
df.memory_usage()
......
......@@ -12,7 +12,7 @@ from pydal import Field
class Core(object):
"""Create the history table and its foreign tables.
"""Create the ``history`` table and its foreign tables.
"""
@staticmethod
......
......@@ -106,8 +106,12 @@ TP_SUMMARY_Y = "To sum, for example, the content of each column."
class Report(object):
"""Create the tables for the reporting: lists, metrics1d, metrics2d,
and graphs.
"""Create the tables ``Lists`` and ``metrics2D`` for the reporting
Note:
The table ``graphs``, ``lists``, ``metrics1d`` and ``metrics2d``
are obsolete. They are kept to ease the transition to the new
tables ``lists2`` and ``metrics2D2`` introduce in version 0.7.0.
"""
@staticmethod
......
......@@ -9,6 +9,9 @@ from pydal import Field
class Selector(object):
"""Create virtual tables used to generate selector interfaces.
"""
@staticmethod
def define_tables(virtdb, db, T):
......
......@@ -41,17 +41,17 @@ class ReportException(BaseException):
class BaseReport(object):
"""Base class to build list, metric or graph reports.
Attributes:
config (gluon.dal.Row):
df (pandas.DataFrame):
selector (plugin_dbui.Selector):
store (dict):
grid (dict):
Args:
table (gluon.dal.Table): contains the report configuration.
id_report (int): identifier of the report in the table.
**Public attributes**:
* **config** (*gluon.dal.Row*): configuration for the report
* **df** (*pandas.DataFrame*): data used by the report
* **selector** (*plugin_dbui.Selector*): user criteria
* **store** (*dict*): configuration of the ``Ext.data.Store``
* **grid** (*dict*): configuration of the ``Ext.grid.Panel`` widget
"""
def __init__(self, table, id_report):
......@@ -525,14 +525,14 @@ class Metric2D(BaseReport):
"""Generate the Metric2D and related configurations for ``Ext.grid.Panel``
and ``Ext.data.Store``.
Attributes:
df (pandas.DataFrame): metric with summary rows and columns.
df0 (pandas.DataFrame): metric without summary rows and columns.
is_summary (bool):
Args:
id_report: report identifier in the database
**Public attributes**:
* **df** (*pandas.DataFrame*): metric with summary rows and columns
* **df0** (*pandas.DataFrame*): metric without summary rows and columns
* **is_summary** (*bool*): summary rows or columns are there
Raises:
ReportException:
when the errors are found in the configuration of the grid columns.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment