Coder Social home page Coder Social logo

grufoony / goanduisp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 104 KB

Suite di utilities per GoAndSwim.

Home Page: https://colab.research.google.com/github/Grufoony/GOandUISP/blob/main/main.ipynb

License: MIT License

Python 91.77% Jupyter Notebook 7.93% Makefile 0.30%
excel pandas uisp

goanduisp's Introduction

GOandUISP

Script Python per la conversione di file .xlsx da output GoAndSwim a input per il portale online UISP.


File gare

Nella sottocartella races sono presenti cartelle per varie manifestazioni contenenti file utili per esse.


Ottenere l'eseguibile

Lo script si può eseguire sulla piattaforma Google Colab.

Per qualsiasi problema scrivimi una mail.


Accumuli

Preparare il file di input

  1. Creare un file excel (<nome>.xlsx), e aprirlo con Excel. Questo file deve essere vuoto per il momento
  2. Una volta aperto il file, aprire il file .GAS della manifestazione che si vuole convertire
  3. Selezionare le gare di interesse ed entrare in esse (tasto in basso a sinistra di GoAndSwim)
  4. Senza dover fare nulla, si dovrebbe essere sul primo atleta dell'elenco. A questo punto eseguire la combinazione di tasti CTRL + C (copia)
  5. Andare nel file vuoto appena creato nella prima cella in alto a sinistra (la A1) ed eseguirle la combinazione di tasti CTRL + V (incolla). In questo modo tutte le gare di interesse dovrebbero essere state copiate nel file Excel
  6. Salvare il file e chiuderlo

NOTA: nel caso di atleti con più di un nome/cognome il programma chiederà di inserirli manualmente, comunicandovi tutti i dati che possiede di quel determinato atleta. Potete scrivere sia in maiuscolo che in minuscolo ed inserire spazi (per i nomi/cognomi multipli). Una volta inserito il nome/cognome multiplo richiesto, premere INVIO e ripetere l'azione ogni qualvolta richiesta dal programma. Al termine della procedura la finestra si chiuderà automaticamente.

Il file così creato dovrebbe presentarsi nel formato:

ROSSI MARIO 2013 M EB1 50 F Aosta 34 2 00'45"30 00'47"10 1 1 T EB1 0 0
ROSSI MARIO 2013 M EB1 100 D Aosta 27 4 01'24"50 01'24"80 1 1 T EB1 0 0
ROSSI MARIO 2013 M EB1 200 R Aosta 27 4 01'24"50 01'24"80 1 1 T EB1 0 0
ROSI MARIA 2011 F EA2 100 S Catanzaro 10 1 01'16"00 01'17"10 1 1 S EA2 0 0
ROSI MARIA 2011 F EA2 100 M Catanzaro 23 3 01'24"00 01'26"90 1 1 T EA2 0 0

oppure, nel caso siano presenti staffette nella manifestazione:

ROSSI MARIO 2013 M EB1 50 Aosta F 34 2 00'45"30 00'47"10 1 1 T EB1 0 0
ROSSI MARIO 2013 M EB1 100 Aosta D 27 4 01'24"50 01'24"80 1 1 T EB1 0 0
ROSSI MARIO 2013 M EB1 200 Aosta R 27 4 01'24"50 01'24"80 1 1 T EB1 0 0
LOMBARDIA ASD 0 100 M 00'30'00 00'30"00 1 1 T
ROSI MARIA 2011 F EA2 100 Catanzaro S 10 1 01'16"00 01'17"10 1 1 S EA2 0 0
ROSI MARIA 2011 F EA2 100 Catanzaro M 23 3 01'24"00 01'26"90 1 1 T EA2 0 0

Generare automaticamente le categorie delle staffette

In questo caso serviranno i due file forniti dal portale nazionale UISP, <nome>-dbmeeting.csv e <nome>-staffette-dbmeeting.csv. Se presenti nella cartella il programma produrrà in output il file <nome>-staffette.csv.

goanduisp's People

Contributors

grufoony avatar

Watchers

 avatar  avatar

goanduisp's Issues

[BUG] Error in relay categories

Traceback (most recent call last):
  File "/content/races/relay_categories.py", line 25, in <module>
    GOandUISP.find_categories()
  File "/content/./src/go_and_uisp.py", line 511, in find_categories
    df.columns = [
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py", line 5915, in __setattr__
    return object.__setattr__(self, name, value)
  File "pandas/_libs/properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/generic.py", line 823, in _set_axis
    self._mgr.set_axis(axis, labels)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/internals/managers.py", line 230, in set_axis
    self._validate_set_axis(axis, new_labels)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/internals/base.py", line 70, in _validate_set_axis
    raise ValueError(
ValueError: Length mismatch: Expected axis has 12 elements, new values have 10 elements

Rework `split_names` function

Rework split_names function in oreder to make inseriment simple to use.
I think about inserting:

  • nothing -> take the first word in the surname+name string
  • one char -> take the first two words in the surname+name string

This should simplify a lot.

[FEATURE REQUEST] Rework `combinata_stili`

We need a full rework in the output file which must:

  • be a PDF
  • have a title for 100mx for every category
  • have athletes which only did 4 races, with the aggregated join time

Problem with "staffette"

GAS files containing "staffette" races have an axis length of 21 instead of 20...
Should be easy to fix in an automatic way.

[FEATURE REQUEST] Create GUI

Once found how to "legalize" the exe program for windows defender is time to build a GUI for the local version, in order to get rid of the notebook

Testing

Before the new season it's actually time to implement some tests for the code...

Add total points calculator with jollys

So the accumulate part of the script should put in output:

  • one file with one line for each athlete (csv)
  • one file with one line for each athlete with categories and total points (xlsx/csv or better pdf directly)
  • print on screen the top athlete for each category based on points (or the best place in freestyle if draw)

Restructure the repo

It is necessary to restructure the repository in order to have a decent hierarchy of files.
For example there may be:

  • src/utils with code useful for many scopes
  • src/racename with all files related to one particular race, e.g. the XML for the points
  • README.md with the documentation, maybe one file for each folder
  • main.ipynb in order to make one choose the data pipeline (with presets for different races)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.