def tasks(): tasks = Task.query.all() count_task_by_type = Counter() count_task_by_quantity = Counter() for a_task in tasks: count_task_by_quantity.update( {a_task.task_type.value: a_task.quantity}) count_task_by_type.update([a_task.task_type.value]) plot_by_type = create_plot_bar(count_task_by_type) plot_by_quantity = create_plot_bar(count_task_by_quantity) return render_template('tasks.html', plot_1=plot_by_type, plot_2=plot_by_quantity)
def design(): desings = ExperimentDesign.query.all() word_list = [] c = Counter() c2 = Counter() for a_desing in desings: # word_list.append(a_desing.design.value) word_list.append(a_desing.design) c2.update([a_desing.factor_quantity]) c.update(word_list) # pie = create_plot_pie(c) pie = create_plot_bar(c) bar = create_plot_bar(c2) return render_template('design.html', plotDesign=pie, plotFactor=bar)
def all(): measurements = Measurement.query.all() c = Counter() for m in measurements: c.update([m.measurement_type.value]) pie = create_plot_bar(c) return render_template('measurements_general.html', plot=pie)
def metadata_main(): counter_venues = Counter() counter_years = Counter() counter_institutions = Counter() counter_authors = Counter() publications = Publication.query.all() for pub in publications: counter_venues.update([pub.venue]) counter_years.update([pub.year]) counter_institutions.update(map(str.strip, pub.institution.split(';'))) counter_authors.update(map(str.strip, pub.authors.split(';'))) bar_venues = create_plot_bar(counter_venues) bar_years = create_plot_bar(counter_years) return render_template('metadata.html', plot_venues=bar_venues, plot_years=bar_years, most_common_authors=counter_authors.most_common(11), most_common_institutions=counter_institutions.most_common(7))
def time(): m_list = Measurement.query.filter_by( measurement_type=NatureOfDataSource.TIME) c = Counter() for m in m_list.all(): if m.measurement_instruments: c.update(m.measurement_instruments.replace(" ", "").split(';')) bar = create_plot_bar(c) return render_template('objective_measurements.html', plot=bar)