return [ {'label': label} for label in set(labels) ] def get_version_labels(summary, label): return [ { 'label': label, 'version': version, } for version in get_versions(summary, label) ] summary_field_strength = summarize_custom( cursor, 'field_strength', summarize_field_strength ) fields = get_values(summary_field_strength) def formatter(field): def _formatter(key): if isinstance(key, Key): return '{0}'.format(getattr(key, field)) return key return _formatter def sort_value(value): return value.value groups_by_year(
""" """ from neurotrends.config import mongo from neurotrends.model.utils import verified_mongo from neurotrends.analysis.groupby.naive import summarize_custom from neurotrends.analysis.groupby.naive import summarize_smooth_kernel, summarize_highpass_cutoff from neurotrends.analysis.plot.histplot import hist from neurotrends.analysis.plot.utils import file_name import numpy as np cursor = mongo['article'].find(verified_mongo, {'tags': 1, 'date': 1}) summary_smooth_kernel = summarize_custom(cursor, 'smooth_kernel', summarize_smooth_kernel) summary_highpass_cutoff = summarize_custom(cursor, 'highpass_cutoff', summarize_highpass_cutoff) hist(summary_smooth_kernel, bins=np.arange(0.5, 19.5, 1), xlabel='Smoothing Kernel', outname=file_name(['smooth-kernel'], path='hist')) hist(summary_highpass_cutoff, xlog=True, xlabel='High-pass Filter Cutoff', outname=file_name(['highpass-cutoff'], path='hist'))
""" """ from neurotrends.config import mongo from neurotrends.model.utils import verified_mongo from neurotrends.analysis.groupby.naive import summarize_custom from neurotrends.analysis.groupby.naive import summarize_smooth_kernel, summarize_highpass_cutoff from neurotrends.analysis.plot.histplot import hist from neurotrends.analysis.plot.utils import file_name import numpy as np cursor = mongo["article"].find(verified_mongo, {"tags": 1, "date": 1}) summary_smooth_kernel = summarize_custom(cursor, "smooth_kernel", summarize_smooth_kernel) summary_highpass_cutoff = summarize_custom(cursor, "highpass_cutoff", summarize_highpass_cutoff) hist( summary_smooth_kernel, bins=np.arange(0.5, 19.5, 1), xlabel="Smoothing Kernel", outname=file_name(["smooth-kernel"], path="hist"), ) hist( summary_highpass_cutoff, xlog=True, xlabel="High-pass Filter Cutoff", outname=file_name(["highpass-cutoff"], path="hist"), )
# def get_labels(labels): return [{'label': label} for label in set(labels)] def get_version_labels(summary, label): return [{ 'label': label, 'version': version, } for version in get_versions(summary, label)] summary_field_strength = summarize_custom(cursor, 'field_strength', summarize_field_strength) fields = get_values(summary_field_strength) def formatter(field): def _formatter(key): if isinstance(key, Key): return '{0}'.format(getattr(key, field)) return key return _formatter def sort_value(value): return value.value