pymaid.get_team_contributions¶
- pymaid.get_team_contributions(teams, neurons=None, remote_instance=None)[source]¶
Get contributions by teams (nodes, reviews, connectors, time invested).
Notes
Time calculation uses defaults from
pymaid.get_time_invested()
.total_reviews
>total_nodes
is possible if nodes have been reviewed multiple times by different users. Similarly,total_reviews
=total_nodes
does not imply that the neuron is fully reviewed!
- Parameters
dict (teams) –
Teams to group contributions for. Users must be logins. Format can be either:
Simple user assignments. For example:
{'teamA': ['user1', 'user2'], 'team2': ['user3'], ...]}
Users with start and end dates. Start and end date must be either
datetime.date
or a singlepandas.date_range
object. For example:{'team1': { 'user1': (datetime.date(2017, 1, 1), datetime.date(2018, 1, 1)), 'user2': (datetime.date(2016, 6, 1), datetime.date(2017, 1, 1) } 'team2': { 'user3': pandas.date_range('2017-1-1', '2018-1-1'), }}
Mixing both styles is permissible. For second style, use e.g.
'user1': None
for no date restrictions on that user.CatmaidNeuron/List (neurons skeleton ID(s) |) – Restrict check to given set of neurons. If CatmaidNeuron/List, will use this neurons nodes/ connectors. Use to subset contributions e.g. to a given neuropil by pruning neurons before passing to this function.
optional – Restrict check to given set of neurons. If CatmaidNeuron/List, will use this neurons nodes/ connectors. Use to subset contributions e.g. to a given neuropil by pruning neurons before passing to this function.
remote_instance (CatmaidInstance, optional) – Either pass explicitly or define globally.
- Returns
DataFrame in which each row represents a neuron. Example for two teams,
teamA
andteamB
:skeleton_id total_nodes teamA_nodes teamB_nodes ... 0 1 total_reviews teamA_reviews teamB_reviews ... 0 1 total_connectors teamA_connectors teamB_connectors ... 0 1 total_time teamA_time teamB_time 0 1
- Return type
pandas.DataFrame
Examples
>>> from datetime import date >>> import pandas as pd >>> teams = {'teamA': ['user1', 'user2'], ... 'teamB': {'user3': None, ... 'user4': (date(2017, 1, 1), date(2018, 1, 1))}, ... 'teamC': {'user5': pd.date_range('2015-1-1', '2018-1-1')}} >>> stats = pymaid.get_team_contributions(teams)
See also
get_contributor_statistics()
Gives you more basic info on neurons of interest such as total reconstruction/review time.
get_time_invested()
Time invested by individual users. Gives you more control over how time is calculated.