diff --git a/python/converters/vasp/doc/source/plotools.rst b/python/converters/vasp/doc/source/plotools.rst index 874e71b9..41b21da0 100644 --- a/python/converters/vasp/doc/source/plotools.rst +++ b/python/converters/vasp/doc/source/plotools.rst @@ -72,7 +72,7 @@ Consistency with parameters Selecting projector subsets ---------------------------- +=========================== The first step of PLO processing is to select subsets of projectors corresponding to PLO groups. Each group contains a set of shells. @@ -117,7 +117,7 @@ The class is using a helper function `select_bands()` for selecting a subset of .. _ortho: Orthogonalization -================= +----------------- At the second stage the selected projectors are orthogonalized (orthonormalized). Orthogonalization can be performed in different ways if projection is made @@ -138,3 +138,54 @@ The way the normalization of a PLO group is done is controlled by two group para (False by default) +Storing generated projectors +**************************** + +After the PLOs are generated they are stored to text files which can be subsequently +converted to TRIQS h5-files (using the converter). The general format of the file +is a JSON-header containing all necessary parameters followed by a set of arrays. +There is always one (control) file containing general information (`k`-kpoints, lattice vectors etc.) +and `at least` one file containing correlated groups (one file for each group). + +Control file format +=================== + +Filename '.ctrl'. Contains the data shared between all shells. +The JSON-header consists of the following elements: + + * *nk*: number of `k`-points + + * *ns*: number of spin channels + + * *nc_flag*: collinear/noncollinear case (False/True) + + * *ng*: number of projector groups + + * Symmetry information (list of symmetry operations) + + * *efermi*: Fermi level (optional) + + * Lattice information + +Projector-group file format +=========================== + +Projector-group files have names '.plog'. +They essentially contain serialized objects of class 'ProjectorGroup'. +The JSON-header has, thus, the following elements: + + * *shells*: list of shells + + * each shell is a dictionary: + + - *lshell*: orbital number `l` + + - *nion*: number of ions + + - *ndim*: number of orbitals/ion + + - *nbmax*: maxmimum number of bands (needed for array allocations) + + * *emin*, *emax*: energy window + + diff --git a/python/converters/vasp/python/inpconf.py b/python/converters/vasp/python/inpconf.py index 685f9b65..e27d082c 100644 --- a/python/converters/vasp/python/inpconf.py +++ b/python/converters/vasp/python/inpconf.py @@ -68,6 +68,9 @@ class ConfigParameters: 'normalize' : ('normalize', self.parse_string_logical, True), 'normion' : ('normion', self.parse_string_logical, False)} + self.gen_optional = { + 'basename' : ('basename', str, 'vasp'), + 'efermi' : ('efermi', float)} # # Special parsers @@ -177,7 +180,7 @@ class ConfigParameters: key = param_set[par][0] try: par_str = self.cp.get(section, par) - except ConfigParser.NoOptionError: + except (ConfigParser.NoOptionError, ConfigParser.NoSectionError): if exception: message = "Required parameter '%s' not found in section [%s]"%(par, section) raise Exception(message) @@ -438,8 +441,18 @@ class ConfigParameters: """ Parses [General] section. """ -# TODO: write the parser - pass + self.general = {} + sections = self.cp.sections() + gen_section = filter(lambda s: s.lower() == 'general', sections) +# If no [General] section is found parse a dummy section name to the parser +# to reset parameters to their default values + if len(gen_section) > 1: + raise Exception("More than one section [General] is found") + if len(gen_section) == 0: + gen_section = 'general' + gen_section = gen_section[0] + parsed = self.parse_parameter_set(gen_section, self.gen_optional, exception=False) + self.general.update(parsed) ################################################################################ # diff --git a/python/converters/vasp/python/main.py b/python/converters/vasp/python/main.py index 9786862e..62c3adf9 100644 --- a/python/converters/vasp/python/main.py +++ b/python/converters/vasp/python/main.py @@ -3,7 +3,7 @@ import sys import vaspio from inpconf import ConfigParameters from elstruct import ElectronicStructure -from plotools import generate_plo, plo_output, kpoints_output +from plotools import generate_ortho_plos, output_as_text if __name__ == '__main__': narg = len(sys.argv) @@ -23,11 +23,5 @@ if __name__ == '__main__': pars.parse_input() vasp_data = vaspio.VaspData(vasp_dir) el_struct = ElectronicStructure(vasp_data) - pshells, pgroups = generate_plo(pars, el_struct) - for gr in pgroups: - gr.orthogonalize() - -# TODO: add BASENAME to config parameters - basename = 'vasp' - kpoints_output(basename, el_struct) - plo_output(basename, pshells, pgroups, el_struct) + pshells, pgroups = generate_ortho_plos(pars, el_struct) + output_as_text(pars, el_struct, pshells, pgroups) diff --git a/python/converters/vasp/python/plotools.py b/python/converters/vasp/python/plotools.py index 9cf1008b..bf87fd33 100644 --- a/python/converters/vasp/python/plotools.py +++ b/python/converters/vasp/python/plotools.py @@ -2,6 +2,9 @@ import itertools as it import numpy as np +# 'simplejson' is supposed to be faster than 'json' in stdlib. +import simplejson as json + class Projector: """ Class describing a local-orbital projector. @@ -277,6 +280,12 @@ class ProjectorShell: self.lm2 = (self.lorb+1)**2 self.ndim = self.lm2 - self.lm1 + if self.tmatrix is None: + self.ndim = self.lm2 - self.lm1 + 1 + else: +# TODO: generalize this to a tmatrix for every ion + self.ndim = self.tmatrix.shape[0] + # Pre-select a subset of projectors (this should be an array view => no memory is wasted) # !!! This sucks but I have to change the order of 'ib' and 'ilm' indices here # This should perhaps be done right after the projector array is read from PLOCAR @@ -424,12 +433,49 @@ def kpoints_output(basename, el_struct): +################################################################################ +# +# ctrl_output +# +################################################################################ +def ctrl_output(conf_pars, el_struct, ng): + """ + Outputs a ctrl-file. + """ + ctrl_fname = conf_pars.general['basename'] + '.ctrl' + head_dict = {} + +# TODO: Add output of tetrahedra +# Construct the header dictionary + head_dict['ngroups'] = ng + head_dict['nk'] = el_struct.kmesh['nktot'] + head_dict['ns'] = el_struct.nspin + head_dict['nc_flag'] = 1 if el_struct.nc_flag else 0 +# head_dict['efermi'] = conf_pars.general['efermi'] # We probably don't need Efermi + + header = json.dumps(head_dict, indent=4, separators=(',', ': ')) + + print " Storing ctrl-file..." + with open(ctrl_fname, 'wt') as f: + f.write(header + "\n") + f.write("#END OF HEADER\n") + + f.write("# k-points and weights\n") + labels = ['kx', 'ky', 'kz', 'kweight'] + out = "".join(map(lambda s: s.center(15), labels)) + f.write("#" + out + "\n") + for ik, kp in enumerate(el_struct.kmesh['kpoints']): + tmp1 = "".join(map("{0:15.10f}".format, kp)) + out = tmp1 + "{0:16.10f}".format(el_struct.kmesh['kweights'][ik]) + f.write(out + "\n") + + ################################################################################ # # plo_output # ################################################################################ -def plo_output(basename, pshells, pgroups, el_struct): +def plo_output(conf_pars, el_struct, pshells, pgroups): """ Outputs PLO groups into text files. @@ -455,55 +501,91 @@ def plo_output(basename, pshells, pgroups, el_struct): # Projected shells Nshells # Shells: + # Shell <1> Shell 1 ndim # complex arrays: plo(ns, nion, ndim, nb) ... # Shells: + # Shell <2> Shell 2 ... """ - for ig, gr in enumerate(pgroups): - fname = basename + '.plog%i'%(ig+1) - with open(fname, 'wt') as f: - f.write("# Energy window: emin, emax\n") - f.write("%i %i\n"%(gr.emin, gr.emax)) - f.write("# Number of electrons within the window\n") - nelect = gr.nelect_window(el_struct) - f.write("%s\n"%(round(nelect, 5))) - f.write("# Eigenvalues: is, ik, ib1, ib2 then list of values\n") + for ig, pgroup in enumerate(pgroups): + plo_fname = conf_pars.general['basename'] + '.pg%i'%(ig + 1) + print " Storing PLO-group file '%s'..."%(plo_fname) + head_dict = {} - nk, ns_band, _ = gr.ib_win.shape + head_dict['ewindow'] = (pgroup.emin, pgroup.emax) + head_dict['nb_max'] = pgroup.nb_max + + head_shells = [] + for ish in pgroup.ishells: + shell = pgroup.shells[ish] + sh_dict = {} + sh_dict['shell_index'] = ish + sh_dict['lorb'] = shell.lorb + sh_dict['ndim'] = shell.ndim +# Convert ion indices from the internal representation (starting from 0) +# to conventional VASP representation (starting from 1) + ion_output = [io + 1 for io in shell.ion_list] + sh_dict['ion_list'] = ion_output +# TODO: add the output of transformation matrices + + head_shells.append(sh_dict) + + head_dict['shells'] = head_shells + + header = json.dumps(head_dict, indent=4, separators=(',', ': ')) + + with open(plo_fname, 'wt') as f: + f.write(header + "\n") + f.write("#END OF HEADER\n") + +# Eigenvalues within the window + f.write("# Eigenvalues within the energy window: %s, %s\n"%(pgroup.emin, pgroup.emax)) + nk, nband, ns_band = el_struct.eigvals.shape for isp in xrange(ns_band): + f.write("# is = %i\n"%(isp + 1)) for ik in xrange(nk): - ib1 = gr.ib_win[ik, isp, 0] - ib2 = gr.ib_win[ik, isp, 1] - f.write("%i %i %i %i\n"%(isp+1, ik+1, ib1+1, ib2+1)) - for ib in xrange(ib1, ib2+1): - f.write("%s\n"%(el_struct.eigvals[ik, ib, isp])) + ib1, ib2 = pgroup.ib_win[ik, isp, 0], pgroup.ib_win[ik, isp, 1] + f.write(" %i %i\n"%(ib1, ib2)) + for ib in xrange(ib1, ib2 + 1): + f.write("%15.7f\n"%(el_struct.eigvals[ik, ib, isp])) - f.write("\nProjected shells: nshells\n") - f.write("%i\n"%(len(gr.ishells))) - f.write("Shells: \n") - f.write(' '.join(map(lambda ish: "{0:d}".format(pshells[ish].user_index), gr.ishells)) + '\n') - for ish in gr.ishells: - shell = pshells[ish] - f.write("Orbital dimension: ndim\n") - f.write("%i\n"%(shell.ndim)) +# Projected shells + f.write("# Projected shells\n") + f.write("# Shells: %s\n"%(pgroup.ishells)) + for ish in pgroup.ishells: + shell = pgroup.shells[ish] + f.write("# Shell %i\n"%(ish)) - nion, ns, nk, ndim, _ = shell.proj_win.shape - f.write("# Blocks [isp, ion, ndim, nb], 'nb' fastest index\n") - for ik in xrange(nk): - for isp in xrange(ns): -# TODO: fix this for non-collinear case (ns != ns_band) - ib1 = gr.ib_win[ik, isp, 0] - gr.nb_min - ib2 = gr.ib_win[ik, isp, 1] - gr.nb_min + nion, ns, nk, nlm, nb = shell.proj_win.shape + for isp in xrange(ns): + f.write("# is = %i\n"%(isp + 1)) + for ik in xrange(nk): + f.write("# ik = %i\n"%(ik + 1)) for ion in xrange(nion): - f.write("# ik = %i, is = %i, ion = %i\n"%(ik+1, isp+1, ion+1)) - for iorb in xrange(ndim): - for ib in xrange(ib1, ib2+1): - plo = shell.proj_win[ion, isp, ik, iorb, ib] - f.write("%20.10f %20.10f\n"%(plo.real, plo.imag)) + for ilm in xrange(nlm): + ib1, ib2 = pgroup.ib_win[ik, isp, 0], pgroup.ib_win[ik, isp, 1] + ib1_win = ib1 - shell.nb_min + ib2_win = ib2 - shell.nb_min + for ib in xrange(ib1_win, ib2_win + 1): + p = shell.proj_win[ion, isp, ik, ilm, ib] + f.write("{0:16.10f}{1:16.10f}\n".format(p.real, p.imag)) f.write("\n") - + + +################################################################################ +# +# output_as_text +# +################################################################################ +def output_as_text(pars, el_struct, pshells, pgroups): + """ + Output all information necessary for the converter as text files. + """ + ctrl_output(pars, el_struct, len(pgroups)) + plo_output(pars, el_struct, pshells, pgroups) + diff --git a/python/converters/vasp/test/inpconf/.gitignore b/python/converters/vasp/test/.gitignore similarity index 100% rename from python/converters/vasp/test/inpconf/.gitignore rename to python/converters/vasp/test/.gitignore diff --git a/python/converters/vasp/test/_inpconf/.gitignore b/python/converters/vasp/test/_inpconf/.gitignore new file mode 100644 index 00000000..0d20b648 --- /dev/null +++ b/python/converters/vasp/test/_inpconf/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/python/converters/vasp/test/_inpconf/__init__.py b/python/converters/vasp/test/_inpconf/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/python/converters/vasp/test/inpconf/arraytest.py b/python/converters/vasp/test/_inpconf/arraytest.py similarity index 100% rename from python/converters/vasp/test/inpconf/arraytest.py rename to python/converters/vasp/test/_inpconf/arraytest.py diff --git a/python/converters/vasp/test/inpconf/example.cfg b/python/converters/vasp/test/_inpconf/example.cfg similarity index 89% rename from python/converters/vasp/test/inpconf/example.cfg rename to python/converters/vasp/test/_inpconf/example.cfg index 4b03d4e0..1919bc23 100644 --- a/python/converters/vasp/test/inpconf/example.cfg +++ b/python/converters/vasp/test/_inpconf/example.cfg @@ -1,4 +1,6 @@ [General] +BASENAME = test_base +EFERMI = 0.1 [Group 1] SHELLS = 1 2 diff --git a/python/converters/vasp/test/inpconf/example_nogroup.cfg b/python/converters/vasp/test/_inpconf/example_nogroup.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/example_nogroup.cfg rename to python/converters/vasp/test/_inpconf/example_nogroup.cfg diff --git a/python/converters/vasp/test/inpconf/input_test_1.cfg b/python/converters/vasp/test/_inpconf/input_test_1.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/input_test_1.cfg rename to python/converters/vasp/test/_inpconf/input_test_1.cfg diff --git a/python/converters/vasp/test/inpconf/input_test_2.cfg b/python/converters/vasp/test/_inpconf/input_test_2.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/input_test_2.cfg rename to python/converters/vasp/test/_inpconf/input_test_2.cfg diff --git a/python/converters/vasp/test/inpconf/input_test_3.cfg b/python/converters/vasp/test/_inpconf/input_test_3.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/input_test_3.cfg rename to python/converters/vasp/test/_inpconf/input_test_3.cfg diff --git a/python/converters/vasp/test/inpconf/input_test_4.cfg b/python/converters/vasp/test/_inpconf/input_test_4.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/input_test_4.cfg rename to python/converters/vasp/test/_inpconf/input_test_4.cfg diff --git a/python/converters/vasp/test/inpconf/parse_groups_1.cfg b/python/converters/vasp/test/_inpconf/parse_groups_1.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/parse_groups_1.cfg rename to python/converters/vasp/test/_inpconf/parse_groups_1.cfg diff --git a/python/converters/vasp/test/inpconf/parse_shells_1.cfg b/python/converters/vasp/test/_inpconf/parse_shells_1.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/parse_shells_1.cfg rename to python/converters/vasp/test/_inpconf/parse_shells_1.cfg diff --git a/python/converters/vasp/test/inpconf/parse_shells_2.cfg b/python/converters/vasp/test/_inpconf/parse_shells_2.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/parse_shells_2.cfg rename to python/converters/vasp/test/_inpconf/parse_shells_2.cfg diff --git a/python/converters/vasp/test/inpconf/parse_shells_3.cfg b/python/converters/vasp/test/_inpconf/parse_shells_3.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/parse_shells_3.cfg rename to python/converters/vasp/test/_inpconf/parse_shells_3.cfg diff --git a/python/converters/vasp/test/inpconf/parse_shells_4.cfg b/python/converters/vasp/test/_inpconf/parse_shells_4.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/parse_shells_4.cfg rename to python/converters/vasp/test/_inpconf/parse_shells_4.cfg diff --git a/python/converters/vasp/test/inpconf/runtest.sh b/python/converters/vasp/test/_inpconf/runtest.sh similarity index 100% rename from python/converters/vasp/test/inpconf/runtest.sh rename to python/converters/vasp/test/_inpconf/runtest.sh diff --git a/python/converters/vasp/test/inpconf/test1.cfg b/python/converters/vasp/test/_inpconf/test1.cfg similarity index 100% rename from python/converters/vasp/test/inpconf/test1.cfg rename to python/converters/vasp/test/_inpconf/test1.cfg diff --git a/python/converters/vasp/test/_inpconf/test_general.py b/python/converters/vasp/test/_inpconf/test_general.py new file mode 100644 index 00000000..64e7518e --- /dev/null +++ b/python/converters/vasp/test/_inpconf/test_general.py @@ -0,0 +1,32 @@ +r""" +Tests of 'parse_general()' defined in ConfigParameters class +""" +import arraytest +import numpy as np +from inpconf import ConfigParameters + +################################################################################ +# +# TestParseGeneral +# +################################################################################ +class TestParseGeneral(arraytest.ArrayTestCase): + """ + Function: + + def parse_general(self) + + Scenarios: + + - **if** a correct [General] section is defined **return** a dictionary + """ +# Scenario 1 + def test_example(self): + conf_pars = ConfigParameters('example.cfg') + conf_pars.parse_general() + res = conf_pars.general + expected = {'basename': 'test_base', 'efermi': 0.1} + self.assertDictEqual(res, expected) + + + diff --git a/python/converters/vasp/test/inpconf/test_groups.py b/python/converters/vasp/test/_inpconf/test_groups.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_groups.py rename to python/converters/vasp/test/_inpconf/test_groups.py diff --git a/python/converters/vasp/test/inpconf/test_inpconf.py b/python/converters/vasp/test/_inpconf/test_inpconf.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_inpconf.py rename to python/converters/vasp/test/_inpconf/test_inpconf.py diff --git a/python/converters/vasp/test/inpconf/test_input.py b/python/converters/vasp/test/_inpconf/test_input.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_input.py rename to python/converters/vasp/test/_inpconf/test_input.py diff --git a/python/converters/vasp/test/inpconf/test_parameter_set.py b/python/converters/vasp/test/_inpconf/test_parameter_set.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_parameter_set.py rename to python/converters/vasp/test/_inpconf/test_parameter_set.py diff --git a/python/converters/vasp/test/inpconf/test_shells.py b/python/converters/vasp/test/_inpconf/test_shells.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_shells.py rename to python/converters/vasp/test/_inpconf/test_shells.py diff --git a/python/converters/vasp/test/inpconf/test_special_parsers.py b/python/converters/vasp/test/_inpconf/test_special_parsers.py similarity index 100% rename from python/converters/vasp/test/inpconf/test_special_parsers.py rename to python/converters/vasp/test/_inpconf/test_special_parsers.py diff --git a/python/converters/vasp/test/plocar_io/.gitignore b/python/converters/vasp/test/_plocar_io/.gitignore similarity index 100% rename from python/converters/vasp/test/plocar_io/.gitignore rename to python/converters/vasp/test/_plocar_io/.gitignore diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.example b/python/converters/vasp/test/_plocar_io/PLOCAR.example similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.example rename to python/converters/vasp/test/_plocar_io/PLOCAR.example diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.example.out b/python/converters/vasp/test/_plocar_io/PLOCAR.example.out similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.example.out rename to python/converters/vasp/test/_plocar_io/PLOCAR.example.out diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.noprec b/python/converters/vasp/test/_plocar_io/PLOCAR.noprec similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.noprec rename to python/converters/vasp/test/_plocar_io/PLOCAR.noprec diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.prec8 b/python/converters/vasp/test/_plocar_io/PLOCAR.prec8 similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.prec8 rename to python/converters/vasp/test/_plocar_io/PLOCAR.prec8 diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.prec8.out b/python/converters/vasp/test/_plocar_io/PLOCAR.prec8.out similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.prec8.out rename to python/converters/vasp/test/_plocar_io/PLOCAR.prec8.out diff --git a/python/converters/vasp/test/plocar_io/PLOCAR.trunc b/python/converters/vasp/test/_plocar_io/PLOCAR.trunc similarity index 100% rename from python/converters/vasp/test/plocar_io/PLOCAR.trunc rename to python/converters/vasp/test/_plocar_io/PLOCAR.trunc diff --git a/python/converters/vasp/test/plocar_io/mytest.py b/python/converters/vasp/test/_plocar_io/mytest.py similarity index 100% rename from python/converters/vasp/test/plocar_io/mytest.py rename to python/converters/vasp/test/_plocar_io/mytest.py diff --git a/python/converters/vasp/test/plocar_io/runtest.sh b/python/converters/vasp/test/_plocar_io/runtest.sh similarity index 100% rename from python/converters/vasp/test/plocar_io/runtest.sh rename to python/converters/vasp/test/_plocar_io/runtest.sh diff --git a/python/converters/vasp/test/plocar_io/test_fileio.py b/python/converters/vasp/test/_plocar_io/test_fileio.py similarity index 100% rename from python/converters/vasp/test/plocar_io/test_fileio.py rename to python/converters/vasp/test/_plocar_io/test_fileio.py diff --git a/python/converters/vasp/test/plocar_io/test_plocar_io.py b/python/converters/vasp/test/_plocar_io/test_plocar_io.py similarity index 100% rename from python/converters/vasp/test/plocar_io/test_plocar_io.py rename to python/converters/vasp/test/_plocar_io/test_plocar_io.py diff --git a/python/converters/vasp/test/plotools/.gitignore b/python/converters/vasp/test/_plotools/.gitignore similarity index 100% rename from python/converters/vasp/test/plotools/.gitignore rename to python/converters/vasp/test/_plotools/.gitignore diff --git a/python/converters/vasp/test/plotools/DOSCAR b/python/converters/vasp/test/_plotools/DOSCAR similarity index 100% rename from python/converters/vasp/test/plotools/DOSCAR rename to python/converters/vasp/test/_plotools/DOSCAR diff --git a/python/converters/vasp/test/plotools/EIGENVAL b/python/converters/vasp/test/_plotools/EIGENVAL similarity index 100% rename from python/converters/vasp/test/plotools/EIGENVAL rename to python/converters/vasp/test/_plotools/EIGENVAL diff --git a/python/converters/vasp/test/plotools/IBZKPT b/python/converters/vasp/test/_plotools/IBZKPT similarity index 100% rename from python/converters/vasp/test/plotools/IBZKPT rename to python/converters/vasp/test/_plotools/IBZKPT diff --git a/python/converters/vasp/test/plotools/OUTCAR b/python/converters/vasp/test/_plotools/OUTCAR similarity index 100% rename from python/converters/vasp/test/plotools/OUTCAR rename to python/converters/vasp/test/_plotools/OUTCAR diff --git a/python/converters/vasp/test/plotools/PLOCAR b/python/converters/vasp/test/_plotools/PLOCAR similarity index 100% rename from python/converters/vasp/test/plotools/PLOCAR rename to python/converters/vasp/test/_plotools/PLOCAR diff --git a/python/converters/vasp/test/plotools/POSCAR b/python/converters/vasp/test/_plotools/POSCAR similarity index 100% rename from python/converters/vasp/test/plotools/POSCAR rename to python/converters/vasp/test/_plotools/POSCAR diff --git a/python/converters/vasp/test/plotools/densmat.out b/python/converters/vasp/test/_plotools/densmat.out similarity index 100% rename from python/converters/vasp/test/plotools/densmat.out rename to python/converters/vasp/test/_plotools/densmat.out diff --git a/python/converters/vasp/test/plotools/example.cfg b/python/converters/vasp/test/_plotools/example.cfg similarity index 100% rename from python/converters/vasp/test/plotools/example.cfg rename to python/converters/vasp/test/_plotools/example.cfg diff --git a/python/converters/vasp/test/plotools/mytest.py b/python/converters/vasp/test/_plotools/mytest.py similarity index 100% rename from python/converters/vasp/test/plotools/mytest.py rename to python/converters/vasp/test/_plotools/mytest.py diff --git a/python/converters/vasp/test/plotools/projgroups.out b/python/converters/vasp/test/_plotools/projgroups.out similarity index 100% rename from python/converters/vasp/test/plotools/projgroups.out rename to python/converters/vasp/test/_plotools/projgroups.out diff --git a/python/converters/vasp/test/plotools/projortho.out b/python/converters/vasp/test/_plotools/projortho.out similarity index 100% rename from python/converters/vasp/test/plotools/projortho.out rename to python/converters/vasp/test/_plotools/projortho.out diff --git a/python/converters/vasp/test/plotools/projshells.out b/python/converters/vasp/test/_plotools/projshells.out similarity index 100% rename from python/converters/vasp/test/plotools/projshells.out rename to python/converters/vasp/test/_plotools/projshells.out diff --git a/python/converters/vasp/test/plotools/runtest.sh b/python/converters/vasp/test/_plotools/runtest.sh similarity index 100% rename from python/converters/vasp/test/plotools/runtest.sh rename to python/converters/vasp/test/_plotools/runtest.sh diff --git a/python/converters/vasp/test/plotools/test_consistency.py b/python/converters/vasp/test/_plotools/test_consistency.py similarity index 100% rename from python/converters/vasp/test/plotools/test_consistency.py rename to python/converters/vasp/test/_plotools/test_consistency.py diff --git a/python/converters/vasp/test/plotools/test_plotools.py b/python/converters/vasp/test/_plotools/test_plotools.py similarity index 100% rename from python/converters/vasp/test/plotools/test_plotools.py rename to python/converters/vasp/test/_plotools/test_plotools.py diff --git a/python/converters/vasp/test/plotools/test_projgroups.py b/python/converters/vasp/test/_plotools/test_projgroups.py similarity index 100% rename from python/converters/vasp/test/plotools/test_projgroups.py rename to python/converters/vasp/test/_plotools/test_projgroups.py diff --git a/python/converters/vasp/test/plotools/test_projshells.py b/python/converters/vasp/test/_plotools/test_projshells.py similarity index 100% rename from python/converters/vasp/test/plotools/test_projshells.py rename to python/converters/vasp/test/_plotools/test_projshells.py diff --git a/python/converters/vasp/test/plotools/test_select_bands.py b/python/converters/vasp/test/_plotools/test_select_bands.py similarity index 100% rename from python/converters/vasp/test/plotools/test_select_bands.py rename to python/converters/vasp/test/_plotools/test_select_bands.py diff --git a/python/converters/vasp/test/vaspio/.gitignore b/python/converters/vasp/test/_vaspio/.gitignore similarity index 100% rename from python/converters/vasp/test/vaspio/.gitignore rename to python/converters/vasp/test/_vaspio/.gitignore diff --git a/python/converters/vasp/test/vaspio/DOSCAR.example b/python/converters/vasp/test/_vaspio/DOSCAR.example similarity index 100% rename from python/converters/vasp/test/vaspio/DOSCAR.example rename to python/converters/vasp/test/_vaspio/DOSCAR.example diff --git a/python/converters/vasp/test/vaspio/EIGENVAL.example b/python/converters/vasp/test/_vaspio/EIGENVAL.example similarity index 100% rename from python/converters/vasp/test/vaspio/EIGENVAL.example rename to python/converters/vasp/test/_vaspio/EIGENVAL.example diff --git a/python/converters/vasp/test/vaspio/EIGENVAL.example.out b/python/converters/vasp/test/_vaspio/EIGENVAL.example.out similarity index 100% rename from python/converters/vasp/test/vaspio/EIGENVAL.example.out rename to python/converters/vasp/test/_vaspio/EIGENVAL.example.out diff --git a/python/converters/vasp/test/vaspio/IBZKPT.example b/python/converters/vasp/test/_vaspio/IBZKPT.example similarity index 100% rename from python/converters/vasp/test/vaspio/IBZKPT.example rename to python/converters/vasp/test/_vaspio/IBZKPT.example diff --git a/python/converters/vasp/test/vaspio/IBZKPT.example.out b/python/converters/vasp/test/_vaspio/IBZKPT.example.out similarity index 100% rename from python/converters/vasp/test/vaspio/IBZKPT.example.out rename to python/converters/vasp/test/_vaspio/IBZKPT.example.out diff --git a/python/converters/vasp/test/vaspio/IBZKPT.notet b/python/converters/vasp/test/_vaspio/IBZKPT.notet similarity index 100% rename from python/converters/vasp/test/vaspio/IBZKPT.notet rename to python/converters/vasp/test/_vaspio/IBZKPT.notet diff --git a/python/converters/vasp/test/vaspio/IBZKPT.notet.out b/python/converters/vasp/test/_vaspio/IBZKPT.notet.out similarity index 100% rename from python/converters/vasp/test/vaspio/IBZKPT.notet.out rename to python/converters/vasp/test/_vaspio/IBZKPT.notet.out diff --git a/python/converters/vasp/test/vaspio/POSCAR.example b/python/converters/vasp/test/_vaspio/POSCAR.example similarity index 100% rename from python/converters/vasp/test/vaspio/POSCAR.example rename to python/converters/vasp/test/_vaspio/POSCAR.example diff --git a/python/converters/vasp/test/vaspio/POSCAR.example.out b/python/converters/vasp/test/_vaspio/POSCAR.example.out similarity index 100% rename from python/converters/vasp/test/vaspio/POSCAR.example.out rename to python/converters/vasp/test/_vaspio/POSCAR.example.out diff --git a/python/converters/vasp/test/vaspio/mytest.py b/python/converters/vasp/test/_vaspio/mytest.py similarity index 100% rename from python/converters/vasp/test/vaspio/mytest.py rename to python/converters/vasp/test/_vaspio/mytest.py diff --git a/python/converters/vasp/test/vaspio/runtest.sh b/python/converters/vasp/test/_vaspio/runtest.sh similarity index 100% rename from python/converters/vasp/test/vaspio/runtest.sh rename to python/converters/vasp/test/_vaspio/runtest.sh diff --git a/python/converters/vasp/test/vaspio/test_doscar.py b/python/converters/vasp/test/_vaspio/test_doscar.py similarity index 100% rename from python/converters/vasp/test/vaspio/test_doscar.py rename to python/converters/vasp/test/_vaspio/test_doscar.py diff --git a/python/converters/vasp/test/vaspio/test_eigenval.py b/python/converters/vasp/test/_vaspio/test_eigenval.py similarity index 100% rename from python/converters/vasp/test/vaspio/test_eigenval.py rename to python/converters/vasp/test/_vaspio/test_eigenval.py diff --git a/python/converters/vasp/test/vaspio/test_kpoints.py b/python/converters/vasp/test/_vaspio/test_kpoints.py similarity index 100% rename from python/converters/vasp/test/vaspio/test_kpoints.py rename to python/converters/vasp/test/_vaspio/test_kpoints.py diff --git a/python/converters/vasp/test/vaspio/test_poscar.py b/python/converters/vasp/test/_vaspio/test_poscar.py similarity index 100% rename from python/converters/vasp/test/vaspio/test_poscar.py rename to python/converters/vasp/test/_vaspio/test_poscar.py diff --git a/python/converters/vasp/test/vaspio/test_vaspio.py b/python/converters/vasp/test/_vaspio/test_vaspio.py similarity index 100% rename from python/converters/vasp/test/vaspio/test_vaspio.py rename to python/converters/vasp/test/_vaspio/test_vaspio.py diff --git a/python/converters/vasp/test/adv_example.cfg b/python/converters/vasp/test/adv_example.cfg deleted file mode 100644 index a02179c1..00000000 --- a/python/converters/vasp/test/adv_example.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[General] -EFERMI = -0.6 - -[Group 1] -SHELLS = 1 2 -EMIN = -7.6 -EMAX = 2.7 - -[Shell 1] -# Ni shell -IONS = 5 6 7 8 -LSHELL = 2 -RTRANSFORM = - 0.0 0.0 0.0 0.0 1.0 - 0.0 0.0 1.0 0.0 0.0 - -[Shell 2] -# Oxygen shell -IONS = 9..20 -LSHELL = 1 diff --git a/python/converters/vasp/test/run_all.sh b/python/converters/vasp/test/run_all.sh new file mode 100755 index 00000000..5d4368ea --- /dev/null +++ b/python/converters/vasp/test/run_all.sh @@ -0,0 +1 @@ +PYTHONPATH=$HOME/Codes/vasp/vasp5.3/plo_vasp/plovasp/python:$HOME/Codes/vasp/vasp5.3/plo_vasp/plovasp/c:$PYTHONPATH python test_all.py diff --git a/python/converters/vasp/test/test_all.py b/python/converters/vasp/test/test_all.py new file mode 100644 index 00000000..7d86dddf --- /dev/null +++ b/python/converters/vasp/test/test_all.py @@ -0,0 +1,10 @@ +r""" +Searches and runs all available test suites. +""" +import unittest + +if __name__ == '__main__': + suite = unittest.TestLoader().discover('./') + unittest.TextTestRunner(verbosity=2, buffer=True).run(suite) +# unittest.TextTestRunner(verbosity=2, buffer=False).run(suite) +