| tail -n$$(echo "$$(wc -l < results.html) - $$(grep -n '<body>' \
< results.html | cut -d ':' -f 1,1) - 2" | bc ) > $@
-stats: *.txt
+statfigures: oslist.txt swlist.txt datamodlist.txt
+# create "lockfile'
+ @touch $@
+ @[ "$$(cat nsubmissions.stamp || true)" != "$$(ls -1 data |wc -l)" ] \
+ && ls -1 data |wc -l > nsubmissions.stamp \
+ && MVPA_MATPLOTLIB_BACKEND=agg ./makestats data figures || true
+# remove lockfile
+ @-rm $@
getdata:
rsync -rvzlhp --delete \
grep '"bg_datamod"' survey.rst | sed -e 's/.*name="bg_datamod" value="//' \
-e 's," />,: ",' -e 's,<br />$$,",' -e 's/ "$$/ "Other"/' > $@
-upload: index.html results.html results_snippet.html jquery.form.js survey.css
+upload: index.html results.html results_snippet.html jquery.form.js survey.css surveycollector.cgi
rsync -rvzlhp --delete \
- --exclude=Makefile --exclude='*.inc' --exclude='*.rst' --exclude='*.txt' \
- --exclude=makestats --exclude=surveydata --exclude='*.cgi' \
- --chmod=Dg+s,g+rw * neurodebian@www.pymvpa.org:/home/www/neuro.debian.net/www/survey/
+ --exclude='*.txt' --exclude=surveydata --exclude='*.cgi' --exclude=figures \
+ --chmod=Dg+s,g+rw * neurodebian@www.pymvpa.org:/home/neurodebian/survey/
+ scp surveycollector.cgi neurodebian@www.pymvpa.org:/srv/neuro.debian.net/cgi-bin/
#!/usr/bin/python
+from mvpa.misc.plot.base import plot_bars
from glob import glob
-import json
+try:
+ from json import load as jload
+ def jsonload(f):
+ return jload(f)
+except ImportError:
+ from json import read as jread
+ def jsonload(f):
+ return jread(f.read())
import sys
import pylab as pl
import numpy as np
import time
-from mvpa.misc.plot.base import plot_bars
# uniform colors for OS results
os_colors = ['#B63537', '#4E4DA0', '#008200', 'gray']
return
datafilenames = glob('%s/*.json' % srcdir)
for dfn in datafilenames:
- rawdata = json.load(open(dfn))
+ rawdata = jsonload(open(dfn))
self[rawdata['timestamp']] = rawdata
def get_unique(self, key):
stats[osf] = float(stats[osf]) / total_count
env_stats[env] = stats
# make stacked barplot
- pl.figure(figsize=(6.4, 4.8), facecolor='w', edgecolor='k')
+ pl.figure(figsize=(6.4, 4.8))
x = np.arange(len(envs))
bottoms = np.zeros(len(envs))
for i, os in enumerate(os_order):
spd = db.get_counts('bg_datamod')
spd = sorted(spd.items(), cmp=lambda x, y: cmp(x[1], y[1]))[::-1]
x = np.arange(len(spd))
- pl.figure(figsize=(6.4, 4.8), facecolor='w', edgecolor='k')
+ pl.figure(figsize=(6.4, 4.8))
pl.title('Submissions per data modality')
pl.bar(x, [s[1] for s in spd])
pl.xticks(x + 0.5, [db.datamod_dict[k[0]] for k in spd], rotation=-10)
res = db.get_counts('software_resource')
res = res.items()
x = np.arange(len(res))
- pl.figure(figsize=(6.4, 4.8), facecolor='w', edgecolor='k')
+ pl.figure(figsize=(6.4, 4.8))
pl.title('Software resources')
pl.bar(x + (1./8), [s[1] for s in res], width=0.75, color = '#008200')
pl.xticks(x + 0.5, ['' for s in res])
pl.text(i+.5, 0.1, db.get_nice_name(s[0]), rotation=90,
horizontalalignment='center',
verticalalignment='bottom',
- bbox=dict(facecolor='white', alpha=0.8, edgecolor='white',
- color='white'))
+ bbox=dict(facecolor='white', alpha=0.8, edgecolor='white'))
pl.ylabel('Number of submissions')
pl.savefig('%s/software_resources.png' % destdir, format='png', dpi=80)
def mkpic_software(db, destdir):
for typ in sw_categories.keys():
counts = db.get_counts('sw_%s' % typ)
- pl.figure(figsize=(6.4, 4.8), facecolor='w', edgecolor='k')
+ pl.figure(figsize=(6.4, 4.8))
pl.title("Software popularity: %s" % db.get_nice_name(typ))
if not len(counts):
pl.text(.5, .5, "[Insufficient data for this figure]",
pl.text(i+.5, 0.1, db.get_nice_name(s[0]), rotation=90,
horizontalalignment='center',
verticalalignment='bottom',
- bbox=dict(facecolor='white', alpha=0.8, edgecolor='white',
- color='white'))
+ bbox=dict(facecolor='white', alpha=0.8, edgecolor='white'))
pl.xlim(0, len(stats))
pl.ylabel("Number of submissions")
pl.savefig('%s/sw_%s.png' % (destdir, typ), format='png', dpi=80)
def mkpic_rating_by_os(db, env, items, destdir, title):
- pl.figure(figsize=(6.4, 4.8), facecolor='w', edgecolor='k')
+ pl.figure(figsize=(6.4, 4.8))
for i, os in enumerate(os_order):
ratings = [db.select_match(env,
os_family[os]).get_not_none('%s' % (it,))[0]