-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Context
I was trying to draw some "pretty" maps for my activities or otherwise analyze my information
My data collection is tedious and I wouldn't be surprised if some bug at any of the involved software pieces is causing these weird values
- I have a cheap Xiaomi smartwatch
- It syncs data over BT to Xiaomi's app
- Then syncs into Google Fit
- Finally syncs to Strava
- I then downloaded a zip with all of my strava profile's information
Problem
Upon trying to parse the files, I ran into an exception. After some debugging, my hypothesis of what the problems is:
Some functions, like process_type_date_time expect to receive a number value (int? int/float?) to build a datetime from, number being a timestamp. However, my files are reading 4-element tuple of ints.
These numbers seem to work fine if re-interpreted as the bytes making up a wider integer (value = int.from_bytes(value, "big"))
I would add an utility function like parse_datetime(value: object) -> datetime, using isinstance(int, float) for the exact code that is in the repo already, isinstance(tuple) to use the "workaround" described above before existing translation, raising an exception on any other types (or tuples with len != 4)
However, this feels like a workaround rather than a proper solution (or perhaps not even something to solve, but a bug on the data pipeline to get here).... As such, I'm considering whether a PR would be desired