def test_full_import(self): """Test importing the full SM""" model_path = 'sm_v4' model = import_v4.import_model(model_path)[0] self.assertEqual(model.get('coupling_orders'), set(['QCD', 'QED'])) self.assertEqual(model.get('order_hierarchy'), {'QCD': 1, 'QED': 2}) self.assertEqual(model.get('expansion_order'), {'QCD': -1, 'QED': -1})
def make_v4_pkl(): """create the model.pkl for each directory""" file_cond = lambda p : (os.path.exists(os.path.join(MG5DIR,'models',p,'particles.dat'))) #1. find v4 model: v4_model = [os.path.join(MG5DIR,'models',p) for p in os.listdir(os.path.join(MG5DIR,'models')) if file_cond(p)] for model_path in v4_model: #remove old pkl start = time.time() print 'make pkl for %s :' % os.path.basename(model_path), try: os.remove(os.path.join(model_path,'model.pkl')) except: pass import_v4.import_model(model_path) print '%2fs' % (time.time() - start)
def make_v4_pkl(): """create the model.pkl for each directory""" file_cond = lambda p : (os.path.exists(os.path.join(MG5DIR,'models',p,'particles.dat'))) #1. find v4 model: v4_model = [os.path.join(MG5DIR,'models',p) for p in os.listdir(os.path.join(MG5DIR,'models')) if file_cond(p)] for model_path in v4_model: #remove old pkl start = time.time() print('make pkl for %s :' % os.path.basename(model_path), end=' ') try: os.remove(os.path.join(model_path,'model.pkl')) except: pass import_v4.import_model(model_path) print('%2fs' % (time.time() - start))
def test_full_import(self): """Test importing the full SM""" model_path = os.path.join(_file_path, os.pardir, os.pardir, 'models', 'sm_v4') model = import_v4.import_model(model_path)[0] self.assertEqual(model.get('coupling_orders'), set(['QCD', 'QED'])) self.assertEqual(model.get('order_hierarchy'), {'QCD': 1, 'QED': 2}) self.assertEqual(model.get('expansion_order'), {'QCD': -1, 'QED': -1})