module dbmanager
¶
Short summary¶
module lightmlboard.dbmanager
Manages a sqlite3 database to store the results.
Classes¶
class |
truncated documentation |
---|---|
Holds the data used for competitions. Tables: Competitions |
Properties¶
property |
truncated documentation |
---|---|
Returns the connexion. |
Static Methods¶
staticmethod |
truncated documentation |
---|---|
Methods¶
method |
truncated documentation |
---|---|
Creates the tables if not present. |
|
Retrieves a competition. |
|
Returns the list of competitions as list of |
|
Returns the list of competation id. |
|
Returns the list of competation id. |
|
Retrieves the results of a competition. |
|
Initializes the database. It skips a table if it exists. |
|
Adds a submission to the database. |
|
Returns the content of a table as a dataframe. |
Documentation¶
Manages a sqlite3 database to store the results.
- class lightmlboard.dbmanager.DatabaseCompetition(dbfile)¶
Bases:
Database
Holds the data used for competitions. Tables:
Competitions
cpt_id
cpt_name
metric
datafile
description
expected_values
Teams
team_id
team_name
Players
player_id
team_id
player_name
mail
login
pwd
Submission
cpt_id
player_id
date
filename
metric_value
- Parameters:
dbfile – filename or
:memory:
- property Connection¶
Returns the connexion.
- __init__(dbfile)¶
- Parameters:
dbfile – filename or
:memory:
- static _col_competitions()¶
- static _col_players()¶
- static _col_submissions()¶
- static _col_teams()¶
- static _dummy_submissions()¶
- _init()¶
Creates the tables if not present.
- get_competition(cpt_id)¶
Retrieves a competition.
- Parameters:
cpt_id – competition id
- Returns:
- get_competitions()¶
Returns the list of competitions as list of
(cpt_id, cpt_name)
.
- get_cpt_id()¶
Returns the list of competation id.
- get_player_id()¶
Returns the list of competation id.
- get_results(cpt_id)¶
Retrieves the results of a competition.
- Parameters:
cpt_id – competition id
- Returns:
a data frame
- init_from_options(filename)¶
Initializes the database. It skips a table if it exists.
- Parameters:
filename – filename
- submit(cpt_id, player_id, data, date=datetime.datetime(2022, 6, 5, 11, 13, 31, 407357))¶
Adds a submission to the database.
- Parameters:
cpt_id – competition id
player_id – player who did the submission
data – data of the submission
The function computes the metric associated to the submission.
- to_df(table)¶
Returns the content of a table as a dataframe.