Ajout de Clize
This commit is contained in:
parent
3051b0128f
commit
f6b2f98471
|
@ -2,7 +2,7 @@
|
|||
*.xls
|
||||
*.xlsx
|
||||
*.pyc
|
||||
__pycache__/*
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
||||
__pycache__/*
|
||||
.DS_Store
|
|
@ -36,7 +36,9 @@ On the **third tab**, you'll find:
|
|||
First, create a virtual env. and install the requirements :
|
||||
|
||||
`python3 -m venv /location/to/your/venv/`
|
||||
|
||||
`source /location/to/your/venv/project/bin/activate`
|
||||
|
||||
`pip install -r ./requirements/requirements.txt`
|
||||
|
||||
Then, you can run the application :
|
||||
|
|
39
analyse.py
39
analyse.py
|
@ -1,5 +1,4 @@
|
|||
import sys
|
||||
from os import path
|
||||
from clize import run
|
||||
from typing import List
|
||||
|
||||
from core.skill import Skill
|
||||
|
@ -37,29 +36,27 @@ def read_routine_file(filename: str) -> List[Routine]:
|
|||
return routine_list
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2: # use clize ?
|
||||
print("Please, give a XLSX file.")
|
||||
exit()
|
||||
def run_process(xlsx_filename: str, *, mean_routine:'r'=False, heatmap:'t'=False):
|
||||
"""Read a XLSX file whitch contain trampoline routines, analyse it and generate a XLSX results file with tree
|
||||
sheets.
|
||||
|
||||
filename = sys.argv[1]
|
||||
if filename[-5:] != ".xlsx":
|
||||
print("Must be a XLSX file.")
|
||||
exit()
|
||||
:param xlsx_filename: path to the xlsx to analyse.
|
||||
:param mean_routine: compute and write mean routine in the results file.
|
||||
:param heatmap: display heatmap at the end of the process.
|
||||
"""
|
||||
output_filename = xlsx_filename[:-5] + "_analysed.xlsx"
|
||||
|
||||
if not path.isfile(filename):
|
||||
print("File does not exist.")
|
||||
exit()
|
||||
|
||||
output_filename = filename[:-5] + "_analysed.xlsx"
|
||||
|
||||
routine_list = read_routine_file(filename)
|
||||
routine_list = read_routine_file(xlsx_filename)
|
||||
routine_stats = RoutineStatistics(routine_list)
|
||||
routine_stats.write_skill_frequency(output_filename)
|
||||
routine_stats.write_combination_frequency(output_filename)
|
||||
|
||||
# paramètre -mr pour le calcul de la "mean routine"
|
||||
routine_stats.write_mean_routine(output_filename)
|
||||
if mean_routine:
|
||||
routine_stats.write_mean_routine(output_filename)
|
||||
|
||||
# paramètre -hm pour le heatmap
|
||||
routine_stats.draw_heatmap_combination()
|
||||
if heatmap:
|
||||
routine_stats.draw_heatmap_combination()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run(run_process)
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
et-xmlfile==1.1.0
|
||||
seaborn==0.12.2
|
||||
openpyxl==3.0.9
|
||||
clize==5.0.0
|
||||
|
|
Loading…
Reference in New Issue