示例#1
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.section_end = '$end'
     self.delimiter = ' '  # how we're breaking up each line
     self.section_parsers = {\
             'mast'     : self.parse_mast_section,
             'structure' : self.parse_structure_section,
             'scaling' : self.parse_scaling_section,
             'ingredients' : self.parse_ingredients_section,
             'defects'  : self.parse_defects_section,
             'recipe'   : self.parse_recipe_section,
             'neb'      : self.parse_neb_section,
             'chemical_potentials' : self.parse_chemical_potentials_section,
             'summary' : self.parse_summary_section,
             'personal_recipe' : self.parse_personal_recipe_section
                            }
     scratchpath = dirutil.get_mast_scratch_path()
     inputlocation = os.path.dirname(self.keywords['inputfile'])
     if (inputlocation == ""):
         self.logger = loggerutils.get_mast_logger("mast input parser")
     elif scratchpath not in inputlocation:
         self.logger = loggerutils.get_mast_logger("mast input parser")
     else:
         self.logger = loggerutils.get_mast_logger("mast input parser %s" %
                                                   inputlocation)
示例#2
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.recdir = self.keywords['recdir']
     self.input_options = None
     self.timestamp=""
     self.asctime=""
     self.recipe_plan = None
     self.logger = loggerutils.initialize_short_logger(os.path.join(get_mast_control_path(),"mast.log"))
示例#3
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.indeploop = "indeploop"
     self.loop_delim = ","
     self.loop_start = "("
     self.loop_end = ")"
     self.baseinput = MASTFile(self.keywords['inputfile'])
     self.pegloop1 = "pegloop1"
     self.pegloop2 = "pegloop2"
示例#4
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.recdir = self.keywords['recdir']
     self.input_options = None
     self.timestamp = ""
     self.asctime = ""
     self.recipe_plan = None
     self.logger = loggerutils.initialize_short_logger(
         os.path.join(get_mast_control_path(), "mast.log"))
示例#5
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.indeploop = "indeploop"
     self.loop_delim = ","
     self.loop_start = "("
     self.loop_end = ")"
     self.baseinput = MASTFile(self.keywords['inputfile'])
     self.pegloop1 = "pegloop1"
     self.pegloop2 = "pegloop2"
示例#6
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.recipe_file    = self.keywords['recipeFile']
     self.input_options  = self.keywords['inputOptions']
     self.structure      = self.keywords['structure']
     self.work_dir    = self.keywords['workingDirectory']
     self.logger = loggerutils.get_mast_logger("recipe setup %s" % self.work_dir)
     self.metafile = Metadata(metafile='%s/metadata.txt' % self.work_dir)
     self.logger.debug('Setting up the recipe based on the personal recipe contents passed in self.recipe_file')
示例#7
0
    def __init__(self, **kwargs):
        MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
        self.input_options = self.keywords["inputOptions"]
        self.template_file = self.keywords["templateFile"]
        self.personal_recipe = self.keywords["personalRecipe"]
        self.ingredient_list = list()

        self.metafile = Metadata(metafile="%s/metadata.txt" % self.keywords["working_directory"])
        self.chunks = list()
示例#8
0
    def __init__(self, **kwargs):
        MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
        self.input_options = self.keywords['inputOptions']
        self.template_file = self.keywords['templateFile']
        self.personal_recipe = self.keywords['personalRecipe']
        self.ingredient_list = list()

        self.metafile = Metadata(metafile='%s/metadata.txt' %
                                 self.keywords['working_directory'])
        self.chunks = list()
示例#9
0
文件: mastinput.py 项目: uw-cmg/MAST
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.input_options = None
     self.origin_dir=""
     self.timestamp=""
     self.asctime=""
     self.working_directory=""
     self.sysname=""
     self.recipe_plan = None
     self.logger = loggerutils.initialize_short_logger(os.path.join(get_mast_control_path(),"mast_input.log"))
示例#10
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.input_options = None
     self.origin_dir = ""
     self.timestamp = ""
     self.asctime = ""
     self.working_directory = ""
     self.sysname = ""
     self.recipe_plan = None
     self.logger = loggerutils.initialize_short_logger(
         os.path.join(get_mast_control_path(), "mast_input.log"))
