tourcalc.theapp module

This module created the GUI

It can be run with

streamlit run theapp.py

more details see installation

class tourcalc.theapp.PDF(orientation, tourname)[source]

Bases: FPDF

overwrites the pdf settings

footer()[source]

Footer to be implemented in your own inherited class.

This is automatically called by FPDF.add_page() and FPDF.output() and should not be called directly by the user application. The default implementation performs nothing: you have to override this method in a subclass to implement your own rendering logic.

header()[source]

Header to be implemented in your own inherited class

This is automatically called by FPDF.add_page() and should not be called directly by the user application. The default implementation performs nothing: you have to override this method in a subclass to implement your own rendering logic.

tourcalc.theapp.api_call(cat_par)[source]

Overrides the number of participants with the number in sportdata Parameters ———- cat_par

dictionary with categories and number of participants of each category [dict]

tourcalc.theapp.final_setting(final, TATAMI)[source]

The sidebar elements for the final settings

Parameters

FINAL

bool to say if there is a final block planned

tourcalc.theapp.heatmap(data, row_labels, col_labels, str_title)[source]

Create a heat map from a numpy array and two lists of labels. - HELPER FUNCTION DRAW

Parameters

data

A 2D pandas data frame array of shape (N = row_labels, M = col_labels). [df]

row_labels

A list or array of length N with the labels for the rows. [list]

col_labels

A list or array of length M with the labels for the columns. [list]

str_title

A string that contains the tittle [string]

tourcalc.theapp.make_input(cat_par_inp)[source]

Loops of the input files and returns the selected age divisions and disciplines in the GUI

Parameters

cat_par_inp

dictionary with categories and number of participants of each category [dict]

tourcalc.theapp.plot_schedule_time(scheduled_jobs_i, cat_time_dict_i, start_time_i, date_i, final_time, final_start_time, bfinal_type, bfinal_time, final_tat, bfinal_tat)[source]

plots a schedule horizontal

Parameters

scheduled_jobs

a list of lists of all categories per tatami [[str]]

cat_time_dict

a dict that maps the strings in “scheduled_jobs” to times [dict]

start_time

the start time of the day [datetime]

date

The date of the current day [datetime]

tourcalc.theapp.timing(start_time)[source]

The sidebar elements for the timing

Parameters

start_time

start time of the event