/usr/lib/python2.7/dist-packages/pymc/tests/test_mean.py is in python-pymc 2.2+ds-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | from numpy.testing import *
from numpy import *
from pymc.gp import Mean
from copy import copy
def quadfun(x, a, b, c):
return (a * x ** 2 + b * x + c)
M = Mean(eval_fun = quadfun, a = 1., b = .5, c = 2.)
def constant(x, val):
"""docstring for parabolic_fun"""
return zeros(x.shape[:-1],dtype=float) + val
N = Mean(constant, val = 0.)
x=arange(-1,1,.01)
y=vstack((x,x)).T
class test_mean(TestCase):
def test(self):
assert(M(x).shape == x.shape)
assert(N(y).shape == (y.shape[0],))
|