From 3cfb6e58f7ff1f9cc6e4e35043706c4bd7896fbe Mon Sep 17 00:00:00 2001 From: glidergeek Date: Thu, 29 Aug 2024 19:18:54 +0200 Subject: [PATCH] moving most of the changes to pysoar --- opensoar/competition/competition_day.py | 2 +- opensoar/competition/soaringspot.py | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/opensoar/competition/competition_day.py b/opensoar/competition/competition_day.py index bd5d631..4ab0ea3 100644 --- a/opensoar/competition/competition_day.py +++ b/opensoar/competition/competition_day.py @@ -53,7 +53,7 @@ def analyse_flights(self, classification_method: str, analysis_progress=None, sk if skip_failed_analyses: try: competitor.analyse(self.task, classification_method) - except Exception: + except Exception as e: failed_comp_ids.append(competitor.competition_id) else: competitor.analyse(self.task, classification_method) diff --git a/opensoar/competition/soaringspot.py b/opensoar/competition/soaringspot.py index 10a0dda..07fa85e 100644 --- a/opensoar/competition/soaringspot.py +++ b/opensoar/competition/soaringspot.py @@ -84,9 +84,8 @@ def get_info_from_comment_lines(parsed_igc_file: dict, start_time_buffer: int=0) timezone = int(line.split(':')[3]) if start_opening is not None: - pass - # not converting start opening to UTC - # start_opening = subtract_times(start_opening, datetime.timedelta(hours=timezone)) + # converting start opening to UTC + start_opening = subtract_times(start_opening, datetime.timedelta(hours=timezone)) if len(lcu_lines) == 0 or len(lseeyou_lines) == 0: # somehow some IGC files do not contain the LCU or LSEEYOU lines with task information @@ -359,16 +358,10 @@ def generate_competition_day(self, target_directory: str, download_progress=None print('{} is skipped because of invalid trace'.format(competition_id)) continue - - # get info from file task, contest_information, competitor_information = get_info_from_comment_lines(parsed_igc_file, start_time_buffer) plane_model = competitor_information.get('plane_model', None) - pilot_name = competitor_information.get('pilot_name', None) - - tz = task.timezone - for fix in trace: - fix['time'] = add_times(fix['time'], datetime.timedelta(hours=tz)) + pilot_name = competitor_information.get('pilot_name', None) competitor = Competitor(trace, competition_id, plane_model, ranking, pilot_name)