FAI-CIVL / FAI-Airscore

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

List index out of range with norm-score. #215

Open philderbeast opened 3 years ago

philderbeast commented 3 years ago

For the HG Worlds 2019, I imported tracks and scored all but the training day, leaving that as imported. I'm getting an index out of range error grabbing the scores.

GET http://localhost:5000/flaretiming_yaml/9/norm-score
Traceback (most recent call last):
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/sid/.local/lib/python3.8/sitepackages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/sid/.local/lib/python3.8/sitepackages/flask_debugtoolbar/__init__.py", line 125, in dispatch_request
    return view_func(**req.view_args)
  File "/app/airscore/public/views.py", line 917, in _norm_score_yaml
    yaml.dump(ft_score(int(compid)), buf)
  File "/app/airscore/core/flaretiming.py", line 98, in ft_score
    lf, df = lf_df(task_obj, result['distance_flown'])
  File "/app/airscore/core/flaretiming.py", line 42, in lf_df
    diff_fraction = diff[dist10].diff_score
IndexError: list index out of range
philderbeast commented 3 years ago

Where I'm at with this comp:

Screen Shot 2020-12-20 at 10 08 34 AM

philderbeast commented 3 years ago

The other endpoints are working, all except norm-score:

http://localhost:5000/flaretiming_yaml/9/norm-score
http://localhost:5000/flaretiming_yaml/9/norm-arrival
http://localhost:5000/flaretiming_yaml/9/norm-landout
http://localhost:5000/flaretiming_yaml/9/norm-route
kuaka commented 3 years ago

ok I'll look into it. It will be impossible to get the difficulty for 'imported' tasks that have not had the igc files uploaded and processed by airscore. I will have to make it give back nulls or something.

kuaka commented 3 years ago

@philderbeast in your opinion what is the ideal behaviour for the norm outputs for imported but not scored tasks? The options are:

To my mind the second is preferable and logical (and less work) as any comparison would not be FT/AS but FT and the source system in this case FS.

philderbeast commented 3 years ago

I'm leaning towards the other option. We're looking for differences between FS and airScore or flare-timing and airScore. If we use the FS values when the task is not scored by airScore then we won't be drawn to differences that aren't there.

kuaka commented 3 years ago

@philderbeast can you please test again. I am not able to reproduce this although I am not testing with the HG worlds comp but with forbes 18 (with some tasks not scored by airscore but left as they were imported). I did not try with italy 2019 as the repo is very large to download. see https://github.com/FlareTiming/2019-italy-score/issues/1#issue-775204880