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

difficulty calc out of range error #176

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

Trying to score task 7 & 5 from forbes 2018. (imported fsdb, deleted 'fake' tracks, uploaded igc files) scoring hangs:

airscore_prod |   File "/app/airscore/core/formulas/gap2016.py", line 158, in calculate_results
airscore_prod |     points_allocation(task)
airscore_prod |   File "/app/airscore/core/formulas/libs/gap.py", line 507, in points_allocation
airscore_prod |     res.distance_score = pilot_distance(task, res)
airscore_prod |   File "/app/airscore/core/formulas/libs/gap.py", line 426, in pilot_distance
airscore_prod |     DF = diff[dist10].diff_score + ((diff[dist10 + 1].diff_score - diff[dist10].diff_score)

The other tasks in the comp score fine.

One thought that I had is that maybe there is an issue with the stats (max distance) which maybe the values from the fsdb and not the tracks that had been processed. The task distance (done under FAI Sphere is longer than the goal distance given to pilots in goal after uploading their tracks.)

I have tried to recalculate the task lenght by deleting the goal turnpoint (to then re insert) but there was an error with deleting. Will raise an issue.

will try redoing this comp using FAI Sphere and see if it helps. (I realised writting this that the comp was scored with FAI Sphere when the fsdb was created).

kuaka commented 3 years ago

update - I switched to FAI Sphere and re-imported the fsdb (probably not necessary as I don't believe importing uses the distance calc). I then uploaded all tracks for task 7 and scored. There error did not occur so it is probably something to do with the hypothesis above.

biuti commented 3 years ago

Yes so this are all problems that I think will find a solution as soon as the 'external' switch will become effective. On frontend should be clear that a comp has been imported and not editable, until you decide to switch off external, then distances for tasks will be recalculated, and all pilots will become nyp. I think this is the most failsafe solution. We still will have original results in files generated during import.

kuaka commented 3 years ago

one enhancement for importing external comps (when we want to reprocess) is to use the igc files specified in the fsdb. as mentioned here: https://github.com/FlareTiming/2018-forbes-flatlands-score/issues/4 however this would be a major enhancement as folder structure and igc files would have to be uploaded at the same time as fsdb.

kuaka commented 3 years ago

I can replicate this error even with using the correct distance calculation (in this case fai sphere) worker_1 | File "/app/airscore/core/formulas/gap2016.py", line 158, in calculate_results worker_1 | points_allocation(task) worker_1 | File "/app/airscore/core/formulas/libs/gap.py", line 507, in points_allocation worker_1 | res.distance_score = pilot_distance(task, res) worker_1 | File "/app/airscore/core/formulas/libs/gap.py", line 426, in pilot_distance worker_1 | DF = diff[dist10].diff_score + ((diff[dist10 + 1].diff_score - diff[dist10].diff_score) worker_1 | IndexError: list index out of range

kuaka commented 3 years ago

one enhancement for importing external comps (when we want to reprocess) is to use the igc files specified in the fsdb. as mentioned here: FlareTiming/2018-forbes-flatlands-score#4 however this would be a major enhancement as folder structure and igc files would have to be uploaded at the same time as fsdb.

as a work around there is a script here to take all igc files and fsdb and clean up the names of the igcc files that were used. This also zips these up into task zips for import into airScore. - good for testing comps in airScore that have a fsdb file.

biuti commented 3 years ago

related to https://github.com/FAI-CIVL/FAI-Airscore/issues/177#issuecomment-731842662. Please let me know if this was fixed in the new branch.

kuaka commented 3 years ago

@biuti you can now add a "to test" label and assign it. That way with so many issues it is easier to manage.

biuti commented 3 years ago

will do. sorry.

kuaka commented 3 years ago

will do. sorry.

No Apology needed. It was just a FYI. I created the label yesterday.

kuaka commented 3 years ago

unable to test at present due to #183

kuaka commented 3 years ago

tested with task 5 forbes 2018 and it is still an issue

philderbeast commented 3 years ago

Task 1 of Forbes 2018 log at failure:

flask_dev_local    | [FLASK] 99. Gennadiy Khramov: (gennadiy_khramov_2017-12-30_01.igc)
flask_dev_local    | [FLASK] 1|% complete
flask_dev_local    | [FLASK] 2|% complete
flask_dev_local    | [FLASK] 3|% complete
...
flask_dev_local    | [FLASK] 48|% complete
flask_dev_local    | [FLASK] 49|% complete
flask_dev_local    | 50|% complete172.18.0.1 - - [08/Dec/2020 14:47:59] "POST /users/_score_task/8 HTTP/1.1" 500 -
biuti commented 3 years ago

I pushed a fix, now should cover all special cases (https://github.com/FAI-CIVL/FAI-Airscore/commit/8f4f8fb43e14806641ff7e91664e814fbda9c72e). I tested with 1 pilots landed out, no pilots landed out, only minimum distances. Please test and let me know.

kuaka commented 3 years ago

tested with task 5 forbes 2018 and it is still an issue

I have re-tested with this task and it worked without a problem.

It would be much better of course to have a unit test for this. I can only test the tasks that I had fail in the past and I can not be sure it will definitely work in all scenarios.

@philderbeast I will merge development into yaml branch so you can use this, however I will have to replicate the changes inside the code for the yaml generation (as I had to copy and open up the dist difficulty function in order to get all the values you needed). I don't have time at the moment but will let you know when done.

kuaka commented 3 years ago

@philderbeast I have made changes to yaml code to do the same. At the same time @biuti I have fixed a bug (only in yaml code) that has been created with your new commit. see https://github.com/FAI-CIVL/FAI-Airscore/commit/8f4f8fb43e14806641ff7e91664e814fbda9c72e#r45045423

I have not fixed it in your code - GAP etc.

kuaka commented 3 years ago

I pushed a fix, now should cover all special cases (8f4f8fb). I tested with 1 pilots landed out, no pilots landed out, only minimum distances. Please test and let me know.

note that task 5 of Forbes 2018 was not a special case. Some pilots in goal and some not in goal.

kuaka commented 3 years ago

tested and is working with forbes 2018 task 5