FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
13 stars 17 forks source link

Document how to score from the command line. #45

Open philderbeast opened 4 years ago

philderbeast commented 4 years ago

I would like to be able to score with airscore on the command line. Are there instructions on how to do that somewhere in the repo?

philderbeast commented 4 years ago

From Antonio:

Procedure: Having “new_missing_distance” branch and the FSDB named ex. “test_delby.fsdb” in Core folder: In python3:

from fsdb import FSDB
fp = 'test_delby.fsdb'
f = FSDB.read(fp)
f.add_all()

You should get everything in database: Comp, Tasks, Participants, Results. If you then want to score it in AirScore, you need to put tracks in correct folders, probably creating them. In my case, it was:

Then, to score tasks in AirScore you can run:

python task_full_rescore.py [task_id]

where task_id is the database id of each task in tblTask

It creates JSON files in data/results. To see them in frontend, run:

python activate_last_task_result.py [task_id]

Then, result will be visible in: http://localhost:5000/task_result/[task_id]

philderbeast commented 4 years ago

On the new_missing_distance branch I see an error importing the fsdb module.

~/d/s/f/a/a/core on new_missing_distance ⨯ python3
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fsdb import FSDB
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../airscore/airscore/core/fsdb.py", line 15, in <module>
    import lxml.etree as ET
ModuleNotFoundError: No module named 'lxml'
>>> exit()
philderbeast commented 4 years ago

What are we doing for setting up the packages?

https://stackoverflow.com/questions/4598229/installing-lxml-module-in-python

Have you considered nix?

https://nixos.wiki/wiki/Python

kuaka commented 3 years ago

for python packages, there is a list of packages (in 2 files) in the requirements folder, these are installed when docker is built.