Commit Graph

10105 Commits

Author SHA1 Message Date
Mark Liversedge
474edee78f VERSION 3.6 DEVELOPMENT OCTOBER 2021
.. mark up a development release for more testing.
v3.6-DEV2110
2021-10-09 11:18:46 +01:00
Alejandro Martinez
ae8a8c0b4b Python - add importlib_metadata to requirements
To support libraries using importlib.metadata in Python 3.8
Fixes #4047
2021-10-07 12:02:50 -03:00
Mark Liversedge
6c0c56ab5b Ignore Qt Creator build directories
.. keeps git status clean.

[skip ci]
2021-10-06 11:01:04 +01:00
Mark Liversedge
09e2ac95da Use doxygen to generate code documentation
.. run make in src/doc/doxygen to generate documentation for the
   source code in html and latex format.

.. doing this to get some basic docs going, since the codebase is
   now so large its getting difficult for even the core team to
   remember.

.. the subdirectories generated are ignored (see .gitignore)

[skip ci]
2021-10-05 09:58:56 +01:00
Alejandro Martinez
fab0c1aae4 Updated Linux build instructions
[skip ci]
2021-10-04 16:04:34 -03:00
Erik Botö
10317e4730 travis/linux: use quiet mode for unzip and pip 2021-10-04 13:02:19 -03:00
Erik Botö
8330664467 travis/linux: use --no-verbose on all wget commands
Use --no-verbose in order to avoid having a lot of wget progress
information in the travis logs, since the logs seems to be sometimes
becoming larger than 4 MB which results in aborted jobs.
2021-10-04 13:02:19 -03:00
Erik Botö
4f30e98e50 Fix python-version in travis after_success.sh for linux build
The upstream AppImage for python3.7.x got upgraded from 3.7.11 to
3.7.12, causing the script to fail.
2021-10-04 13:02:19 -03:00
Alejandro Martinez
272963b832 Python embedding - print error messages to stderr
To diagnose system dependent user reported problems
2021-10-02 19:26:21 -03:00
Mark Liversedge
ff3d6b4a63 Generic Annotations
.. refactor to introduce Generic Plot annotations that
   can draw onto the chart scene, but managed by our
   own controller so we can add/remove without affecting
   or interacting with the QtCharts code.
2021-10-02 12:06:38 +01:00
Alejandro Martinez
734d9c2739 Update Travis build status in Readme
[skip ci]
2021-10-01 17:29:54 -03:00
Mark Liversedge
d0bb437fc0 Chartspace more tolerance in hover on tile edges
.. on hidpi displays it took a deft touch to grab the edges of
   a tile, since the tolerances did not take into account the
   hi density of pixels.
2021-10-01 12:49:15 +01:00
Mark Liversedge
d7957363ff Fix Legend Proportions (and spacing bug)
.. legend item spacing and linewidth is now proportional to the
   text height, which resolves the jarring sizes when not scaled.

.. there was a bug related to the height calculation that did not
   take into account the space left below the colored line which
   made it overlap the text.
2021-10-01 12:47:53 +01:00
Mark Liversedge
aecc1c970a Datafilter syntax highlighter and "()[]{}"
.. bracket matching code for ( and ) fixed up as well as adding
   support for matching [ and ].

.. helps to highlight errors in code when it starts to get a
   little complex.
2021-10-01 08:50:54 +01:00
Mark Liversedge
7be34c1dcd malloc.h, you ok grandad?
.. its stdlib.h now old timer.
2021-09-30 19:56:43 +01:00
Mark Liversedge
70ed4e36e0 Voronoi diagram on chart
.. The diagram now displays on a chart, but there are a few issues.
   Will work through them as more testing done.
2021-09-30 19:00:35 +01:00
Mark Liversedge
4f005d4491 DataFilter - annotate(voronoi, centers)
.. added a new variant for annotations to plot a voronoi diagram
   via a datafilter.

   the centers are as returned by the kmeans() function so the
   x and y values follow each other (i.e. x1 x2 x3 y1 y2 y3)

