-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Timezone handling in this package needs to be revisited.
In an attempt to deal with timezones, the code in pyloop_parser.py is adding timedeltas to dates that are already correct times, creating incorrect timestamps for glucose data, insulin data, and carb data.
For an example of one place this is being done: https://github.com/tidepool-org/PyLoopKit/blob/develop/pyloopkit/pyloop_parser.py#L36. Similar code is in these functions: get_carb_data, get_insulin_data, and get_glucose_data.
This causes problems further downstream in data processing. Recommend all internal timestamp handling is kept in utc. The only code that should worry about timezones is the following:
- Converting pump data in pump time to utc. Not needed in this code; issue reports already have pump events with utc timestamps
- Looking up basal rates to compute relative iob for a given dose. This should use the basal schedule timezone.
- Display. If desired, the final data can be displayed in a non-utc timezone; either the user's current timezone, or the the apparent timezone in use as inferred from the issue report.
Metadata
Metadata
Assignees
Labels
No labels