Skip to content

Redesign the report section

  • change the strategy:
    • In the current implementation reports are based on a query from the database.
    • It would be more general if reports are based on a DataFrame.
    • The DataFrame can be filled with the content of a database table including foreign fields or by a dedicated algorithm mixing, for example, different events.
  • In the model register the source producing the DataFrame, a dictionary linking a name to a function.
  • The report configuration should contains 6 sections
    • Select the source
    • Define selection criteria / query. It is based on a string written in natural language and on the DataFrame.query method.
    • Transform the source using pandas chaining. It is a string interpreted using python eval, a general approach which should allow all kind of postprocessing.
    • View defining the DataFrame columns which are shown in the Ext JS Grid, the grouping and the summary.
    • Summary to customize summary row of the grid: per group, total, etc
    • Permission to define roles with can used this report. Add a JSON field containing the list of role allowed to see the report
    • ...
  • In order to implement this approach:
    • Remove dedicated selector.
    • Migrate general function from lhcbfrance.modules.ana: active_period, coverage, db2df, full_name, get_people,is_end, is_start, normalize_history_data to the module report_tools.
    • Create the functions returning a DataFrame with the content of the history table
    • Create the functions / method in order to transforme a DataFrame into an Ext JS store, grid
    • Modify the database schema to handle additional configuration parameters fo report
    • Adapt the tools List, Metric1D and Metric2D.
    • Adapt controllers.
    • Update the documentation.
    • ...