@pytest.fixture
def data(N=100, period=1, theta=[10, 2, 3], dy=1, rseed=0):
 rng = np.random.RandomState(rseed)
 t = ((20 * period) * rng.rand(N))
 omega = ((2 * np.pi) / period)
 y = ((theta[0] + (theta[1] * np.sin((omega * t)))) + (theta[2] * np.cos((omega * t))))
 dy = (dy * (0.5 + rng.rand(N)))
 y += (dy * rng.randn(N))
 return (t, y, dy)

@ pytest . fixture def data ( N = 100 , period = 1 , theta = [ 10 , 2 , 3 ] , dy = 1 , rseed = 0 ) : rng = np . random . RandomState ( rseed ) t = ( ( 20 * period ) * rng . rand ( N ) ) omega = ( ( 2 * np . pi ) / period ) y = ( ( theta [ 0 ] + ( theta [ 1 ] * np . sin ( ( omega * t ) ) ) ) + ( theta [ 2 ] * np . cos ( ( omega * t ) ) ) ) dy = ( dy * ( 0.5 + rng . rand ( N ) ) ) y += ( dy * rng . randn ( N ) ) return ( t , y , dy )
get a location for data .