https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114809
Revision: 114809
Author: giovanni
Date: 2012-04-09 18:58:45 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
GPL text is now part of the comments and not a docstring anymore
Modified Paths:
--------------
trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py
trunk/tools/wsor/editor_lifecycle/lifecycle/models.py
trunk/tools/wsor/editor_lifecycle/lifecycle/scale.py
trunk/tools/wsor/editor_lifecycle/scripts/comppeak
trunk/tools/wsor/editor_lifecycle/scripts/fitcounts
trunk/tools/wsor/editor_lifecycle/scripts/mkcohort
trunk/tools/wsor/editor_lifecycle/scripts/mrtchart
trunk/tools/wsor/editor_lifecycle/scripts/normplot.py
trunk/tools/wsor/editor_lifecycle/scripts/plotpeak
trunk/tools/wsor/editor_lifecycle/scripts/rateperedits.py
trunk/tools/wsor/editor_lifecycle/scripts/timechart
Removed Paths:
-------------
trunk/tools/wsor/editor_lifecycle/scripts/sefit
Modified: trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py
===================================================================
--- trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py 2012-04-09
18:58:43 UTC (rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/lifecycle/cvsmooth.py 2012-04-09
18:58:45 UTC (rev 114809)
@@ -1,23 +1,21 @@
''' non parametric function estimation with smoothing splines '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
import sys
import numpy as np
Modified: trunk/tools/wsor/editor_lifecycle/lifecycle/models.py
===================================================================
--- trunk/tools/wsor/editor_lifecycle/lifecycle/models.py 2012-04-09
18:58:43 UTC (rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/lifecycle/models.py 2012-04-09
18:58:45 UTC (rev 114809)
@@ -1,23 +1,21 @@
# coding: utf8
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
import numpy as np
from scipy.stats import norm, chisqprob, normaltest
from scipy.optimize import curve_fit
Modified: trunk/tools/wsor/editor_lifecycle/lifecycle/scale.py
===================================================================
--- trunk/tools/wsor/editor_lifecycle/lifecycle/scale.py 2012-04-09
18:58:43 UTC (rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/lifecycle/scale.py 2012-04-09
18:58:45 UTC (rev 114809)
@@ -1,24 +1,21 @@
''' power-linear axes scale for matplotlib '''
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
from matplotlib.scale import ScaleBase, register_scale
from matplotlib.transforms import Transform, nonsingular
from matplotlib.ticker import LinearLocator, Formatter
Modified: trunk/tools/wsor/editor_lifecycle/scripts/comppeak
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/comppeak 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/comppeak 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -3,24 +3,22 @@
''' compute activity peaks '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
__author__ = "Giovanni Luca Ciampaglia"
__email__ = "[email protected]"
Modified: trunk/tools/wsor/editor_lifecycle/scripts/fitcounts
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/fitcounts 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/fitcounts 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -4,6 +4,25 @@
''' fits daily count samples '''
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
+
+__author__ = "Giovanni Luca Ciampaglia"
+__email__ = "[email protected]"
+
import os
from contextlib import closing
from argparse import ArgumentParser
Modified: trunk/tools/wsor/editor_lifecycle/scripts/mkcohort
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/mkcohort 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/mkcohort 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -1,26 +1,24 @@
#!/usr/bin/python
#:vim:ft=python
-''' finding better cohorts by real user activity '''
+''' group users into cohorts by user activity '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
__author__ = "Giovanni Luca Ciampaglia"
__email__ = "[email protected]"
Modified: trunk/tools/wsor/editor_lifecycle/scripts/mrtchart
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/mrtchart 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/mrtchart 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -3,24 +3,22 @@
''' Plots mean relaxation time chart '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
__author__ = "Giovanni Luca Ciampaglia"
__email__ = "[email protected]"
Modified: trunk/tools/wsor/editor_lifecycle/scripts/normplot.py
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/normplot.py 2012-04-09
18:58:43 UTC (rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/normplot.py 2012-04-09
18:58:45 UTC (rev 114809)
@@ -2,24 +2,22 @@
''' plots evolution of normalized peak activity '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
import os
import sys
Modified: trunk/tools/wsor/editor_lifecycle/scripts/plotpeak
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/plotpeak 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/plotpeak 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -3,24 +3,22 @@
''' plot cohort activity peak date and peak value trends '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
import os
import sys
Modified: trunk/tools/wsor/editor_lifecycle/scripts/rateperedits.py
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/rateperedits.py 2012-04-09
18:58:43 UTC (rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/rateperedits.py 2012-04-09
18:58:45 UTC (rev 114809)
@@ -4,24 +4,22 @@
Radicchi (2009), Phys. Rev. E 80, 026118, that used data from a snapshot of the
logging table from 2008. '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
__author__ = "Giovanni Luca Ciampaglia"
__email__ = "[email protected]"
Deleted: trunk/tools/wsor/editor_lifecycle/scripts/sefit
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/sefit 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/sefit 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-#:vim:ft=python
-
-''' batch model fitting (usable with xargs)'''
-
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
-__author__ = "Giovanni Luca Ciampaglia"
-__email__ = "[email protected]"
-
-import re
-import os
-import sys
-import numpy as np
-from argparse import ArgumentParser
-
-from lifecycle.models import StretchedExpon
-
-__prog__ = os.path.basename(__file__)
-
-parser = ArgumentParser(description=__doc__)
-parser.add_argument('data_file', metavar='data')
-parser.add_argument('-m', '--min-size', type=int, default=0)
-parser.add_argument('-c', '--constrain', choices=['head', 'tail', 'both'])
-parser.add_argument('--maxfev', type=int, default=10000)
-parser.add_argument('--debug', action='store_true')
-
-if __name__ == '__main__':
- # parse command line
- ns = parser.parse_args()
-
- # read data, filter data
- x, y, ye, n = np.loadtxt(ns.data_file, unpack=1)
- idx = (ye > 0) * (n > ns.min_size)
- if idx.sum() == 0:
- print >> sys.stderr, '%s: error: no data meeting requirements in %s'\
- % (__prog__, ns.data_file)
- sys.exit(1)
- if idx.sum() < 4:
- print >> sys.stderr, '%s: error: non identifiable data in %s'\
- % (__prog__, ns.data_file)
- sys.exit(1)
- x = x[idx]
- y = y[idx]
- ye = ye[idx]
-
- # create model, set fit constraints if any
- model = StretchedExpon()
- if ns.constrain in ['head', 'both']:
- model.A = y[np.argmin(np.abs(x))]
- if ns.constrain in ['tail', 'both']:
- model.C = y.min()
-
- # fit model to data
- try:
- pest, pcov = model.fit(x, y, ye, maxfev=ns.maxfev, warning=False)
- except ValueError, e:
- print >> sys.stderr, '%s: error: "%s" when fitting %s' % (__prog__,
- e.message, ns.data_file)
- if ns.debug:
- raise
- else:
- sys.exit(1)
- if np.isscalar(pcov) or np.isinf(pcov).any():
- print >> sys.stderr, '%s: error: bad covariance matrix in %s' % (\
- __prog__, ns.data_file)
- sys.exit(1)
-
- # compute errors, MRT, GoF, coefficient of determination
- perr = np.sqrt(np.diag(pcov)) / 2.
- model.setparams(*zip(pest,perr))
- mrt = model.mrt(model.tau, model.beta)
- gof, resid, Rsquared = model.gof(x, y, ye)
- model.goftest = gof
- model.residtest = resid
- model.Rsquared = Rsquared
-
- # print output
- key, _ = os.path.splitext(ns.data_file)
- key = key.split('_')
- output = [ mrt, model.Rsquared, model.goftest[0], model.goftest[1] ]
- output = map(lambda k : '%12.5g' % k, output)
- print '\t'.join(key + output)
Modified: trunk/tools/wsor/editor_lifecycle/scripts/timechart
===================================================================
--- trunk/tools/wsor/editor_lifecycle/scripts/timechart 2012-04-09 18:58:43 UTC
(rev 114808)
+++ trunk/tools/wsor/editor_lifecycle/scripts/timechart 2012-04-09 18:58:45 UTC
(rev 114809)
@@ -2,24 +2,22 @@
''' plots cohort rate versus day since first edit '''
-'''
-Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+# Copyright (C) 2011 GIOVANNI LUCA CIAMPAGLIA, [email protected]
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-http://www.gnu.org/copyleft/gpl.html
-'''
-
__author__ = "Giovanni Luca Ciampaglia"
__email__ = "[email protected]"
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs