def test_erp_variability_model_recalculate_model():
    erp_model = ERP_Variability_Model(n_sub=16, n_gen=5,
                                variability_electrodes='constant',
                                variability_generators='individual',
                                variability_connections='individual')
    erp_model.set_random_locations_orientations()
    erp_model.set_random_magnitudes()
    erp_model.set_random_variability()
    assert_up_to_date(erp_model, False, False, False, False)
    erp_model.recalculate_model()
    assert_up_to_date(erp_model, True, True, True, True)
 def __init__(self, n_sub, n_gen, variability_electrodes='none',
              variability_generators='none', 
              variability_connections='none'):
     ERP_Variability_Model.__init__(self, n_sub, n_gen, 
                                    variability_electrodes,
                                    variability_generators,
                                    variability_connections)
     
     # Parameter bounds for fitting
     self.magnitude_bounds = (0, None) # unnecessary?
     self.depth_bounds = (4.49, 7.05) # cortex # TODO: Check values
     self.theta_bounds = (0,pi/2)
     self.phi_bounds = (0,2*pi) # unnecessary?
     self.orientation_bounds = (0, pi/2)
     self.orientation_phi_bounds = (0,2*pi) # unnecessary?
     self.gen_variance_bounds = (None, None)
     self.gen_covariance_bounds = (None, None)
     self.el_variance_bounds = (None, None)