示例#11
0
    def __init__(self, allowed_keys, **kwargs):
        allowed_keys_base = dict()
        allowed_keys_base.update(allowed_keys) 
        MASTObj.__init__(self, allowed_keys_base, **kwargs)

        work_dir = '/'.join(self.keywords['name'].split('/')[:-1])
        topmeta = Metadata(metafile='%s/metadata.txt' % work_dir)
        data = topmeta.read_data(self.keywords['name'].split('/')[-1])

        self.meta_dict = dict()
        if data:
            for datum in data.split(';'):
                self.meta_dict[datum.split(':')[0]] = datum.split(':')[1].strip()

        self.metafile = Metadata(metafile='%s/metadata.txt' % self.keywords['name'])

        self.program = self.keywords['program_keys']['mast_program'].lower()
        
        self.logger = loggerutils.get_mast_logger(self.keywords['name'])
        
        sdir=os.path.join(os.path.dirname(self.keywords['name']),"structure_index_files")
        if os.path.exists(sdir):
            self.atomindex = AtomIndex(structure_index_directory=sdir)
        else:
            self.atomindex = None

        if self.program == 'vasp':
            self.checker = VaspChecker(name=self.keywords['name'],
            program_keys = self.keywords['program_keys'],
            structure = self.keywords['structure'])
            self.errhandler = VaspError(name=self.keywords['name'],
            program_keys = self.keywords['program_keys'],
            structure = self.keywords['structure'])
        elif self.program == 'vasp_neb':
            self.checker = VaspNEBChecker(name=self.keywords['name'],
            program_keys = self.keywords['program_keys'],
            structure = self.keywords['structure'])
            self.errhandler = VaspNEBError(name=self.keywords['name'],
            program_keys = self.keywords['program_keys'],
            structure = self.keywords['structure'])
        elif self.program == 'phon':
            self.checker = PhonChecker(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
            self.errhandler = PhonError(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
        elif self.program == 'lammps':
            self.checker = LammpsChecker(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
            self.errhandler = GenericError(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
        elif self.program =='structopt':
            self.checker = StructoptChecker(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
            self.errhandler = GenericError(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
        else:
            allowed_keys={'name','program_keys','structure'}
            self.checker = GenericChecker(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
            self.errhandler = GenericError(name=self.keywords['name'],program_keys=self.keywords['program_keys'],structure=self.keywords['structure'])
示例#12
0
    def __init__(self, **kwargs):
        MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
        self.recipe_file = self.keywords['recipeFile']
        self.input_options = self.keywords['inputOptions']
        self.structure = self.keywords['structure']
        self.work_dir = self.keywords['workingDirectory']
        self.logger = loggerutils.get_mast_logger("recipe setup %s" %
                                                  self.work_dir)

        self.metafile = Metadata(metafile='%s/metadata.txt' % self.work_dir)
        self.logger.debug(
            'Setting up the recipe based on the personal recipe contents passed in self.recipe_file'
        )
示例#13
0
 def __init__(self, **kwargs):
     allowed_keys = {
         'input_options': (InputOptions, None, 'Input options'),
         'structure_index_directory': (str, "structure_index_files", "Structure index directory")
     }
     MASTObj.__init__(self, allowed_keys, **kwargs)            
     self.logger = loggerutils.get_mast_logger("atom_indexing")
     self.sdir = self.keywords['structure_index_directory']
     self.input_options = self.keywords['input_options']
     if self.input_options == None:
         return
     self.scaling = self.input_options.get_item('scaling')
     self.logger.info("Scaling: %s" % self.scaling)
     if self.scaling == None:
         self.scaling = dict()
     self.startstr = self.input_options.get_item('structure','structure')
     self.atomcount=1
     return
示例#14
0
 def __init__(self, **kwargs):
     allowed_keys = {
         'input_options': (InputOptions, None, 'Input options'),
         'structure_index_directory':
         (str, "structure_index_files", "Structure index directory")
     }
     MASTObj.__init__(self, allowed_keys, **kwargs)
     self.logger = loggerutils.get_mast_logger("atom_indexing")
     self.sdir = self.keywords['structure_index_directory']
     self.input_options = self.keywords['input_options']
     if self.input_options == None:
         return
     self.scaling = self.input_options.get_item('scaling')
     self.logger.info("Scaling: %s" % self.scaling)
     if self.scaling == None:
         self.scaling = dict()
     self.startstr = self.input_options.get_item('structure', 'structure')
     self.atomcount = 1
     return
示例#15
0
 def __init__(self, **kwargs):
     allowed_keys = {
         "struc_work1": (
             Structure,
             None,
             "First working Pymatgen Structure object (e.g. create a defect, or use work1 and work2 to interpolate positions)",
         ),
         "struc_work2": (Structure, None, "Second working Pymatgen Structure object"),
         "struc_init": (Structure, None, "Initial structure at the beginning of the MAST recipe"),
         "scaling_size": (str, None, "Scaling size"),
         "name": (str, get_mast_control_path(), "Name of ingredient"),
     }
     MASTObj.__init__(self, allowed_keys, **kwargs)
     rname = os.path.dirname(self.keywords["name"])
     self.logger = loggerutils.get_mast_logger(rname)
     self.metafile = Metadata(metafile="%s/metadata.txt" % self.keywords["name"])
     self.scaleinput = ""
     self.transform_scaling_size()
     return
示例#16
0
 def __init__(self, **kwargs):
     allowed_keys = {
         'struc_work1':
         (Structure, None,
          'First working Pymatgen Structure object (e.g. create a defect, or use work1 and work2 to interpolate positions)'
          ),
         'struc_work2':
         (Structure, None, 'Second working Pymatgen Structure object'),
         'struc_init':
         (Structure, None,
          'Initial structure at the beginning of the MAST recipe'),
         'scaling_size': (str, None, 'Scaling size'),
         'name': (str, get_mast_control_path(), 'Name of ingredient')
     }
     MASTObj.__init__(self, allowed_keys, **kwargs)
     rname = os.path.dirname(self.keywords['name'])
     self.logger = loggerutils.get_mast_logger(rname)
     self.metafile = Metadata(metafile='%s/metadata.txt' %
                              self.keywords['name'])
     self.scaleinput = ""
     self.transform_scaling_size()
     return
示例#17
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
     self.section_end = '$end'
     self.delimiter = ' ' # how we're breaking up each line
     self.section_parsers = {\
             'mast'     : self.parse_mast_section,
             'structure' : self.parse_structure_section,
             'scaling' : self.parse_scaling_section,
             'ingredients' : self.parse_ingredients_section,
             'defects'  : self.parse_defects_section,
             'recipe'   : self.parse_recipe_section,
             'neb'      : self.parse_neb_section,
             'chemical_potentials' : self.parse_chemical_potentials_section,
             'summary' : self.parse_summary_section,
             'personal_recipe' : self.parse_personal_recipe_section
                            }
     scratchpath = dirutil.get_mast_scratch_path()
     inputlocation = os.path.dirname(self.keywords['inputfile'])
     if (inputlocation == ""):
         self.logger = loggerutils.get_mast_logger("mast input parser")
     elif scratchpath not in inputlocation:
         self.logger = loggerutils.get_mast_logger("mast input parser")
     else:
         self.logger = loggerutils.get_mast_logger("mast input parser %s" % inputlocation)
示例#18
0
 def __init__(self, allowed_keys, **kwargs):
     allowed_keys_base = dict()
     allowed_keys_base.update(allowed_keys) 
     MASTObj.__init__(self, allowed_keys_base, **kwargs)
     self.logger = loggerutils.get_mast_logger(self.keywords['name'])
示例#19
0
    def __init__(self, allowed_keys, **kwargs):
        allowed_keys_base = dict()
        allowed_keys_base.update(allowed_keys)
        MASTObj.__init__(self, allowed_keys_base, **kwargs)

        work_dir = '/'.join(self.keywords['name'].split('/')[:-1])
        topmeta = Metadata(metafile='%s/metadata.txt' % work_dir)
        data = topmeta.read_data(self.keywords['name'].split('/')[-1])

        self.meta_dict = dict()
        if data:
            for datum in data.split(';'):
                self.meta_dict[datum.split(':')[0]] = datum.split(
                    ':')[1].strip()

        self.metafile = Metadata(metafile='%s/metadata.txt' %
                                 self.keywords['name'])

        self.program = self.keywords['program_keys']['mast_program'].lower()

        self.logger = loggerutils.get_mast_logger(self.keywords['name'])

        sdir = os.path.join(os.path.dirname(self.keywords['name']),
                            "structure_index_files")
        if os.path.exists(sdir):
            self.atomindex = AtomIndex(structure_index_directory=sdir)
        else:
            self.atomindex = None

        if self.program == 'vasp':
            self.checker = VaspChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = VaspError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
        elif self.program == 'vasp_neb':
            self.checker = VaspNEBChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = VaspNEBError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
        elif self.program == 'phon':
            self.checker = PhonChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = PhonError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
        elif self.program == 'lammps':
            self.checker = LammpsChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = GenericError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
        elif self.program == 'structopt':
            self.checker = StructoptChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = GenericError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
        else:
            allowed_keys = {'name', 'program_keys', 'structure'}
            self.checker = GenericChecker(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
            self.errhandler = GenericError(
                name=self.keywords['name'],
                program_keys=self.keywords['program_keys'],
                structure=self.keywords['structure'])
示例#20
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)
示例#21
0
 def __init__(self, **kwargs):
     MASTObj.__init__(self, ALLOWED_KEYS, **kwargs)