Skip to content
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

[BUG] Error converting Open Water Swim activity #74

Closed
jimiend opened this issue Aug 25, 2023 · 1 comment · Fixed by #75
Closed

[BUG] Error converting Open Water Swim activity #74

jimiend opened this issue Aug 25, 2023 · 1 comment · Fixed by #75
Assignees
Labels
bug Something isn't working

Comments

@jimiend
Copy link

jimiend commented Aug 25, 2023

Describe the bug
./Hitrava.py -j motion.json
the command above extract all activity and convert many of them up to a certain point

Logs

dpacific@DPACIFIC-M-V63K Hitrava-5.1.1 % ./Hitrava.py -j output/HiTrack_20230731_144047.json --log_level DEBUG
2023-08-25 17:24:11,655 - INFO - main - Hitrava version 5.1.1 (build 2207.2501) started with arguments ['-j', 'output/HiTrack_20230731_144047.json', '--log_level', 'DEBUG']
2023-08-25 17:24:11,655 - INFO - main - Running on Python version 3.9.12
2023-08-25 17:24:11,657 - INFO - parse - Found one or more activities in JSON at index 0 to parse from 2023-07-31 (YYY-MM-DD)
2023-08-25 17:24:11,658 - INFO - _parse_activity - Saving activity from 2023-07-31 21:40:47 to HiTrack file ./output/HiTrack_20230731_144047 for parsing
2023-08-25 17:24:11,660 - INFO - parse - Parsing file <./output/HiTrack_20230731_144047>
2023-08-25 17:24:11,661 - DEBUG - __init__ - New HiTrack activity to process <HiTrack_20230731_144047>
snip
2023-08-25 17:24:11,749 - DEBUG - _close_file - HiTrack file <./output/HiTrack_20230731_144047> closed
2023-08-25 17:24:11,749 - INFO - set_activity_type - Setting activity type of activity HiTrack_20230731_144047 to Swim_Open_Water
2023-08-25 17:24:11,749 - INFO - set_pool_length - Setting pool length of activity HiTrack_20230731_144047 to 0
2023-08-25 17:24:11,749 - WARNING - set_pool_length - Pool length for activity HiTrack_20230731_144047 of type Swim_Open_Water will not be used. It is not a pool swimming activity
2023-08-25 17:24:11,749 - DEBUG - normalize_distances - Normalizing distance data for activity HiTrack_20230731_144047
Traceback (most recent call last):
  File "/Users/dpacific/expect/Hitrava-5.1.1/./Hitrava.py", line 2165, in <module>
    main()
  File "/Users/dpacific/expect/Hitrava-5.1.1/./Hitrava.py", line 2156, in main
    hi_activity.normalize_distances()
  File "/Users/dpacific/expect/Hitrava-5.1.1/./Hitrava.py", line 825, in normalize_distances
    segment['distance'] = segment['distance'] / normalize_ratio
KeyError: 'distance'
2023-08-25 17:24:11,758 - DEBUG - _close_json - JSON file <output/HiTrack_20230731_144047.json> closed

Files
Attaching the offending activity
Link removed

Additional Context
It is the first open water activity I try to convert

@CTHRU
Copy link
Owner

CTHRU commented Aug 25, 2023

Thank you for reporting the issue. From the logs, it looks like we have an open water swim activity without distance information. I can't look into it now, but I will try to see if anything can be done about it within the next week.

@CTHRU CTHRU self-assigned this Aug 26, 2023
@CTHRU CTHRU added the bug Something isn't working label Aug 26, 2023
@CTHRU CTHRU changed the title [BUG] [BUG] Error converting Open Water Swim activity Aug 26, 2023
CTHRU added a commit that referenced this issue Aug 26, 2023
#### Solved Issues
- Conversion failed for open water swimming activities in conjunction with distance normalization. Closes #74.
@CTHRU CTHRU mentioned this issue Aug 26, 2023
@CTHRU CTHRU closed this as completed in #75 Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants