Closed GliderGeek closed 2 months ago
This is also great idea! Please send PR, to merge. Thanks!
Nice to hear you like it! What would be an appropriate implementation? An optional flag on the constructor, similar to skip_duplicates
? What would be an appropriate name: tz_aware_fixes
?
Do we really need a flag or should this be standard behaviour? I don't see a case where the old Implementation should be preferred. What do you think?
Also fine, but it will break backwards compatibility so i suppose an increase in major version number would be justified
Agree
@GliderGeek @bubeck please see #302 for the requested fixes according to the implementation described above
I am on holiday until 2024-09-09. Please give me some time after this date to look at.
I haven't looked at your implementation yet. However here are my general thoughts:
What do you think?
- Add TZ=UTC to B record and also HFDTE (and more?) to change them from naive to aware.
- Keep 'time' in B as datetime.time to be compatible, only make aware to UTC
- Add 'localtime' as datetime.datetime with TZ from header (or UTC if HFTZN is not available) and do all the magic here with time overrun.
I'm aligned with your initial thoughts, seems logical to me!
would it be an idea to add the possibility of returning timezone aware datetime.datetime objects instead of datetime.time objects in the fix records?
in IGC files the time is recorded in UTC, leading to potentially weird situations when your are in a timezone far away from UTC. You can have fixes going over the date line, from
23:59
->00:00
this recently lead to a problem in my program, trying to analyze glider flights for the gliding world championship in uvalde (UTC-5).
Adding this optional conversion would necessitate less conversions in downstream packages/programs. I see from the reader that it finds
utc_date
from one of the H records. ~Im not sure if this field is required in the format.~ this source says this record is required and always declared before the B records, so this would be possible without having to loop in a weird order.Curious to hear how you look at this 😄