Closed ansluk closed 4 years ago
I have not looked in detail nor reproduced this issue yet, but looking at fix_movescount.py shows it doesn’t work on the open activity, but it loop over all activities of certain type applying other data processors, I am not sure it is an expected or supported behavior. The GC way of doing this is to enable those data processors to run on import, this makes the process automatic and avoid repeated application.
Aha, I see my python processor will appear in the list of automatic import processors. I did not realize this. When removing looping over several activities from the python script and setting the script as an automatic import processor in Options -> Data fields -> Processing Everything works as expected.
In that case you can use a filter expression in the top-right filter box, see https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Special-Topics_Formula-Syntax-and-Expressions#postprocessprocessor-expression
The call to activities with a filter is causing the crash, that method is intended to be run in a Python Chart context, and it is crashing when it doesn't have one. Currently to work on other activities than the one on which the Data Processor is running is not supported, we need to find a way to avoid this crash, but this is not recommended. What you can do in this case is to use a Python fix to run the DPs you want, in the order you like, but on only on the current activity. From your example:
GC.postProcess('Fix GPS errors')
#GC.postProcess('Estimate Distance Values')
GC.postProcess('Fix Speed from Distance')
GC.postProcess('Fix HR Spikes')
works for me with your test data.
I'm trying to use Python fixes to clean up fit files exported from Movescount web site that the GC fit importer doesn't like so much. Running the python scripts crashes GC.
fix_movescount.py script will crash GC when running without writing something before in the python console of "New python fixes"
Script will run if python console is used before.
Thanks, Anders
fix_movescount.py.txt
configglobal-pyfixes.ini.txt
test_activities.zip
crash_2231_240520.log
crash_2231_240520.dmp.zip