def test_doublegaussian(self): t = np.linspace(0,100) dt = equations.DoubleGaussian() assert dt.parameters == {'midpoint_2': 0.0, 'midpoint_1': 0.0, 'amp_2': 1.0, 'amp_1': 0.5, 'sigma_2': 10.0, 'sigma_1': 20.0} np.testing.assert_allclose( dt.evaluate(t)[10:], dt.evaluate(t[10:]))
def test_doublegaussian(self): dt = equations.DoubleGaussian() assert dt.parameters == { 'midpoint_2': 0.0, 'midpoint_1': 0.0, 'amp_2': 1.0, 'amp_1': 0.5, 'sigma_2': 10.0, 'sigma_1': 20.0 }
def test_spatialpattern(self): dt = patterns.SpatialPattern() dt.spatial = equations.DoubleGaussian() dt.configure_space(numpy.arange(100).reshape((10, 10))) dt.configure() summary = dt.summary_info() assert summary['Type'] == 'SpatialPattern' assert dt.space.shape == (10, 10) assert isinstance(dt.spatial, equations.DoubleGaussian) assert dt.spatial_pattern.shape, (10, 1)
def test_spatialpattern(self): dt = patterns.SpatialPattern() dt.spatial = equations.DoubleGaussian() dt.spatial_pattern = numpy.arange(100).reshape((10, 10)) dt.configure_space(numpy.arange(100).reshape((10, 10))) dt.configure() summary = dt.summary_info self.assertEqual(summary['Type'], 'SpatialPattern') self.assertEqual(dt.space.shape, (10, 10)) self.assertTrue(isinstance(dt.spatial, equations.DoubleGaussian)) self.assertTrue(dt.spatial_pattern.shape, (10, 1))
def test_doublegaussian(self): dt = equations.DoubleGaussian() self.assertEqual( dt.parameters, { 'midpoint_2': 0.0, 'midpoint_1': 0.0, 'amp_2': 1.0, 'amp_1': 0.5, 'sigma_2': 10.0, 'sigma_1': 20.0 }) self.assertEqual( dt.ui_equation, '(amp_1 * 2.71**(-((var-midpoint_1)**2 / ' '(2.0 * sigma_1**2)))) - (amp_2 * 2.71**(-((var-midpoint_2)**2 / (2.0 * sigma_2**2))))' )