.. it is ingrated into the userchart and down to the genericplot
   for the series it arrives in.

.. next commit will add the drawing code to generic plot.
2021-09-30 12:31:40 +01:00
Mark Liversedge
5502d87af7 Additional Refactor Voronoi
.. updated to have a more Qt/C++ friendly interface:

    Voronoi *test = new Voronoi();
    test->addSite(QPointF(2,5));
    test->addSite(QPointF(3,2));
    test->addSite(QPointF(6,4));
    test->run(QRectF());
    delete test;

    the output is still written to standard out as a
    series of points, lines, vertexes and edges. This
    was to enable validation against the original
    c program.

.. whilst the original functionality is now embedded a
   further update will need to convert the output into
   a vector of lines to draw.

   will do this as part of adding it to a plot as an
   annotation.
2021-09-30 08:42:38 +01:00
Mark Liversedge
d56d52c01f Refactor Future's algorithm
.. from C to a C++ class.

   Moved the original code to a sundirectory for reference and
   moved all the global variables and methods into a new class
   called Voronoi.

.. the code still needs more work but wanted to remove the global
   variables as there were lots and a big risk they interact
   with other parts of the codebase and libraries.
2021-09-29 10:07:30 +01:00
Mark Liversedge
d568dd0e06 Linux build error (Another Voronoi fixup)
.. apologies, working on multiple platforms at once is a pain.

   will refactor the Steven Future code into its own C++ class
   in the next few days.
