-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix flight time through midnight utc #53
base: development
Are you sure you want to change the base?
Changes from all commits
1a31ad2
6015a9d
9d750f8
8e0b103
3af4080
351993d
eb8b568
ff45fc9
1dc4c36
d95ea02
d8865b2
408b26e
c148c60
4e18f31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
OpenSoar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not related to this line) |
||
======== | ||
|
||
busy with making everything timezone aware | ||
- wait on aerofiles fix for deepcopy | ||
- decide on dependencies. pinned or not? | ||
- run test with pysoar, same results? | ||
- how to keep backwards compatible? add flag? | ||
|
||
.. image:: https://img.shields.io/pypi/v/opensoar.svg | ||
:target: https://pypi.org/project/opensoar/ | ||
:alt: pypi version and link | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
from copy import deepcopy | ||
|
||
from opensoar.task.task import Task | ||
from opensoar.utilities.helper_functions import double_iterator, calculate_distance_bearing, calculate_destination, \ | ||
seconds_time_difference_fixes, add_times | ||
from opensoar.utilities.helper_functions import double_iterator, calculate_distance_bearing, calculate_destination | ||
|
||
|
||
class AAT(Task): | ||
|
@@ -51,12 +50,12 @@ def apply_rules(self, trace): | |
return fixes, start_time, outlanding_fix, distances, finish_time, sector_fixes | ||
|
||
def _determine_finish_time(self, fixes, outlanding_fix): | ||
total_trip_time = seconds_time_difference_fixes(fixes[0], fixes[-1]) | ||
total_trip_time = (fixes[-1]['datetime'] - fixes[0]['datetime']).total_seconds() | ||
minimum_trip_time = self._t_min.total_seconds() | ||
if outlanding_fix is None and total_trip_time < minimum_trip_time: | ||
finish_time = add_times(fixes[0]['time'], self._t_min) | ||
finish_time = fixes[0]['datetime'] + self._t_min | ||
else: | ||
finish_time = fixes[-1]['time'] | ||
finish_time = fixes[-1]['datetime'] | ||
return finish_time | ||
|
||
def _calculate_trip_fixes(self, trace): | ||
|
@@ -118,7 +117,7 @@ def _get_sector_fixes(self, trace): | |
if enl_first_fix is None: | ||
enl_first_fix = fix | ||
|
||
enl_time = seconds_time_difference_fixes(enl_first_fix, fix) | ||
enl_time = (fix['datetime'] - enl_first_fix['datetime']).total_seconds() | ||
if self.enl_time_exceeded(enl_time): | ||
enl_registered = True | ||
if current_leg > 0: | ||
|
@@ -357,6 +356,7 @@ def _get_waypoint_fixes(self, outlanded, sector_fixes, outside_sector_fixes=None | |
if outside_sector_fixes is None: | ||
outside_sector_fixes = list() | ||
|
||
# this doesnt work due to latest aerofiles version | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this still needs to be addressed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
waypoint_fixes = deepcopy(sector_fixes) | ||
if outlanded: | ||
waypoint_fixes.append(sector_fixes[-1]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pyproj | ||
aerofiles | ||
beautifulsoup4 | ||
geojson | ||
shapely | ||
aerofiles==1.4.0 | ||
beautifulsoup4==4.12.3 | ||
geojson==3.1.0 | ||
shapely==2.0.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. decide what to do with this. fixing them completely might be too strict. this is a library that is used by others. they need some freedom to use other versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not related to this line)
If all looks good, do final check with Pysoar on some comps