Exemple #1
0
    def test_r_parsing(self):
        fl = YamboFile('r-yambo_em1d_life', folder + 't2_parse_qps')
        assert fl.type == 'report'

        fl = YamboFile('r-yambo_em1d_HF_and_locXC_gw0',
                       folder + 't2_parse_qps')
        assert fl.type == 'report'
Exemple #2
0
 def test_l_parsing(self):
     fl = YamboFile(
         'l-GW_run.8.480_em1d_ppa_HF_and_locXC_gw0_rim_cut_CPU_1',
         folder + 't1_errors_warnings')
     assert not fl.data
     assert len(fl.warnings) == 1
     assert len(fl.errors) == 1
     assert fl.type == 'log'
Exemple #3
0
 def from_db(cls, filename='ndb.QP', folder='.'):
     """
     Create instance of this class from a ndb.QP file
     """
     db_path = os.path.join(folder, filename)
     if os.path.isfile(db_path):
         yfile = YamboFile(filename, folder)
     else:
         raise IOError('File %s not found' % db_path)
     return cls(yfile.data)
Exemple #4
0
 def test_ndb_hf_parsing(self):
     fl = YamboFile('ndb.HF_and_locXC',folder+'t3_parse_netcdf')
     print "fl type", fl.type
     assert fl.type=='netcdf_hf'
Exemple #5
0
 def test_ndb_qp_parsing(self):
     fl = YamboFile('ndb.QP',folder+'t3_parse_netcdf')
     print "fl type", fl.type
     assert fl.type=='netcdf_gw'
Exemple #6
0
 def test_l_parsing(self):
     fl = YamboFile('l-yambo_em1d_HF_and_locXC_gw0',folder+'t2_parse_qps')
     assert  fl.type == 'log'
Exemple #7
0
 def test_qp_parsing(self):
     fl = YamboFile('o-yambo.qp',folder+'t2_parse_qps')
     assert  fl.type == 'output_gw'
Exemple #8
0
 def test_r_parsing(self):
     fl = YamboFile('r-GW_run.8.480_em1d_ppa_HF_and_locXC_gw0_rim_cut',folder+'t1_errors_warnings')
     assert fl.type=='report'
     assert fl.kpoints
     assert not fl.data
Exemple #9
0
 def test_qp_parsing(self):
     fl = YamboFile('o-GW_run.10.720.qp',folder+'t1_errors_warnings')
     assert len(fl.data.keys()) == 4  # more intelligent test needed
     assert  fl.type == 'output_gw'
Exemple #10
0
#
import unittest
import sys
import os
import argparse
import subprocess
import filecmp
from yamboparser import YamboFile, YamboFolder

folder = os.path.dirname(
    os.path.realpath(__file__)) + '/testdata/t1_errors_warnings'

fold = YamboFolder(folder)
fold.yambofiles

fl = YamboFile('o-GW_run.10.720.qp', folder)
print
print fl.type
print fl.data.keys()

fl = YamboFile('l-GW_run.8.480_em1d_ppa_HF_and_locXC_gw0_rim_cut_CPU_1',
               folder)
print
print "type", fl.type
print "data", fl.data
print "kpts", fl.kpoints
print "warn", fl.warnings
print "erro", fl.errors

fl = YamboFile('r-GW_run.8.480_em1d_ppa_HF_and_locXC_gw0_rim_cut', folder)
print
Exemple #11
0
 def test_ndb_hf_parsing(self):
     fl = YamboFile('ndb.HF_and_locXC',
                    os.path.join(folder, 't3_parse_netcdf'))
     print("fl type", fl.type)
     assert fl.type == 'netcdf_hf'
Exemple #12
0
 def test_ndb_qp_parsing(self):
     fl = YamboFile('ndb.QP', os.path.join(folder, 't3_parse_netcdf'))
     print("fl type", fl.type)
     assert fl.type == 'netcdf_gw'
Exemple #13
0
 def test_l_parsing(self):
     fl = YamboFile('l-yambo_em1d_HF_and_locXC_gw0',
                    os.path.join(folder, 't2_parse_qps'))
     assert fl.type == 'log'
Exemple #14
0
 def test_qp_parsing(self):
     fl = YamboFile('o-yambo.qp', os.path.join(folder, 't2_parse_qps'))
     assert fl.type == 'output_gw'