2021-09-28 23:02:01 +01:00
Mark Liversedge
dfdf0c5898 Fixup last commit linker error (Future's algorithm)
.. last commit introduced a compiler error on missing global variables.

   the intention here is to take future's algorithm, embed into a class
   and add wrappers for user charts / datafilters.
2021-09-28 20:00:22 +01:00
Mark Liversedge
53ee8f358c Future's Algorithm
.. for calculating Vornoi diagrams.
2021-09-28 19:28:42 +01:00
Mark Liversedge
4c720884b6 DataFilter - kmeans()
.. kmeans(centers|assignments, k, dim1, dim2 .. dimn)

   perform a k means cluster on data with multiple dimensions
   and return the centers, or the assignments.

   the return values are ordered so they can be displayed
   easily in an overview table e.g.

   values {
       kmeans(centers, 3, metrics(TSS), metrics(IF));
   }

.. will look at how we might plot these in charts with either
   color coding of points or perhaps voronoi diagrams.
2021-09-28 17:31:09 +01:00
Mark Liversedge
4c6c8e6d71 Additional Windows fixups for Fast Kmeans
.. std::max needs <algorithm> and don't need <unistd> at all.
2021-09-28 11:45:34 +01:00
Mark Liversedge
5fb2dfb73e Fast Kmeans on Windows
.. remove unused general functions that work with memory and time
   in a non-portable way.
2021-09-28 11:35:32 +01:00
Mark Liversedge
1dc1cd678f Fast Kmeans Algorithm
.. with grateful thanks to Greg Hamerly

   A fast kmeans algorithm described here:
   https://epubs.siam.org/doi/10.1137/1.9781611972801.12

   The source repository is also here:
   https://github.com/ghamerly/fast-kmeans

   NOTE:

   The original source has been included largely as-is with
   a view to writing a wrapper around it using Qt semantics
   for use in GoldenCheetah (e.g. via datafilter)

   The original source included multiple kmeans algorithms
   we have only kept the `fast' Hamerly variant.
2021-09-28 10:25:17 +01:00
Alejandro Martinez
a3c1f6d2fc Check for inconsistencies between Speed and Distance/Time in Editor
Only the first 10 examples are reported to avoid anomalies log flooding.
This anomalies can be easily fixed using Fix Speed from Distance tool
with moving average windows set to 1.
2021-09-21 18:45:42 -03:00
Mark Liversedge
fb76ecc33c pdf and cdf for Gamma distribution
.. its quite handy.
2021-09-20 21:27:44 +01:00
Mark Liversedge
8580a45c38 Datafilter pdf/cdf for normal and beta distributions
.. renamed pdf/cdf to pdfnormal and cdfnormal as they returned
   a pdf for a guassian.

.. added pdfbeta(a,b,x) and cdfbeta(a,b,x) for working with
   beta distributions.
2021-09-20 19:16:52 +01:00
Mark Liversedge
ca3a48c0bc Fixup cdf
.. should be monotonically increasing not decreasing.
2021-09-19 12:11:43 +01:00
Mark Liversedge
e26ab4f957 Datafilter - Gaussian Probability functions
.. pdf(x) and cdf(x) return the probability density function
   and cumulative density function for x.
2021-09-19 09:00:47 +01:00
Mark Liversedge
d97adfe987 Overview User Chart Export
.. save to .gchart when a user chart is on an overview.

   rather annoyingly the scaling is preserved which should
   ideally be defaulted on import depending upon context.
   we should fix that.
2021-09-18 19:11:57 +01:00
Mark Liversedge
65853b095d Overview Import Chart
.. Create a new tile on an overview by importing the XML .gchart.

   The importer checks the chart is a user chart and also that
   it was created for the current view (Analysis vs Trends).
2021-09-18 17:53:42 +01:00
Mark Liversedge
c592de6af9 Export Overview Data Table to CSV
.. via an "Export Data" button in the config dialog.
2021-09-17 14:01:08 +01:00
Mark Liversedge
e0892371b7 Overview respond to interval hovering
.. Data table and Interval Bubble generate and respond to
   interval signals like hover and select.

.. a compromise to help users navigate the data when it
   is not possible to clickthru for intervals

.. the data table now accepts a new function i {} which
   returns the names of the intervals for each row in
   a similar way to f {} for activities.
2021-09-14 17:55:59 +01:00
Mark Liversedge
6236611aee Interval time tweak
.. time_to_string is for formatting durations, so it will
   use as few characters as possible (e.g 10s, 1:00).

   since the interval time is a time of day we want the
   full hh:mm:ss format.
2021-09-14 09:17:07 +01:00
Alejandro Martinez
ea26efc44a Add intervals(time) to formula language
Fixes #4040
2021-09-13 18:48:42 -03:00
Mark Liversedge
60430fa97b Datafilter - match() should only return first match
.. all matches were being returned, which was not the documented
   behaviour, nor generally the desired result

   i.e.
   match(c(1,2,3), c(1,2,3,1,2,3,1,2,3));
   would return
   [ 0, 3, 6, 1, 4, 7, 2, 5, 8 ]
   but should have returned
   [ 0, 1, 2 ]

.. there are likely two things users would like to be able to
   control that could be added in the future:

   - match all occurences (this commit stops that now)
   - return NA or -1 for items that are note found
2021-09-13 22:03:39 +01:00
Mark Liversedge
437c38f959 Limit palette for a Heatmap color
.. hue goes red-yellow-green-cyan-blue-magenta-purple-red

   we only really want the first half of that range for our
   heatmap, which effectively makes it red-amber-green with
   cyan for very low numbers.

   As a palette it will make a lot more sense to the majority
   of users.

   We may look to add multiple schemes, for example limit to
   a single color range or brown/blue etc etc.
2021-09-13 17:05:11 +01:00
Mark Liversedge
08876a9065 Datafilter - metrics(time)
.. to get time of day for ride.
2021-09-13 15:57:12 +01:00
Alejandro Martinez
4d9367ed20 Add Time for the current activity to formulas
Part 1 of #4040
2021-09-12 20:06:26 -03:00
Mark Liversedge
dab1520e39 Overview Data Table scroll wheel
.. horrible nested scrolling- when in a data table and there
   are multiple rows any wheel event will scroll whilst the
   mouse cursor is over the table.

.. we do check that the mouse moved too, so if just scrolling
   with the mouse wheel it won't trigger until the mouse
   is moved (but most folks aren't that steady on the mouse!).
2021-09-12 14:48:56 +01:00
Mark Liversedge
be5f0b3d22 Datafilter - "vector1[indexes] <- vector2" fixup
.. if you assign to a vector using indexes it was only setting
   with a single value. But it should be possible to assign
   a vector and have it repeat

   e.g.
   a <- c(1,2,3,4,5,6);
   indexes <- c(3,4,5);
   a[indexes] <- c(9,10);
   # a now contains [ 1, 2, 9, 10, 9, 6 ]

.. also as part of the data table click thru, the highlight
   that a row can be clicked to navigate to the ride
   should only be shown if that row has a file name.

.. both fixups are related to listing PMC data in an overview
   data table and allowing click through for the rows that
   have a ride associated, the code looks like this:

   f {
       # find dates that contain rides
       ridedates <- metrics(date);
       pmcdates <- pmc(BikeStress,date);
       index <- match(ridedates, pmcdates);

       # returning all blanks for filenames
       # except where there is a ride on that date
       returning <- rep("", length(pmcdates));
       returning[index] <- filename();
       returning;
   }
2021-09-11 17:00:38 +01:00
Mark Liversedge
bd64625c05 Heat and Normalize
.. tweaking the names from the last couple of commits

   * to return heatmap values (between 0 and 1) the
   Data Table function "h" is now called "heat".

   * the data filter function that does the unity based
   normalization is renamed from "heat" to "normalize".

.. did this since normalize() is more accurate and
   will be more appropriate when adapting data to
   use other algorithms in the future.
2021-09-11 08:58:38 +01:00
Mark Liversedge
cb874b6793 Heat color on trends overview
.. activities legacy program reinstated and also sets the h {}
   function for the activity list.

.. the DataOverviewItem::setDateRange() method now calls h {}
   if it is present (forgot in last commit)
2021-09-10 21:05:55 +01:00
Mark Liversedge
2477096345 Overview Data table heat coloring
.. added a heat(min,max,value) data filter function to convert
   values to a heat value between 0 and 1

   e.g. heat(0,config(pmax),Average_Power)

.. added Utils::heatcolor(x) method to convert a heat value
   from 0-1 to a hue/saturation value color

.. the overview program now has another user definable function
   called h {} which returns the heat values. If it is not
   present no heat coloring takes place.

.. added h {} to the legacy intervals program, it adds the
   h {} function but calling heat() with 0 for min and max
   which ultimately makes it do nothing-- crucially the
   user can adapt the min and max values to meet their
   requirements
2021-09-10 14:45:49 +01:00
Mark Liversedge
f6375f18f9 Overview Table Header Line too thin
.. not sure when this changed, but makes the line disappear
   when so thin.
2021-09-09 10:38:49 +01:00
Alejandro Martinez
a6628eb447 Reposition Interval and Banister helpers when off window
This is already fixed when it is out to the right,
but still can happen to the left, continuation of b36bbdc
2021-09-08 12:43:59 -03:00
Mark Liversedge
e3e826a017 Blocks can be used as datafilter function parameters
.. mostly to make using the activities() function a lot
   simpler. A parameter can include a block of code that
   should be evaluated as a parameter.

   e.g:

   activities("isRun", { xx <- metrics(date);
                         yy <- metrics(Pace); } );

   this avoids having to declare a function and call it
   just so we can pass as a function parameter.
2021-09-04 17:31:31 +01:00
Alejandro Martinez
578a7fb263 Spanish Translation - Last update
Until errors are reported or new terms added.
2021-09-03 12:25:22 -03:00