.. Enable click through from the data points on a generic chart
when on trends view.
.. This commit includes the 'addCurve' bindings to pass the
activity filenames from R, Python and the User Chart.
.. It also includes a new DataFilter function 'filename' to
get a vector of strings that are the filenames for the
activities in the selected date range (or the filename
for the currently selected activity).
.. The second commit will include the interaction code for
GenericPlot to click-thru a selection.
For Windows we use Python embeddable distribution
For Linux the relocatable Python AppImage
Packages included: sip, numpy, pandas, scipy, lmfit and plotly
[publish binaries]
[skip appveyor]
Initially: sip, numpy, pandas, scipy, lmfit and plotly
Deployed Python added to search path
Binaries reference the Python library on Cellar
Related to 2c0ce8f5c5
.. allow data labels for points on the chart, added to User, R and
Python chart addCurve() etc.
.. NOTE: opengl painting ignores this setting so should be disabled
for data series that want labels. We do not do this
automatically, but might consider that later.
.. GC.annotate(type="label", series="Power", label="CP=222") added to
the python chart to add a label to the legend for displaying things
like parameter estimates.
.. it does feel like annotations will need to be thought thru and likely
result in a GenericAnnotation class. But lets cross that bridge
when we get there.
.. Label annotations are enough to get started and are now present in
User, R and Python charts.
.. you can now configure if a series is shown on the legend, this is
for lines or curves that are there for illustration but do not
need to be displayed in the legend / hovered.
.. added GenericChart which manages a collection of plots, so
you can plot multiple series stacked (like in AllPlot).
.. additionally added option to set layout vertical or
horizontal, since its useful to layout scatter plots
horizontally where time series will be largely vertical.
.. at this point the code is slightly refactored to add
GenericChart between PythonChart and GenericPlots.
.. will shortly add code to support managing multiple plots
in layouts and adapting if settings change (.e.g the
python script is edited, settings are changed).
.. updated to support different linestyles and also legend can
now be placed above, below, left or right of the chart and
orientated to list series vertically or horizontally.
.. the vertical legend is a bit ugly as nothing lines up, will
fix up separately.
Basics now in place to plot line, scatter, pie and bar
charts. This commit finishes off the final bit of part
2, adding axes control.
A new GC api, GC.setAxis(..) has been added allowing
fine grained control on the axes added automatically.
They reference axes by name, based upon the xaxis and yaxis
parameters passed to the GC.setCurve(..) function.
GC.setAxis(..) should be called /after/ the curves are
added since it will not create axes in advance.
Added Pie and Bar charts with some rudimentary axes
being created automatically.
Need to follow up with mechanism to work with axes from
within the python script, likely needs a new binding.
Updating the python chart to render via a Qt Chart in addition
to the existing web page rendering.
Five aspects are planned:
1. Add QT chart option, basic rendering of Line+Scatter (this commit)
2. Add legend and axes, support for Pie and Bar charts
3. Add interactivity / hover etc
4. Add options for annotations and markers
5. Add more advanced charts and chart objects
There is an example in the tests folder, but at this point the
chart is very basic, but the main plumbing is in place.
* Initial implementation of Python data processors
* Add RideEditor to PyFIx script editor
* Enable write-access to activity data for python fixes
* Add GC.deleteActivitySample method
* Add GC.deleteSeries method
* Check for python fix for changes before close
* Build python fixes menu dynamically
* Make python fixes first class data processors
* Add GC.postProcess method
* Check GC_WANT_PYTHON and "Enable Python" setting for python fixes
* Add GC.createXDataSeries method
* Clean up ScriptContext ctor mess
* Support editing xdata series
* PDP: Implement xdata append/remove methods
xdataNames, xdataSeries and xdata refer to low level functions
activityXdata is a wrapper to obtain XData series by name without interpolation
activity includes all XData series interpolated
When name="" it returns XData names
When name is one of the names for the activity it returns valuenames
To dinamically obtain names/series for activityXdata and activityXdataSeries
Carry RideItem, Specification and Metrics to consider the cases when
the script is part of a UserMetric or an LTMPlot formula
Python series, activityWbal and activityXdata honor RideItem and Specification
Python activityMetrics honors ScriptContext RideItem and Metrics
Python activityMeanMax honors ScriptContext RideItem
Force recomputation of metrics just in case Python Scripts were used before
.. renaming the 3 metrics they trademarked in 2013:
TSS => BikeStress
IF => BikeIntensity
NP => IsoPower
.. this will break data filters, user formula and
R and Python charts.
.. in the next commit will add user metrics to ensure
backward compatibility.
.. what a clusterfuck the Python embedding API is. If you set PYTHONHOME
it loses PYTHONPATH. But only on a Mac. Go figure.
.. so we just set the environment to the user defined value in prefs.
.. fixup trivial issues like PATHSEP and separators in general.
.. it seems that Py_SetProgramName will drive the initialisation of the
Python interpreter to set sys.path, sys.prefix and sys.exec_prefix.
.. rather than trying to fixup these directly instead we set the program
name to the python installed binary (full path).
.. you still need python in your path, will fixup in part 2.
.. lastly, also added a 'printd' macro to embed debug info, which can
be enabled in gcconfig.pri via DEFINES += PYTHON_DEBUG=true
.. look for python in path and check version and module path, then
use this when initialising to ensure the installed modules
are used, not the local copy.
.. needs testing on Windows and need to enable the user to specify
the location of Python so users don't need to modify PATH.
.. allow the user to embed a python script into a datafilter.
.. this is primarily to enable the use of python when writing
user metrics.
.. the syntax is basically "%%python script %%" and it is
evaluated as an expresssion so the results can be assigned
to a variable or returned as a value.
.. additionally GC.result(double) has been added to the python
API to enable a return value to be set by the script.
.. since Python is really sensitive about white space its going
to be best practice to embed python scripts without honoring
any of the data filter spacing, for example:
{
value {
t <-
%%python
GC.result(100)
%%;
}
}
.. is likely to be a sensible way to use this.
.. also notice how the ; is needed after the expression. This
is because %%python ... %% is a numeric expression with the
same semantics as "1 + 2"
Similar to series but used to retrieve an XData series, like the R
activity.xdata counterpart, for example: GC.xdataseries("SWIM", "STROKES")
NB: I reserved xdata(name) to retrive a whole group of series by name
with its own sampling, not implemented in this commit.