GithubHelp home page GithubHelp logo

vmpy's Introduction

VMPY - Performance Velo Metrics Toolbox

VMPY is a toolbox for evaluating typical Cycling Performance Metrics from the ride data e.g. power, heart-rate, velocity, gradient, cadence streams.

All functions within the package do follow the convention, where input/output formats are either traditional Python built-in data structures or are the nd-arrays. This design choice favors easy integration into other projects, e.g. velometria.com

To help you getting started VMPY also provides a very thin wrapper around the Strava API.

Installation

Official release:

pip install vmpy

The bleeding edge work in progress:

pip install git+git://github.com/sladkovm/vmpy.git@development

Scope

The VMPY package provides the following functionality:

streams.py: Streams shape preserving calculations e.g. masking, filtering, zone conversions

metrics.py: Cycling Performance Metrics

strava.py: Python wrapper around the Strava API v3 for fetching Athletes, Activities and Stream data

Usage

>>> from vmpy import strava
>>> stream = strava.retrieve_streams(activity_id=1282167861, access_token=STRAVA_ACCESS_TOKEN)
>>> from vmpy import streams
>>> power_zones = streams.compute_zones(stream['watts'], ftp=270)
>>> hr_zones = streams.compute_zones(stream['heartrate'], lthr=160)
>>> watts_3sec = streams.rolling_mean(stream['watts'], window=3, mask=stream['moving'])
>>> gradient_wo_outliers = streams.median_filter(stream['grade_smooth'], window=31, threshold=1)
>>> from vmpy import metrics
>>> normalizes_power = metrics.normalized_power(stream['watts'])
>>> time_in_power_zones = metrics.time_in_zones(stream['watts'], ftp=260)

Quick Start

Register Strava App

In order to be able to use Strava API the user App must be registered at the linkhttp://www.strava.com/developers:

Application Name: ex.: My Awesome App

Website: ex.: myawesomeapp.com (can be anything, even your FB or Strava page will do)

Application Description ex.: Just fooling around with some Strava data

Authorization Callback Domain 127.0.0.1 (unless you are building a serious App)

Access Token

The Access Token will be found at the users profile page It will look like this: 83ebeabdec09f6670863766f792ead24d61fe3f9

Access Token must be passed explicitly as an argument to the functions found in strava.py module

Contribution guidelines

This project is absolutely open for contributions. No strong guidelines yet, except for:

  1. Don't push on master branch
  2. Test
  3. Write docstrings in NumPy style

Useful links

vmpy's People

Contributors

sladkovm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vmpy's Issues

Tidy app activity Strava plot method

Top panel:

  • Elevation profile - shaded
  • Speed - line
  • cadence - bar chart

Middle panel:

  • Elevation profile
  • Power profile

Lowest chart:

  • Elevation profile
  • Heartbeat profile

Provide choice of X axis - distance/time

Set up ranges for axes:
X axis is tight

Reduce number of ticks on the Y axis

Add some totals next the the Y axis:

Speed - max, median, average
Power - max, NP, average
Heartbeat - max, median, average

Automate streams shift estimate

Algorithms to implement:

  1. Cross-correlation analysis - shift would correspond to maximum correlation value
  2. Use DTW - the mean shift in the warp path is a good measure of optimal shift
  • use on power - 1D
  • use on latlng - 2D
  • Try python version of imregcorr - essentially the same as cross-correlation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.