nwb_project_analytics.codecovstats module

Module for getting data from Codecov.io

class nwb_project_analytics.codecovstats.CodecovInfo

Bases: object

Helper class for interacting with Codecov.io

static get_pulls_or_commits(gitrepo, page_max=100, state='merged', key=None, branch=None)

Get all infos from pull request from Codecov.io

Parameters:
  • gitrepo (GitRepo) – GitRepo object with the owner and repo info

  • page_max – Integer with the maximum number of pages to request. Set to None to indicate unlimited. (default=100)

  • state – Filter list by state. One of all, open, closed, merged. Default: merged

  • key – One of ‘pulls’ or ‘commits’

  • branch – Branch for which the stats should be retrieved. (Default=None)

Returns:

List of dicts (one per pull request) in order of appearance on the page

static get_time_and_coverage(pulls_or_commits, filter_zeros=True)

Get the timestamps and total coverage information for all given pull requests.

Parameters:
  • pulls – List of dicts (one per pull request usually generated via the CodecovInfo.get_pulls

  • filter_zeros – Boolean indicating whether coverage values of 0 should be removed

Returns:

Tuple of three numpy arraus 1) Sorted array of datetime objects with the timestamps 2) Array of floats with the percent coverage data corresponding to the timestamps 3) Array of pulls missing coverage data