Skip to content

Problems reading file #33

@elpekenin

Description

@elpekenin

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

  1. I have a cheap Xiaomi smartwatch
  2. It syncs data over BT to Xiaomi's app
  3. Then syncs into Google Fit
  4. Finally syncs to Strava
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions