alex-hhh/ActivityLog2

Buggy behavior with PMC chart

misev opened this issue · 3 comments

misev commented

I'm observing some strange behavior with the PMC chart: depending on the range of dates I put, it will drop some of the data and end up being quite inaccurate.

E.g. if I select last 6 months, it will not take into account data before Oct 25:

Screenshot_20201122_141736

If I select 6 weeks, then it drops the data after Oct 25:

Screenshot_20201122_141906

I have one Running activity on Oct 25, but there's nothing unusual about it that I can see.

Unrelated to the problem: does the PMC consider all activities? I have a mix of running/cycling, but would prefer to focus it on the running ones.

I cannot reproduce this on my own data set and I cannot think of what may cause this, so I can only offer you some general advice on how to further diagnose the issue.

The PMC chart is implemented in the trends-pmc.rkt file. There are two implementations, but "method 2" is used, which would be the functions produce-pmc-data/method-2, which calls produce-pmc-data-2, which uses get-daily-tss to retrieve the data from the database.

I would start the investigation by adding some printf statements to get-daily-tss to find the SQL query parameters for the start and end dates, than run the SQL query separately on your database to find out what values it produces for different settings. You can run the query using any SQLite client, or access the SQLIte database from any programming language you are familiar with. This result would tell us if the data is different between the two settings (last 6 months and last 6 weeks).

As a side note, the terms NP, TSS and IF are trademarked, but I only found out about that after I started writing the code. Inside the code, these names are still referenced as NP, TSS, etc, but in the GUI they have been replaced with the terms "Weighted Power" and "Effort" -- this will create some confusion, but I cannot use those terms directly in the GUI.

Unrelated to the problem: does the PMC consider all activities? I have a mix of running/cycling, but would prefer to focus it on the running ones.

Currently, the PMC chart will consider all activities which have an effort (TSS) set. The effort is set either by reading it from the FIT file, or calculating it from the HR data. You can also set the effort using the "Activity / Edit Effort..." menu.

There is currently no way to select only a subset of activities, but this functionality could be added easily. Other trend charts have examples on how to provide a GUI to select the sport (and maybe labels), and the get-daily-tss query could be updated to filter on sport (and maybe labels).

Hi @misev , I am not sure if you are still using this application, but if you do, are you still experiencing this problem with the PMC chart? Unfortunately, I cannot reproduce this issue (the PMC chart works for me in all cases), so I am not sure how to progress this.

misev commented

I still use the application, but the PMC is not critical for me so we can close the problem. Thanks for responding about it in any case!