diff --git a/custodian/__init__.py b/custodian/__init__.py index 216c82fe..c51f599d 100644 --- a/custodian/__init__.py +++ b/custodian/__init__.py @@ -2,6 +2,6 @@ __author__ = "Shyue Ping Ong, William Davidson Richards, Stephen Dacek, " \ "Xiaohui Qu" -__version__ = "2019.8.23" +__version__ = "2019.8.24" -from .custodian import Custodian +from .custodian import Custodian \ No newline at end of file diff --git a/docs/_modules/custodian/ansible/actions.html b/docs/_modules/custodian/ansible/actions.html index 59107c84..5c9bd3ef 100644 --- a/docs/_modules/custodian/ansible/actions.html +++ b/docs/_modules/custodian/ansible/actions.html @@ -4,7 +4,7 @@ - custodian.ansible.actions — custodian 2019.8.23 documentation + custodian.ansible.actions — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

Navigation

  • modules |
  • - + @@ -251,7 +251,7 @@

    Source code for custodian.ansible.actions

                     try:
                         os.remove(filename)
                     except OSError:
    -                    #Skip file not found error.
    +                    # Skip file not found error.
                         pass
                 elif k == "mode" and v == "simulated":
                     print("Simulated removal of {}".format(filename))
    @@ -280,9 +280,9 @@

    Source code for custodian.ansible.actions

             """
             for k, v in settings.items():
                 if k == "mode":
    -                os.chmod(filename,v)
    +                os.chmod(filename, v)
                 if k == "owners":
    -                os.chown(filename,v)
    + os.chown(filename, v) diff --git a/docs/_modules/custodian/ansible/interpreter.html b/docs/_modules/custodian/ansible/interpreter.html index 59d22398..09f0f25b 100644 --- a/docs/_modules/custodian/ansible/interpreter.html +++ b/docs/_modules/custodian/ansible/interpreter.html @@ -4,7 +4,7 @@ - custodian.ansible.interpreter — custodian 2019.8.23 documentation + custodian.ansible.interpreter — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - + @@ -57,7 +57,6 @@

    Source code for custodian.ansible.interpreter

    using support actions. """ - __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" @@ -65,7 +64,6 @@

    Source code for custodian.ansible.interpreter

    __email__ = "ongsp@ucsd.edu" __date__ = "Jun 1, 2012" - import re from custodian.ansible.actions import DictActions @@ -92,6 +90,7 @@

    Source code for custodian.ansible.interpreter

    >>> d['Hello'] 'Universe' """ + def __init__(self, actions=None, strict=True): """ Initializes a Modder from a list of supported actions. @@ -150,6 +149,7 @@

    Source code for custodian.ansible.interpreter

    if __name__ == "__main__": import doctest + doctest.testmod()
    diff --git a/docs/_modules/custodian/cli/converge_geometry.html b/docs/_modules/custodian/cli/converge_geometry.html index f59e341c..345919ca 100644 --- a/docs/_modules/custodian/cli/converge_geometry.html +++ b/docs/_modules/custodian/cli/converge_geometry.html @@ -4,7 +4,7 @@ - custodian.cli.converge_geometry — custodian 2019.8.23 documentation + custodian.cli.converge_geometry — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -71,13 +71,11 @@

    Source code for custodian.cli.converge_geometry

    < from custodian.vasp.jobs import VaspJob from pymatgen.io.vasp.outputs import Vasprun - FORMAT = '%(asctime)s %(message)s' logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log")
    [docs]def get_runs(args): - vasp_command = args.command.split() converged = False job_number = 0 @@ -88,8 +86,8 @@

    Source code for custodian.cli.converge_geometry

    < if job_number == 0: backup = True - #assume the initial guess is poor, - #start with conjugate gradients + # assume the initial guess is poor, + # start with conjugate gradients settings = [ {"dict": "INCAR", "action": {"_set": {"IBRION": 2}}} @@ -110,8 +108,8 @@

    Source code for custodian.cli.converge_geometry

    < {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}] - #switch to RMM-DIIS once we are near the - #local minimum (assumed after 2 runs of CG) + # switch to RMM-DIIS once we are near the + # local minimum (assumed after 2 runs of CG) else: settings = [ {"dict": "INCAR", diff --git a/docs/_modules/custodian/cli/converge_kpoints.html b/docs/_modules/custodian/cli/converge_kpoints.html index b13a54bf..eda57796 100644 --- a/docs/_modules/custodian/cli/converge_kpoints.html +++ b/docs/_modules/custodian/cli/converge_kpoints.html @@ -4,7 +4,7 @@ - custodian.cli.converge_kpoints — custodian 2019.8.23 documentation + custodian.cli.converge_kpoints — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -72,7 +72,6 @@

    Source code for custodian.cli.converge_kpoints

    from custodian.vasp.jobs import VaspJob from pymatgen.io.vasp import VaspInput, Vasprun - FORMAT = '%(asctime)s %(message)s' logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log") diff --git a/docs/_modules/custodian/cli/cstdn.html b/docs/_modules/custodian/cli/cstdn.html index d661e4cb..3b80eea8 100644 --- a/docs/_modules/custodian/cli/cstdn.html +++ b/docs/_modules/custodian/cli/cstdn.html @@ -4,7 +4,7 @@ - custodian.cli.cstdn — custodian 2019.8.23 documentation + custodian.cli.cstdn — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -62,7 +62,6 @@

    Source code for custodian.cli.cstdn

     from custodian.custodian import Custodian
     import logging
     
    -
     example_yaml = """
     # This is an example of a Custodian yaml spec file. It shows how you can specify
     # a double relaxation followed by a static calculation. Minor modifications
    diff --git a/docs/_modules/custodian/cli/run_nwchem.html b/docs/_modules/custodian/cli/run_nwchem.html
    index c8c0de23..7c03e14f 100644
    --- a/docs/_modules/custodian/cli/run_nwchem.html
    +++ b/docs/_modules/custodian/cli/run_nwchem.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.cli.run_nwchem — custodian 2019.8.23 documentation
    +    custodian.cli.run_nwchem — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    @@ -63,7 +63,6 @@

    Source code for custodian.cli.run_nwchem

     __status__ = "Beta"
     __date__ = "6/18/13"
     
    -
     import logging
     
     from custodian.custodian import Custodian
    diff --git a/docs/_modules/custodian/cli/run_vasp.html b/docs/_modules/custodian/cli/run_vasp.html
    index 04d5fd63..a8dc9e0a 100644
    --- a/docs/_modules/custodian/cli/run_vasp.html
    +++ b/docs/_modules/custodian/cli/run_vasp.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.cli.run_vasp — custodian 2019.8.23 documentation
    +    custodian.cli.run_vasp — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    @@ -128,7 +128,7 @@

    Source code for custodian.cli.run_vasp

                     ".", user_incar_settings={"LWAVE": True, "EDIFF": 1e-6},
                     ediff_per_atom=False)
                 settings.extend([
    -                {"dict"  : "INCAR",
    +                {"dict": "INCAR",
                      "action": {"_set": dict(vis.incar)}},
                     {'dict': 'KPOINTS',
                      'action': {'_set': vis.kpoints.as_dict()}}])
    @@ -197,8 +197,7 @@ 

    Source code for custodian.cli.run_vasp

                                          "LDAUU": [u * f for u in ldauu]}}})
                 copy_magmom = True
                 ramps += 1
    -        elif job_type.startswith("quick_relax") or job_type.startswith(\
    -                "quickrelax"):
    +        elif job_type.startswith("quick_relax") or job_type.startswith("quickrelax"):
                 kpoints = vinput["KPOINTS"]
                 incar = vinput["INCAR"]
                 structure = vinput["POSCAR"].structure
    @@ -214,7 +213,7 @@ 

    Source code for custodian.cli.run_vasp

                                       "action": {"_set": kpoints.as_dict()}})
                 # lattice vectors with length < 9 will get >1 KPOINT
                 low_kpoints = Kpoints.gamma_automatic(
    -                [max(int(18/l), 1) for l in structure.lattice.abc])
    +                [max(int(18 / l), 1) for l in structure.lattice.abc])
                 settings.extend([
                     {"dict": "INCAR",
                      "action": {"_set": {"ISMEAR": 0}}},
    @@ -284,7 +283,6 @@ 

    Source code for custodian.cli.run_vasp

             help="Set to true to turn off auto_npar. Useful for certain machines "
                  "and calculations where you want absolute control.")
     
    -
         parser.add_argument(
             "-z", "--gzip", dest="gzip", action="store_true",
             help="Add this option to gzip the final output. Do not gzip if you "
    @@ -310,7 +308,7 @@ 

    Source code for custodian.cli.run_vasp

         )
     
         parser.add_argument(
    -        "-me",  "--max-errors", dest="max_errors", nargs="?",
    +        "-me", "--max-errors", dest="max_errors", nargs="?",
             default=10, type=int,
             help="Maximum number of errors to allow before quitting")
     
    diff --git a/docs/_modules/custodian/custodian.html b/docs/_modules/custodian/custodian.html
    index 0aa53828..3dfae35e 100644
    --- a/docs/_modules/custodian/custodian.html
    +++ b/docs/_modules/custodian/custodian.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.custodian — custodian 2019.8.23 documentation
    +    custodian.custodian — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    @@ -63,11 +63,8 @@

    Source code for custodian.custodian

     from abc import ABCMeta, abstractmethod
     from itertools import islice
     import warnings
    -from pprint import pformat
     from ast import literal_eval
     
    -import six
    -
     from .utils import get_execution_host_info
     
     from monty.tempfile import ScratchDir
    @@ -88,7 +85,6 @@ 

    Source code for custodian.custodian

     __email__ = "ongsp@ucsd.edu"
     __date__ = "Sep 17 2014"
     
    -
     logger = logging.getLogger(__name__)
     
     if "SENTRY_DSN" in os.environ:
    @@ -98,17 +94,17 @@ 

    Source code for custodian.custodian

         # will not be used.
     
         import sentry_sdk
    +
         sentry_sdk.init(dsn=os.environ["SENTRY_DSN"])
    -    
    +
         with sentry_sdk.configure_scope() as scope:
    -        
    +
             from getpass import getuser
    +
             try:
                 scope.user = {"username": getuser()}
    -        except:
    +        except Exception:
                 pass
    -            
    -
     
     # Sentry.io is a service to aggregate logs remotely, this is useful
     # for Custodian to get statistics on which errors are most common.
    @@ -128,17 +124,20 @@ 

    Source code for custodian.custodian

     if SENTRY_DSN:
     
         import sentry_sdk
    +
         sentry_sdk.init(dsn=SENTRY_DSN)
    -    
    +
         with sentry_sdk.configure_scope() as scope:
    -        
    +
             from getpass import getuser
    +
             try:
                 scope.user = {"username": getuser()}
    -        except:
    +        except Exception:
                 pass
    -        
    +
             import socket
    +
             scope.set_tag("hostname", socket.gethostname())
     
     
    @@ -293,7 +292,7 @@ 

    Source code for custodian.custodian

             try:
                 Custodian._delete_checkpoints(cwd)
                 n = os.path.join(cwd, "custodian.chk.{}.tar.gz".format(index))
    -            with tarfile.open(n,  mode="w:gz", compresslevel=3) as f:
    +            with tarfile.open(n, mode="w:gz", compresslevel=3) as f:
                     f.add(cwd, arcname='.')
                 logger.info("Checkpoint written to {}".format(n))
             except Exception as ex:
    @@ -713,7 +712,7 @@ 

    Source code for custodian.custodian

                                 self.run_log[-1]["max_errors_per_handler"] = True
                                 raise MaxCorrectionsPerHandlerError(msg, True, h.max_num_corrections, h)
                             else:
    -                            logger.warning(msg+" Correction not applied.")
    +                            logger.warning(msg + " Correction not applied.")
                                 continue
                         if terminate_func is not None and h.is_terminating:
                             logger.info("Terminating job")
    @@ -744,7 +743,7 @@ 

    Source code for custodian.custodian

             return len(corrections) > 0
    -
    [docs]class Job(six.with_metaclass(ABCMeta, MSONable)): +
    [docs]class Job(MSONable): """ Abstract base class defining the interface for a Job. """ @@ -827,7 +826,7 @@

    Source code for custodian.custodian

         fixed maximum number of times on a single job (i.e. the counter is reset
         at the beginning of each job). If the maximum number is reached the code
         will either raise a MaxCorrectionsPerHandlerError (raise_on_max==True) or stops
    -    considering the correction (raise_on_max==False). If max_num_corrections 
    +    considering the correction (raise_on_max==False). If max_num_corrections
         is None this option is not considered. These options can be overridden
         as class attributes of the subclass or as customizable options setting
         an instance attribute from __init__.
    @@ -885,7 +884,7 @@ 

    Source code for custodian.custodian

             self._num_applied_corrections = value
    -
    [docs]class Validator(six.with_metaclass(ABCMeta, MSONable)): +
    [docs]class Validator(MSONable): """ Abstract base class defining the interface for a Validator. A Validator differs from an ErrorHandler in that it does not correct a run and is run diff --git a/docs/_modules/custodian/feff/handlers.html b/docs/_modules/custodian/feff/handlers.html index 41572ad8..34efe487 100644 --- a/docs/_modules/custodian/feff/handlers.html +++ b/docs/_modules/custodian/feff/handlers.html @@ -4,7 +4,7 @@ - custodian.feff.handlers — custodian 2019.8.23 documentation + custodian.feff.handlers — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -118,8 +118,8 @@

    Source code for custodian.feff.handlers

             nmix = scf_values[4]
             actions = []
     
    -        #Add RESTART card to PARAMETERS
    -        if not "RESTART" in feff_input.tags:
    +        # Add RESTART card to PARAMETERS
    +        if "RESTART" not in feff_input.tags:
                 actions.append({"dict": "PARAMETERS",
                                 "action": {"_set": {"RESTART": []}}})
     
    diff --git a/docs/_modules/custodian/feff/interpreter.html b/docs/_modules/custodian/feff/interpreter.html
    index 2717bfb8..427fe659 100644
    --- a/docs/_modules/custodian/feff/interpreter.html
    +++ b/docs/_modules/custodian/feff/interpreter.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.feff.interpreter — custodian 2019.8.23 documentation
    +    custodian.feff.interpreter — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    @@ -55,7 +55,6 @@

    Source code for custodian.feff.interpreter

     from custodian.ansible.actions import FileActions, DictActions
     from custodian.ansible.interpreter import Modder
     from pymatgen.io.feff.sets import FEFFDictSet
    -import six
     import os
     
     
    @@ -107,7 +106,7 @@ 

    Source code for custodian.feff.interpreter

                 feff_input = "\n\n".join(str(feff[k]) for k in
                                          ["HEADER", "PARAMETERS", "POTENTIALS", "ATOMS"]
                                          if k in feff)
    -            for k, v in six.iteritems(feff):
    +            for k, v in feff.items():
                     with open(os.path.join('.', k), "w") as f:
                         f.write(str(v))
     
    diff --git a/docs/_modules/custodian/feff/jobs.html b/docs/_modules/custodian/feff/jobs.html
    index a2790500..c04b5d8e 100644
    --- a/docs/_modules/custodian/feff/jobs.html
    +++ b/docs/_modules/custodian/feff/jobs.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.feff.jobs — custodian 2019.8.23 documentation
    +    custodian.feff.jobs — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    diff --git a/docs/_modules/custodian/nwchem/handlers.html b/docs/_modules/custodian/nwchem/handlers.html index 44adf487..778ea9d3 100644 --- a/docs/_modules/custodian/nwchem/handlers.html +++ b/docs/_modules/custodian/nwchem/handlers.html @@ -4,7 +4,7 @@ - custodian.nwchem.handlers — custodian 2019.8.23 documentation + custodian.nwchem.handlers — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -57,7 +57,6 @@

    Source code for custodian.nwchem.handlers

     for B3LYP DFT jobs.
     """
     
    -
     __author__ = "Shyue Ping Ong"
     __version__ = "0.1"
     __maintainer__ = "Shyue Ping Ong"
    @@ -65,7 +64,6 @@ 

    Source code for custodian.nwchem.handlers

     __status__ = "Beta"
     __date__ = "5/20/13"
     
    -
     from custodian.custodian import ErrorHandler
     from custodian.utils import backup
     from pymatgen.io.nwchem import NwOutput, NwInput
    @@ -132,7 +130,7 @@ 

    Source code for custodian.nwchem.handlers

                         t.theory_directives["cgmin"] = ""
                     for t in nwi.tasks:
                         if t.operation.startswith("freq"):
    -                        #You cannot calculate hessian with cgmin.
    +                        # You cannot calculate hessian with cgmin.
                             t.theory_directives["nocgmin"] = ""
                     action = {"_set": {"tasks": [t.as_dict() for t in nwi.tasks]}}
                     actions.append(action)
    diff --git a/docs/_modules/custodian/nwchem/jobs.html b/docs/_modules/custodian/nwchem/jobs.html
    index 0a597352..f5cf4d15 100644
    --- a/docs/_modules/custodian/nwchem/jobs.html
    +++ b/docs/_modules/custodian/nwchem/jobs.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.nwchem.jobs — custodian 2019.8.23 documentation
    +    custodian.nwchem.jobs — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    diff --git a/docs/_modules/custodian/qchem/handlers.html b/docs/_modules/custodian/qchem/handlers.html index 123e4fd9..c8b0a49a 100644 --- a/docs/_modules/custodian/qchem/handlers.html +++ b/docs/_modules/custodian/qchem/handlers.html @@ -4,7 +4,7 @@ - custodian.qchem.handlers — custodian 2019.8.23 documentation + custodian.qchem.handlers — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -105,6 +105,7 @@

    Source code for custodian.qchem.handlers

             # Checks output file for errors.
             self.outdata = QCOutput(self.output_file).data
             self.errors = self.outdata.get("errors")
    +        self.warnings = self.outdata.get("warnings")
             # If we aren't out of optimization cycles, but we were in the past, reset the history
             if "out_of_opt_cycles" not in self.errors and len(self.opt_error_history) > 0:
                 self.opt_error_history = []
    @@ -127,12 +128,18 @@ 

    Source code for custodian.qchem.handlers

                         self.scf_max_cycles):
                     self.qcinp.rem["max_scf_cycles"] = self.scf_max_cycles
                     actions.append({"max_scf_cycles": self.scf_max_cycles})
    +            elif self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
                 elif self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis":
    -                self.qcinp.rem["scf_algorithm"] = "gdm"
    -                actions.append({"scf_algorithm": "gdm"})
    -            elif self.qcinp.rem.get("scf_algorithm", "gdm").lower() == "gdm":
                     self.qcinp.rem["scf_algorithm"] = "diis_gdm"
                     actions.append({"scf_algorithm": "diis_gdm"})
    +            elif self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis_gdm":
    +                self.qcinp.rem["scf_algorithm"] = "gdm"
    +                actions.append({"scf_algorithm": "gdm"})
    +            elif self.qcinp.rem.get("scf_guess_always", "none").lower() != "true":
    +                self.qcinp.rem["scf_guess_always"] = True
    +                actions.append({"scf_guess_always": True})
                 else:
                     print(
                         "More advanced changes may impact the SCF result. Use the SCF error handler"
    @@ -149,8 +156,16 @@ 

    Source code for custodian.qchem.handlers

                         self.qcinp.molecule = self.outdata.get(
                             "molecule_from_last_geometry")
                         actions.append({"molecule": "molecule_from_last_geometry"})
    -            # If already at geom_max_cycles, often can just get convergence by restarting
    -            # from the geometry of the last cycle. But we'll also save any structural
    +            elif self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
    +            # Will need to try and implement this dmax handler below when I have more time
    +            # to fix the tests and the general handling procedure.
    +            # elif self.qcinp.rem.get("geom_opt_dmax",300) != 150:
    +            #     self.qcinp.rem["geom_opt_dmax"] = 150
    +            #     actions.append({"geom_opt_dmax": "150"})
    +            # If already at geom_max_cycles, thresh 14, and dmax 150, often can just get convergence
    +            # by restarting from the geometry of the last cycle. But we'll also save any structural
                 # changes that happened along the way.
                 else:
                     self.opt_error_history += [self.outdata["structure_change"]]
    @@ -169,27 +184,30 @@ 

    Source code for custodian.qchem.handlers

                     self.qcinp.molecule = self.outdata.get(
                         "molecule_from_last_geometry")
                     actions.append({"molecule": "molecule_from_last_geometry"})
    -            elif self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis":
    -                self.qcinp.rem["scf_algorithm"] = "rca_diis"
    -                actions.append({"scf_algorithm": "rca_diis"})
    -                if self.qcinp.rem.get("gen_scfman"):
    -                    self.qcinp.rem["gen_scfman"] = False
    -                    actions.append({"gen_scfman": False})
    +            elif self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
                 else:
                     print(
                         "Use a different initial guess? Perhaps a different basis?"
                     )
     
    -        elif "linear_dependent_basis" in self.errors:
    -            # DIIS -> RCA_DIIS. If already RCA_DIIS, change basis?
    -            if self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis":
    -                self.qcinp.rem["scf_algorithm"] = "rca_diis"
    -                actions.append({"scf_algorithm": "rca_diis"})
    -                if self.qcinp.rem.get("gen_scfman"):
    -                    self.qcinp.rem["gen_scfman"] = False
    -                    actions.append({"gen_scfman": False})
    +        elif "premature_end_FileMan_error" in self.errors:
    +            if self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
    +            elif self.qcinp.rem.get("scf_guess_always", "none").lower() != "true":
    +                self.qcinp.rem["scf_guess_always"] = True
    +                actions.append({"scf_guess_always": True})
    +            else:
    +                print("We're in a bad spot if we get a FileMan error while always generating a new SCF guess...")
    +
    +        elif "hessian_eigenvalue_error" in self.errors:
    +            if self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
                 else:
    -                print("Perhaps use a better basis?")
    +                print("Not sure how to fix hessian_eigenvalue_error if thresh is already 14!")
     
             elif "failed_to_transform_coords" in self.errors:
                 # Check for symmetry flag in rem. If not False, set to False and rerun.
    @@ -211,34 +229,45 @@ 

    Source code for custodian.qchem.handlers

     
             elif "failed_to_read_input" in self.errors:
                 # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is.
    -            actions.append({"rerun job as-is"})
    -
    -        elif "IO_error" in self.errors:
    -            # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is.
    -            actions.append({"rerun job as-is"})
    +            actions.append({"rerun_job_no_changes": True})
     
             elif "read_molecule_error" in self.errors:
                 # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is.
    -            actions.append({"rerun job as-is"})
    +            actions.append({"rerun_job_no_changes": True})
     
             elif "never_called_qchem" in self.errors:
                 # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is.
    -            actions.append({"rerun job as-is"})
    +            actions.append({"rerun_job_no_changes": True})
    +
    +        elif "licensing_error" in self.errors:
    +            # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is.
    +            actions.append({"rerun_job_no_changes": True})
     
             elif "unknown_error" in self.errors:
    -            print("Examine error message by hand.")
    -            return {"errors": self.errors, "actions": None}
    +            if self.qcinp.rem.get("scf_guess", "none").lower() == "read":
    +                del self.qcinp.rem["scf_guess"]
    +                actions.append({"scf_guess": "deleted"})
    +            elif self.qcinp.rem.get("thresh", "10") != "14":
    +                self.qcinp.rem["thresh"] = "14"
    +                actions.append({"thresh": "14"})
    +            else:
    +                print("Unknown error. Examine output and log files by hand.")
    +                return {"errors": self.errors, "actions": None}
     
             else:
                 # You should never get here. If correct is being called then errors should have at least one entry,
                 # in which case it should have been caught by the if/elifs above.
    -            print(
    -                "If you get this message, something has gone terribly wrong!")
    +            print("Errors:", self.errors)
    +            print("Must have gotten an error which is correctly parsed but not included in the handler. FIX!!!")
                 return {"errors": self.errors, "actions": None}
     
    +        if {"molecule": "molecule_from_last_geometry"} in actions and \
    +                str(self.qcinp.rem.get("geom_opt_hessian")).lower() == "read":
    +            del self.qcinp.rem["geom_opt_hessian"]
    +            actions.append({"geom_opt_hessian": "deleted"})
             os.rename(self.input_file, self.input_file + ".last")
             self.qcinp.write_file(self.input_file)
    -        return {"errors": self.errors, "actions": actions}
    + return {"errors": self.errors, "warnings": self.warnings, "actions": actions}
    [docs]class QChemSCFErrorHandler(ErrorHandler): diff --git a/docs/_modules/custodian/qchem/jobs.html b/docs/_modules/custodian/qchem/jobs.html index 81f8756a..dafdeae4 100644 --- a/docs/_modules/custodian/qchem/jobs.html +++ b/docs/_modules/custodian/qchem/jobs.html @@ -4,7 +4,7 @@ - custodian.qchem.jobs — custodian 2019.8.23 documentation + custodian.qchem.jobs — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -60,15 +60,15 @@

    Source code for custodian.qchem.jobs

     import shutil
     import copy
     import subprocess
    +import random
     import numpy as np
     from pymatgen.core import Molecule
     from pymatgen.io.qchem.inputs import QCInput
    -from pymatgen.io.qchem.outputs import QCOutput
    +from pymatgen.io.qchem.outputs import QCOutput, check_for_structure_changes
     from pymatgen.analysis.graphs import MoleculeGraph
     from pymatgen.analysis.local_env import OpenBabelNN
     from custodian.custodian import Job
     
    -
     __author__ = "Samuel Blau, Brandon Wood, Shyam Dwaraknath"
     __copyright__ = "Copyright 2018, The Materials Project"
     __version__ = "0.1"
    @@ -92,9 +92,9 @@ 

    Source code for custodian.qchem.jobs

                      output_file="mol.qout",
                      qclog_file="mol.qclog",
                      suffix="",
    -                 scratch_dir="/dev/shm/qcscratch/",
    +                 scratch_dir=os.getcwd(),
                      save_scratch=False,
    -                 save_name="default_save_name",
    +                 save_name="saved_scratch",
                      backup=True):
             """
             Args:
    @@ -106,11 +106,11 @@ 

    Source code for custodian.qchem.jobs

                 qclog_file (str): Name of the file to redirect the standard output
                     to. None means not to record the standard output.
                 suffix (str): String to append to the file in postprocess.
    -            scratch_dir (str): QCSCRATCH directory. Defaults to "/dev/shm/qcscratch/".
    -            save_scratch (bool): Whether to save scratch directory contents.
    +            scratch_dir (str): QCSCRATCH directory. Defaults to current directory.
    +            save_scratch (bool): Whether to save basic scratch directory contents.
                     Defaults to False.
                 save_name (str): Name of the saved scratch directory. Defaults to
    -                to "default_save_name".
    +                to "saved_scratch".
                 backup (bool): Whether to backup the initial input file. If True, the
                     input will be copied with a ".orig" appended. Defaults to True.
             """
    @@ -128,40 +128,27 @@ 

    Source code for custodian.qchem.jobs

     
         @property
         def current_command(self):
    -        multimode_index = 0
    +        multi = {"openmp": "-nt", "mpi": "-np"}
    +        if self.multimode not in multi:
    +            raise RuntimeError("ERROR: Multimode should only be set to openmp or mpi")
    +        command = [multi[self.multimode], str(self.max_cores), self.input_file, self.output_file]
             if self.save_scratch:
    -            command = [
    -                "-save", "",
    -                str(self.max_cores), self.input_file, self.output_file,
    -                self.save_name
    -            ]
    -            multimode_index = 1
    -        else:
    -            command = [
    -                "", str(self.max_cores), self.input_file, self.output_file
    -            ]
    -        if self.multimode == 'openmp':
    -            command[multimode_index] = "-nt"
    -        elif self.multimode == 'mpi':
    -            command[multimode_index] = "-np"
    -        else:
    -            print("ERROR: Multimode should only be set to openmp or mpi")
    +            command.append(self.save_name)
             command = self.qchem_command + command
    -        return command
    +        com_str = ""
    +        for part in command:
    +            com_str = com_str + " " + part
    +        return com_str
     
     
    [docs] def setup(self): if self.backup: shutil.copy(self.input_file, "{}.orig".format(self.input_file)) - os.putenv("QCSCRATCH", self.scratch_dir) + os.environ["QCSCRATCH"] = self.scratch_dir if self.multimode == 'openmp': - os.putenv('QCTHREADS', str(self.max_cores)) - os.putenv('OMP_NUM_THREADS', str(self.max_cores))
    + os.environ['QCTHREADS'] = str(self.max_cores) + os.environ['OMP_NUM_THREADS'] = str(self.max_cores)
    [docs] def postprocess(self): - if self.save_scratch: - shutil.copytree( - os.path.join(self.scratch_dir, self.save_name), - os.path.join(os.path.dirname(self.input_file), self.save_name)) if self.suffix != "": shutil.move(self.input_file, self.input_file + self.suffix) shutil.move(self.output_file, self.output_file + self.suffix) @@ -174,8 +161,12 @@

    Source code for custodian.qchem.jobs

             Returns:
                 (subprocess.Popen) Used for monitoring.
             """
    +        myrand = str(random.randint(1, 1000000000))
    +        mydir = os.path.join("/tmp", "qchem" + myrand)
    +        os.mkdir(mydir)
    +        os.environ["QCLOCALSCR"] = mydir
             qclog = open(self.qclog_file, 'w')
    -        p = subprocess.Popen(self.current_command, stdout=qclog)
    +        p = subprocess.Popen(self.current_command, stdout=qclog, shell=True)
             return p
    [docs] @classmethod @@ -188,6 +179,7 @@

    Source code for custodian.qchem.jobs

                                          max_iterations=10,
                                          max_molecule_perturb_scale=0.3,
                                          check_connectivity=True,
    +                                     linked=True,
                                          **QCJob_kwargs):
             """
             Optimize a structure and calculate vibrational frequencies to check if the
    @@ -209,121 +201,272 @@ 

    Source code for custodian.qchem.jobs

                 **QCJob_kwargs: Passthrough kwargs to QCJob. See
                     :class:`custodian.qchem.jobs.QCJob`.
             """
    -
    -        min_molecule_perturb_scale = 0.1
    -        scale_grid = 10
    -        perturb_scale_grid = (
    -            max_molecule_perturb_scale - min_molecule_perturb_scale
    -        ) / scale_grid
    -
             if not os.path.exists(input_file):
                 raise AssertionError('Input file must be present!')
    -        orig_opt_input = QCInput.from_file(input_file)
    -        orig_opt_rem = copy.deepcopy(orig_opt_input.rem)
    -        orig_freq_rem = copy.deepcopy(orig_opt_input.rem)
    -        orig_freq_rem["job_type"] = "freq"
    -        first = True
    -        reversed_direction = False
    -        num_neg_freqs = []
    -
    -        for ii in range(max_iterations):
    -            yield (QCJob(
    -                qchem_command=qchem_command,
    -                multimode=multimode,
    -                input_file=input_file,
    -                output_file=output_file,
    -                qclog_file=qclog_file,
    -                suffix=".opt_" + str(ii),
    -                backup=first,
    -                **QCJob_kwargs))
    -            first = False
    -            opt_outdata = QCOutput(output_file + ".opt_" + str(ii)).data
    -            if opt_outdata["structure_change"] == "unconnected_fragments" and not opt_outdata["completion"]:
    -                print("Unstable molecule broke into unconnected fragments which failed to optimize! Exiting...")
    -                break
    -            else:
    -                freq_QCInput = QCInput(
    -                    molecule=opt_outdata.get("molecule_from_optimized_geometry"),
    -                    rem=orig_freq_rem,
    -                    opt=orig_opt_input.opt,
    -                    pcm=orig_opt_input.pcm,
    -                    solvent=orig_opt_input.solvent)
    -                freq_QCInput.write_file(input_file)
    +
    +        if linked:
    +
    +            energy_diff_cutoff = 0.0000001
    +
    +            orig_input = QCInput.from_file(input_file)
    +            freq_rem = copy.deepcopy(orig_input.rem)
    +            freq_rem["job_type"] = "freq"
    +            opt_rem = copy.deepcopy(orig_input.rem)
    +            opt_rem["geom_opt_hessian"] = "read"
    +            opt_rem["scf_guess_always"] = True
    +            first = True
    +            energy_history = []
    +
    +            for ii in range(max_iterations):
                     yield (QCJob(
                         qchem_command=qchem_command,
                         multimode=multimode,
                         input_file=input_file,
                         output_file=output_file,
                         qclog_file=qclog_file,
    -                    suffix=".freq_" + str(ii),
    +                    suffix=".opt_" + str(ii),
    +                    scratch_dir=os.getcwd(),
    +                    save_scratch=True,
    +                    save_name="chain_scratch",
                         backup=first,
                         **QCJob_kwargs))
    -                outdata = QCOutput(output_file + ".freq_" + str(ii)).data
    -                errors = outdata.get("errors")
    -                if len(errors) != 0:
    -                    raise AssertionError('No errors should be encountered while flattening frequencies!')
    -                if outdata.get('frequencies')[0] > 0.0:
    -                    print("All frequencies positive!")
    +                opt_outdata = QCOutput(output_file + ".opt_" + str(ii)).data
    +                first = False
    +                if opt_outdata["structure_change"] == "unconnected_fragments" and not opt_outdata["completion"]:
    +                    print("Unstable molecule broke into unconnected fragments which failed to optimize! Exiting...")
                         break
                     else:
    -                    num_neg_freqs += [sum(1 for freq in outdata.get('frequencies') if freq < 0)]
    -                    if len(num_neg_freqs) > 1:
    -                        if num_neg_freqs[-1] == num_neg_freqs[-2] and not reversed_direction:
    -                            reversed_direction = True
    -                        elif num_neg_freqs[-1] == num_neg_freqs[-2] and reversed_direction:
    -                            if len(num_neg_freqs) < 3:
    -                                raise AssertionError("ERROR: This should only be possible after at least three frequency flattening iterations! Exiting...")
    -                            else:
    -                                raise Exception("ERROR: Reversing the perturbation direction still could not flatten any frequencies. Exiting...")
    -                        elif num_neg_freqs[-1] != num_neg_freqs[-2] and reversed_direction:
    -                            reversed_direction = False
    -
    -                    negative_freq_vecs = outdata.get("frequency_mode_vectors")[0]
    -                    structure_successfully_perturbed = False
    -
    -                    for molecule_perturb_scale in np.arange(
    -                            max_molecule_perturb_scale, min_molecule_perturb_scale,
    -                            -perturb_scale_grid):
    -                        new_coords = perturb_coordinates(
    -                            old_coords=outdata.get("initial_geometry"),
    -                            negative_freq_vecs=negative_freq_vecs,
    -                            molecule_perturb_scale=molecule_perturb_scale,
    -                            reversed_direction=reversed_direction)
    -                        new_molecule = Molecule(
    -                            species=outdata.get('species'),
    -                            coords=new_coords,
    -                            charge=outdata.get('charge'),
    -                            spin_multiplicity=outdata.get('multiplicity'))
    -                        if check_connectivity:
    -                            old_molgraph = MoleculeGraph.with_local_env_strategy(outdata.get("initial_molecule"),
    -                                                               OpenBabelNN(),
    -                                                               reorder=False,
    -                                                               extend_structure=False)
    -                            new_molgraph = MoleculeGraph.with_local_env_strategy(new_molecule,
    -                                                               OpenBabelNN(),
    -                                                               reorder=False,
    -                                                               extend_structure=False)
    -                            if old_molgraph.isomorphic_to(new_molgraph):
    -                                structure_successfully_perturbed = True
    +                    energy_history.append(opt_outdata.get("final_energy"))
    +                    freq_QCInput = QCInput(
    +                        molecule=opt_outdata.get("molecule_from_optimized_geometry"),
    +                        rem=freq_rem,
    +                        opt=orig_input.opt,
    +                        pcm=orig_input.pcm,
    +                        solvent=orig_input.solvent,
    +                        smx=orig_input.smx)
    +                    freq_QCInput.write_file(input_file)
    +                    yield (QCJob(
    +                        qchem_command=qchem_command,
    +                        multimode=multimode,
    +                        input_file=input_file,
    +                        output_file=output_file,
    +                        qclog_file=qclog_file,
    +                        suffix=".freq_" + str(ii),
    +                        scratch_dir=os.getcwd(),
    +                        save_scratch=True,
    +                        save_name="chain_scratch",
    +                        backup=first,
    +                        **QCJob_kwargs))
    +                    outdata = QCOutput(output_file + ".freq_" + str(ii)).data
    +                    errors = outdata.get("errors")
    +                    if len(errors) != 0:
    +                        raise AssertionError('No errors should be encountered while flattening frequencies!')
    +                    if outdata.get('frequencies')[0] > 0.0:
    +                        print("All frequencies positive!")
    +                        break
    +                    elif abs(outdata.get('frequencies')[0]) < 15.0 and outdata.get('frequencies')[1] > 0.0:
    +                        print("One negative frequency smaller than 15.0 - not worth further flattening!")
    +                        break
    +                    else:
    +                        if len(energy_history) > 1:
    +                            if abs(energy_history[-1] - energy_history[-2]) < energy_diff_cutoff:
    +                                print("Energy change below cutoff!")
                                     break
    -                    if not structure_successfully_perturbed:
    -                        raise Exception(
    -                            "ERROR: Unable to perturb coordinates to remove negative frequency without changing the connectivity! Exiting..."
    -                        )
    -
    -                    new_opt_QCInput = QCInput(
    -                        molecule=new_molecule,
    -                        rem=orig_opt_rem,
    +                        opt_QCInput = QCInput(
    +                            molecule=opt_outdata.get("molecule_from_optimized_geometry"),
    +                            rem=opt_rem,
    +                            opt=orig_input.opt,
    +                            pcm=orig_input.pcm,
    +                            solvent=orig_input.solvent,
    +                            smx=orig_input.smx)
    +                        opt_QCInput.write_file(input_file)
    +            if os.path.exists(os.path.join(os.getcwd(), "chain_scratch")):
    +                shutil.rmtree(os.path.join(os.getcwd(), "chain_scratch"))
    +
    +        else:
    +            if not os.path.exists(input_file):
    +                raise AssertionError('Input file must be present!')
    +            orig_opt_input = QCInput.from_file(input_file)
    +            orig_opt_rem = copy.deepcopy(orig_opt_input.rem)
    +            orig_freq_rem = copy.deepcopy(orig_opt_input.rem)
    +            orig_freq_rem["job_type"] = "freq"
    +            first = True
    +            history = []
    +
    +            for ii in range(max_iterations):
    +                yield (QCJob(
    +                    qchem_command=qchem_command,
    +                    multimode=multimode,
    +                    input_file=input_file,
    +                    output_file=output_file,
    +                    qclog_file=qclog_file,
    +                    suffix=".opt_" + str(ii),
    +                    backup=first,
    +                    **QCJob_kwargs))
    +                opt_outdata = QCOutput(output_file + ".opt_" + str(ii)).data
    +                if first:
    +                    orig_species = copy.deepcopy(opt_outdata.get('species'))
    +                    orig_charge = copy.deepcopy(opt_outdata.get('charge'))
    +                    orig_multiplicity = copy.deepcopy(opt_outdata.get('multiplicity'))
    +                    orig_energy = copy.deepcopy(opt_outdata.get('final_energy'))
    +                first = False
    +                if opt_outdata["structure_change"] == "unconnected_fragments" and not opt_outdata["completion"]:
    +                    print("Unstable molecule broke into unconnected fragments which failed to optimize! Exiting...")
    +                    break
    +                else:
    +                    freq_QCInput = QCInput(
    +                        molecule=opt_outdata.get("molecule_from_optimized_geometry"),
    +                        rem=orig_freq_rem,
                             opt=orig_opt_input.opt,
                             pcm=orig_opt_input.pcm,
    -                        solvent=orig_opt_input.solvent)
    -                    new_opt_QCInput.write_file(input_file)
    + solvent=orig_opt_input.solvent, + smx=orig_opt_input.smx) + freq_QCInput.write_file(input_file) + yield (QCJob( + qchem_command=qchem_command, + multimode=multimode, + input_file=input_file, + output_file=output_file, + qclog_file=qclog_file, + suffix=".freq_" + str(ii), + backup=first, + **QCJob_kwargs)) + outdata = QCOutput(output_file + ".freq_" + str(ii)).data + errors = outdata.get("errors") + if len(errors) != 0: + raise AssertionError('No errors should be encountered while flattening frequencies!') + if outdata.get('frequencies')[0] > 0.0: + print("All frequencies positive!") + if opt_outdata.get('final_energy') > orig_energy: + print("WARNING: Energy increased during frequency flattening!") + break + else: + hist = {} + hist["molecule"] = copy.deepcopy(outdata.get("initial_molecule")) + hist["geometry"] = copy.deepcopy(outdata.get("initial_geometry")) + hist["frequencies"] = copy.deepcopy(outdata.get("frequencies")) + hist["frequency_mode_vectors"] = copy.deepcopy(outdata.get("frequency_mode_vectors")) + hist["num_neg_freqs"] = sum(1 for freq in outdata.get("frequencies") if freq < 0) + hist["energy"] = copy.deepcopy(opt_outdata.get("final_energy")) + hist["index"] = len(history) + hist["children"] = [] + history.append(hist) + + ref_mol = history[-1]["molecule"] + geom_to_perturb = history[-1]["geometry"] + negative_freq_vecs = history[-1]["frequency_mode_vectors"][0] + reversed_direction = False + standard = True + + # If we've found one or more negative frequencies in two consecutive iterations, let's dig in + # deeper: + if len(history) > 1: + # Start by finding the latest iteration's parent: + if history[-1]["index"] in history[-2]["children"]: + parent_hist = history[-2] + history[-1]["parent"] = parent_hist["index"] + elif history[-1]["index"] in history[-3]["children"]: + parent_hist = history[-3] + history[-1]["parent"] = parent_hist["index"] + else: + raise AssertionError( + "ERROR: your parent should always be one or two iterations behind you! Exiting...") + + # if the number of negative frequencies has remained constant or increased from parent to + # child, + if history[-1]["num_neg_freqs"] >= parent_hist["num_neg_freqs"]: + # check to see if the parent only has one child, aka only the positive perturbation has + # been tried, + # in which case just try the negative perturbation from the same parent + if len(parent_hist["children"]) == 1: + ref_mol = parent_hist["molecule"] + geom_to_perturb = parent_hist["geometry"] + negative_freq_vecs = parent_hist["frequency_mode_vectors"][0] + reversed_direction = True + standard = False + parent_hist["children"].append(len(history)) + # If the parent has two children, aka both directions have been tried, then we have to + # get creative: + elif len(parent_hist["children"]) == 2: + # If we're dealing with just one negative frequency, + if parent_hist["num_neg_freqs"] == 1: + make_good_child_next_parent = False + if history[parent_hist["children"][0]]["energy"] < history[-1]["energy"]: + good_child = copy.deepcopy(history[parent_hist["children"][0]]) + else: + good_child = copy.deepcopy(history[-1]) + if good_child["num_neg_freqs"] > 1: + raise Exception( + "ERROR: Child with lower energy has more negative frequencies! " + "Exiting...") + elif good_child["energy"] < parent_hist["energy"]: + make_good_child_next_parent = True + elif vector_list_diff(good_child["frequency_mode_vectors"][0], + parent_hist["frequency_mode_vectors"][0]) > 0.2: + make_good_child_next_parent = True + else: + raise Exception("ERROR: Good child not good enough! Exiting...") + if make_good_child_next_parent: + good_child["index"] = len(history) + history.append(good_child) + ref_mol = history[-1]["molecule"] + geom_to_perturb = history[-1]["geometry"] + negative_freq_vecs = history[-1]["frequency_mode_vectors"][0] + else: + raise Exception( + "ERROR: Can't deal with multiple neg frequencies yet! Exiting...") + else: + raise AssertionError("ERROR: Parent cannot have more than two childen! Exiting...") + # Implicitly, if the number of negative frequencies decreased from parent to child, + # continue normally. + if standard: + history[-1]["children"].append(len(history)) + + min_molecule_perturb_scale = 0.1 + scale_grid = 10 + perturb_scale_grid = ( + max_molecule_perturb_scale - min_molecule_perturb_scale + ) / scale_grid + + structure_successfully_perturbed = False + for molecule_perturb_scale in np.arange( + max_molecule_perturb_scale, min_molecule_perturb_scale, + -perturb_scale_grid): + new_coords = perturb_coordinates( + old_coords=geom_to_perturb, + negative_freq_vecs=negative_freq_vecs, + molecule_perturb_scale=molecule_perturb_scale, + reversed_direction=reversed_direction) + new_molecule = Molecule( + species=orig_species, + coords=new_coords, + charge=orig_charge, + spin_multiplicity=orig_multiplicity) + if check_connectivity: + structure_successfully_perturbed = check_for_structure_changes( + ref_mol, new_molecule) == "no_change" + if structure_successfully_perturbed: + break + if not structure_successfully_perturbed: + raise Exception( + "ERROR: Unable to perturb coordinates to remove negative frequency without changing " + "the connectivity! Exiting..." + ) + + new_opt_QCInput = QCInput( + molecule=new_molecule, + rem=orig_opt_rem, + opt=orig_opt_input.opt, + pcm=orig_opt_input.pcm, + solvent=orig_opt_input.solvent, + smx=orig_opt_input.smx) + new_opt_QCInput.write_file(input_file)
    [docs]def perturb_coordinates(old_coords, negative_freq_vecs, molecule_perturb_scale, reversed_direction): max_dis = max( - [math.sqrt(sum([x**2 for x in vec])) for vec in negative_freq_vecs]) + [math.sqrt(sum([x ** 2 for x in vec])) for vec in negative_freq_vecs]) scale = molecule_perturb_scale / max_dis normalized_vecs = [[x * scale for x in vec] for vec in negative_freq_vecs] direction = 1.0 @@ -331,6 +474,15 @@

    Source code for custodian.qchem.jobs

             direction = -1.0
         return [[c + v * direction for c, v in zip(coord, vec)]
                 for coord, vec in zip(old_coords, normalized_vecs)]
    + + +
    [docs]def vector_list_diff(vecs1, vecs2): + diff = 0.0 + if len(vecs1) != len(vecs2): + raise AssertionError("ERROR: Vectors must be of equal length! Exiting...") + for ii, vec1 in enumerate(vecs1): + diff += np.linalg.norm(vecs2[ii] - vec1) + return diff
    diff --git a/docs/_modules/custodian/utils.html b/docs/_modules/custodian/utils.html index 2eaa52a8..25a82ffb 100644 --- a/docs/_modules/custodian/utils.html +++ b/docs/_modules/custodian/utils.html @@ -4,7 +4,7 @@ - custodian.utils — custodian 2019.8.23 documentation + custodian.utils — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -105,7 +105,7 @@

    Source code for custodian.utils

             try:
                 import socket
                 host = host or socket.gethostname()
    -        except:
    +        except Exception:
                 pass
         return host or 'unknown', cluster or 'unknown'
    diff --git a/docs/_modules/custodian/vasp/handlers.html b/docs/_modules/custodian/vasp/handlers.html index a928e363..d9164829 100644 --- a/docs/_modules/custodian/vasp/handlers.html +++ b/docs/_modules/custodian/vasp/handlers.html @@ -4,7 +4,7 @@ - custodian.vasp.handlers — custodian 2019.8.23 documentation + custodian.vasp.handlers — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -178,8 +178,7 @@

    Source code for custodian.vasp.handlers

             self.error_count = Counter()
             # threshold of number of atoms to treat the cell as large.
             self.natoms_large_cell = natoms_large_cell
    -        self.errors_subset_to_catch = errors_subset_to_catch or \
    -            list(VaspErrorHandler.error_msgs.keys())
    +        self.errors_subset_to_catch = errors_subset_to_catch or list(VaspErrorHandler.error_msgs.keys())
             self.logger = logging.getLogger(self.__class__.__name__)
     
     
    [docs] def check(self): @@ -222,7 +221,7 @@

    Source code for custodian.vasp.handlers

                     try:
                         assert (Outcar(zpath(os.path.join(
                             os.getcwd(), "OUTCAR"))).is_stopped is False)
    -                except:
    +                except Exception:
                         self.error_count['brmix'] += 1
     
                 if self.error_count['brmix'] == 0:
    @@ -241,17 +240,14 @@ 

    Source code for custodian.vasp.handlers

                 elif self.error_count['brmix'] == 2 and vi["KPOINTS"].style \
                         == Kpoints.supported_modes.Gamma:
                     actions.append({"dict": "KPOINTS",
    -                                "action": {"_set": {"generation_style":
    -                                                    "Monkhorst"}}})
    +                                "action": {"_set": {"generation_style": "Monkhorst"}}})
                     actions.append({"dict": "INCAR",
                                     "action": {"_unset": {"IMIX": 1}}})
                     self.error_count['brmix'] += 1
     
    -            elif self.error_count['brmix'] in [2, 3] and vi["KPOINTS"].style \
    -                    == Kpoints.supported_modes.Monkhorst:
    +            elif self.error_count['brmix'] in [2, 3] and vi["KPOINTS"].style == Kpoints.supported_modes.Monkhorst:
                     actions.append({"dict": "KPOINTS",
    -                                "action": {"_set": {"generation_style":
    -                                                    "Gamma"}}})
    +                                "action": {"_set": {"generation_style": "Gamma"}}})
                     actions.append({"dict": "INCAR",
                                     "action": {"_unset": {"IMIX": 1}}})
                     self.error_count['brmix'] += 1
    @@ -294,7 +290,7 @@ 

    Source code for custodian.vasp.handlers

                 try:
                     oszicar = Oszicar("OSZICAR")
                     nsteps = len(oszicar.ionic_steps)
    -            except:
    +            except Exception:
                     nsteps = 0
     
                 if nsteps >= 1:
    @@ -406,13 +402,11 @@ 

    Source code for custodian.vasp.handlers

                                 "action": {"_set": {"NBANDS": int(1.1 * nbands)}}})
     
             if "pssyevx" in self.errors:
    -            actions.append({"dict": "INCAR", "action":
    -                            {"_set": {"ALGO": "Normal"}}})
    +            actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "Normal"}}})
             if "eddrmm" in self.errors:
                 # RMM algorithm is not stable for this calculation
                 if vi["INCAR"].get("ALGO", "Normal") in ["Fast", "VeryFast"]:
    -                actions.append({"dict": "INCAR", "action":
    -                                {"_set": {"ALGO": "Normal"}}})
    +                actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "Normal"}}})
                 else:
                     potim = float(vi["INCAR"].get("POTIM", 0.5)) / 2.0
                     actions.append({"dict": "INCAR",
    @@ -427,8 +421,7 @@ 

    Source code for custodian.vasp.handlers

                 if vi["INCAR"].get("ICHARG", 0) < 10:
                     actions.append({"file": "CHGCAR",
                                     "action": {"_file_delete": {'mode': "actual"}}})
    -            actions.append({"dict": "INCAR", "action":
    -                            {"_set": {"ALGO": "All"}}})
    +            actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "All"}}})
     
             if "grad_not_orth" in self.errors:
                 if vi["INCAR"].get("ISMEAR", 1) < 0:
    @@ -453,7 +446,7 @@ 

    Source code for custodian.vasp.handlers

             if "posmap" in self.errors:
                 actions.append({"dict": "INCAR",
                                 "action": {"_set": {"SYMPREC": 1e-6}}})
    -        
    +
             if "point_group" in self.errors:
                 actions.append({"dict": "INCAR",
                                 "action": {"_set": {"ISYM": 0}}})
    @@ -682,7 +675,8 @@ 

    Source code for custodian.vasp.handlers

             """
             Initializes the handler with max drift
             Args:
    -            max_drift (float): This defines the max drift. Leaving this at the default of None gets the max_drift from EDFIFFG
    +            max_drift (float): This defines the max drift. Leaving this at the default of None gets the max_drift from
    +                EDFIFFG
             """
     
             self.max_drift = max_drift
    @@ -702,7 +696,7 @@ 

    Source code for custodian.vasp.handlers

     
             try:
                 outcar = Outcar("OUTCAR")
    -        except:
    +        except Exception:
                 # Can't perform check if Outcar not valid
                 return False
     
    @@ -781,14 +775,14 @@ 

    Source code for custodian.vasp.handlers

             # Also disregard if automatic KPOINT generation is used
             if (not vi["INCAR"].get('ISYM', True)) or \
                     vi[
    -                "KPOINTS"].style == Kpoints.supported_modes.Automatic:
    +                    "KPOINTS"].style == Kpoints.supported_modes.Automatic:
                 return False
     
             try:
                 v = Vasprun(self.output_vasprun)
                 if v.converged:
                     return False
    -        except:
    +        except Exception:
                 pass
             with open(self.output_filename, "r") as f:
                 for line in f:
    @@ -831,7 +825,7 @@ 

    Source code for custodian.vasp.handlers

                 v = Vasprun(self.output_filename)
                 if not v.converged:
                     return True
    -        except:
    +        except Exception:
                 pass
             return False
    @@ -914,7 +908,7 @@

    Source code for custodian.vasp.handlers

                 max_force = max(np.linalg.norm(forces, axis=1))
                 if max_force > self.max_force_threshold and v.converged is True:
                     return True
    -        except:
    +        except Exception:
                 pass
             return False
    @@ -965,7 +959,7 @@

    Source code for custodian.vasp.handlers

                 max_dE = max([s['dE'] for s in oszicar.ionic_steps[1:]]) / n
                 if max_dE > self.dE_threshold:
                     return True
    -        except:
    +        except Exception:
                 return False
    [docs] def correct(self): @@ -1065,7 +1059,7 @@

    Source code for custodian.vasp.handlers

                 if len(esteps) > self.nionic_steps:
                     return all([len(e) == nelm
                                 for e in esteps[-(self.nionic_steps + 1):-1]])
    -        except:
    +        except Exception:
                 pass
             return False
    @@ -1107,6 +1101,7 @@

    Source code for custodian.vasp.handlers

             else:
                 return {"errors": ["Non-converging job"], "actions": None}
    +
    [docs]class WalltimeHandler(ErrorHandler): """ Check if a run is nearing the walltime. If so, write a STOPCAR with @@ -1347,7 +1342,7 @@

    Source code for custodian.vasp.handlers

                 oszicar = Oszicar(self.output_filename)
                 if oszicar.final_energy > 0:
                     return True
    -        except:
    +        except Exception:
                 pass
             return False
    diff --git a/docs/_modules/custodian/vasp/interpreter.html b/docs/_modules/custodian/vasp/interpreter.html index cab14a4a..cd263bbd 100644 --- a/docs/_modules/custodian/vasp/interpreter.html +++ b/docs/_modules/custodian/vasp/interpreter.html @@ -4,7 +4,7 @@ - custodian.vasp.interpreter — custodian 2019.8.23 documentation + custodian.vasp.interpreter — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/_modules/custodian/vasp/jobs.html b/docs/_modules/custodian/vasp/jobs.html index 528c0dc6..697eeaee 100644 --- a/docs/_modules/custodian/vasp/jobs.html +++ b/docs/_modules/custodian/vasp/jobs.html @@ -4,7 +4,7 @@ - custodian.vasp.jobs — custodian 2019.8.23 documentation + custodian.vasp.jobs — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -177,21 +177,21 @@

    Source code for custodian.vasp.jobs

             self.gamma_vasp_cmd = gamma_vasp_cmd
             self.copy_magmom = copy_magmom
             self.auto_continue = auto_continue
    -        
    +
             if SENTRY_DSN:
    -          # if using Sentry logging, add specific VASP executable to scope
    -          from sentry_sdk import configure_scope
    -          with configure_scope() as scope:
    -              try:
    -                  if isinstance(vasp_cmd, str):
    -                      vasp_path = which(vasp_cmd.split(' ')[-1])
    -                  elif isinstance(vasp_cmd, list):
    -                      vasp_path = which(vasp_cmd[-1])
    -                  scope.set_tag("vasp_path", vasp_path)
    -                  scope.set_tag("vasp_cmd", vasp_cmd)
    -              except:
    -                  logger.error("Failed to detect VASP path: {}".format(vasp_cmd), exc_info=True)
    -                  scope.set_tag("vasp_cmd", vasp_cmd)
    +            # if using Sentry logging, add specific VASP executable to scope
    +            from sentry_sdk import configure_scope
    +            with configure_scope() as scope:
    +                try:
    +                    if isinstance(vasp_cmd, str):
    +                        vasp_path = which(vasp_cmd.split(' ')[-1])
    +                    elif isinstance(vasp_cmd, list):
    +                        vasp_path = which(vasp_cmd[-1])
    +                    scope.set_tag("vasp_path", vasp_path)
    +                    scope.set_tag("vasp_cmd", vasp_cmd)
    +                except Exception:
    +                    logger.error("Failed to detect VASP path: {}".format(vasp_cmd), exc_info=True)
    +                    scope.set_tag("vasp_cmd", vasp_cmd)
     
     
    [docs] def setup(self): """ @@ -228,7 +228,7 @@

    Source code for custodian.vasp.jobs

                                     incar["NPAR"] = npar
                                     break
                         incar.write_file("INCAR")
    -            except:
    +            except Exception:
                     pass
     
             if self.auto_continue:
    @@ -297,7 +297,7 @@ 

    Source code for custodian.vasp.jobs

                     incar = Incar.from_file("INCAR")
                     incar['MAGMOM'] = magmom
                     incar.write_file("INCAR")
    -            except:
    +            except Exception:
                     logger.error('MAGMOM copy from OUTCAR to INCAR failed')
     
             # Remove continuation so if a subsequent job is run in
    @@ -659,7 +659,7 @@ 

    Source code for custodian.vasp.jobs

                 if "vasp" in k:
                     try:
                         os.system("killall %s" % k)
    -                except:
    +                except Exception:
                         pass
    @@ -789,7 +789,7 @@

    Source code for custodian.vasp.jobs

                             incar["NPAR"] = npar
                             break
                     incar.write_file("INCAR")
    -            except:
    +            except Exception:
                     pass
     
             if self.auto_continue and \
    diff --git a/docs/_modules/custodian/vasp/validators.html b/docs/_modules/custodian/vasp/validators.html
    index d866767a..ef4a5fd1 100644
    --- a/docs/_modules/custodian/vasp/validators.html
    +++ b/docs/_modules/custodian/vasp/validators.html
    @@ -4,7 +4,7 @@
     
       
         
    -    custodian.vasp.validators — custodian 2019.8.23 documentation
    +    custodian.vasp.validators — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    @@ -80,34 +80,33 @@

    Source code for custodian.vasp.validators

     
    [docs] def check(self): try: Vasprun("vasprun.xml") - except: + except Exception: exception_context = {} - + if os.path.exists(self.output_file): with open(self.output_file, "r") as output_file: output_file_tail = deque(output_file, maxlen=10) exception_context["output_file_tail"] = "".join(output_file_tail) - + if os.path.exists(self.stderr_file): with open(self.stderr_file, "r") as stderr_file: stderr_file_tail = deque(stderr_file, maxlen=10) exception_context["stderr_file_tail"] = "".join(stderr_file_tail) - + if os.path.exists("vasprun.xml"): - stat = os.stat("vasprun.xml") exception_context["vasprun_st_size"] = stat.st_size exception_context["vasprun_st_atime"] = stat.st_atime exception_context["vasprun_st_mtime"] = stat.st_mtime exception_context["vasprun_st_ctime"] = stat.st_ctime - + with open("vasprun.xml", "r") as vasprun: vasprun_tail = deque(vasprun, maxlen=10) exception_context["vasprun_tail"] = "".join(vasprun_tail) - + self.logger.error("Failed to load vasprun.xml", exc_info=True, extra=exception_context) - + return True return False
    @@ -151,6 +150,7 @@

    Source code for custodian.vasp.validators

             else:
                 return True
    +
    [docs]class VaspAECCARValidator(Validator): """ Check if the data in the AECCAR is corrupted @@ -165,6 +165,7 @@

    Source code for custodian.vasp.validators

             aeccar = aeccar0 + aeccar2
             return check_broken_chgcar(aeccar)
    +
    [docs]def check_broken_chgcar(chgcar): chgcar_data = chgcar.data['total'] if (chgcar_data < 0).sum() > 100: @@ -172,7 +173,7 @@

    Source code for custodian.vasp.validators

             return True
     
         diff = chgcar_data[:-1, :-1, :-1] - chgcar_data[1:, 1:, 1:]
    -    if diff.max()/(chgcar_data.max() - chgcar_data.min()) > 0.95:
    +    if diff.max() / (chgcar_data.max() - chgcar_data.min()) > 0.95:
             # Some single diagonal finite difference is more than 95% of the entire range
             return True
     
    diff --git a/docs/_modules/index.html b/docs/_modules/index.html
    index 56a6d705..4dfccac4 100644
    --- a/docs/_modules/index.html
    +++ b/docs/_modules/index.html
    @@ -4,7 +4,7 @@
     
       
         
    -    Overview: module code — custodian 2019.8.23 documentation
    +    Overview: module code — custodian 2019.8.24 documentation
         
         
         
    @@ -37,7 +37,7 @@ 

    Navigation

  • modules |
  • - +
    diff --git a/docs/_sources/_themes/README.rst.txt b/docs/_sources/_themes/README.rst.txt deleted file mode 100644 index e8179f96..00000000 --- a/docs/_sources/_themes/README.rst.txt +++ /dev/null @@ -1,25 +0,0 @@ -krTheme Sphinx Style -==================== - -This repository contains sphinx styles Kenneth Reitz uses in most of -his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. - -2. add this to your conf.py: :: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'kr' - -The following themes exist: - -**kr** - the standard flask documentation theme for large projects - -**kr_small** - small one-page theme. Intended to be used by very small addon libraries. - diff --git a/docs/_sources/changelog.rst.txt b/docs/_sources/changelog.rst.txt deleted file mode 100644 index c975f125..00000000 --- a/docs/_sources/changelog.rst.txt +++ /dev/null @@ -1,218 +0,0 @@ -Change Log -========== - -v2017.12.23 ------------ -* cstdn command line tool is now official with docs. -* Fine-grained control of VaspErrorHandler is now possible using - `errors_subset_to_catch`. -* Switched to date-based versioning for custodian like pymatgen. - -v1.1.1 ------- -* DriftErrorHandler (Shyam) - -v1.1.0 ------- -* Improved error handling for Qchem calculations. - -v1.0.4 ------- -* Improved handling of non-zero return codes. - -v1.0.2 ------- -* Interrupted run feature. (Shyam Dwaraknath) - -v1.0.1 ------- -* Pymatgen 4.0.0 compatible release. - -v1.0.0 ------- -* Custodian now comes with a "cstdn" script that enables the arbitrary creation - of simple job sequences using a yaml file, and the running of calculations - based on these yaml specifications. - -v0.8.8 ------- -1. Fix setup.py. - -v0.8.5 ------- -1. Refactoring to support pymatgen 3.1.4. - -v0.8.2 ------- -1. Made auto_npar optional for double relaxation VASP run. - -v0.8.1 ------- -1. Misc bug fixes (minor). - -v0.8.0 ------- -1. Major refactoring of Custodian to introdce Validators, - which are effectively post-Job checking mechanisms that do not perform - error correction. -2. **Backwards incompatibility** BadVasprunXMLHandler is now a validator, - which must be separately imported to be used. -3. Miscellaneous cleanup of Py3k fixes. -v0.7.6 ------- -1. Custodian is now Python 3 compatible and uses the latest versions of - pymatgen and monty. - -v0.7.5 ------- -1. **Major** Custodian now exits with RuntimeError when max_errors or - unrecoverable_error is encountered. -2. Added BadVasprunXMLHandler. - -v0.7.4 ------- -1. auto_npar option in VaspJob now properly handles Hessian calculations. -2. WalltimeHandler now supports termination at electronic step (David - Waroquiers). -3. Improved handling of BRMIX fixes. - -v0.7.3 ------- -1. Improved backwards compatibility for WallTimeHandler. -2. Improvements to VaspErrorHandler. No longer catches spurious BRMIX error - messages when NELECT is specified in INCAR, and pricel and rot_mat errors - are now fixed with symmetry precision and gamma centered KPOINTS instead. -3. Improved Qchem error handler (Xiaohui Qu). - -v0.7.2 ------- -1. Improved WalltimeHandler (PBSWalltimeHandler is a subset and is now - deprecated). -2. New monty required version (>= 0.2.2). - -v0.7.1 ------- -1. Much improved qchem error handling (Xiaohui Qu). -2. New Monty required version (>= 0.2.0). - -v0.7.0 ------- -1. **Backwards incompatible with v0.6.3. Refactoring to move commonly used - Python utility functions to `Monty package `_, which is now a depedency - for custodian. -2. Custodian now requires pymatgen >= 2.9.0 for VASP, Qchem and Nwchem jobs - and handlers. -3. converge_kpoints script now has increment mode. -4. ErrorHandlers now have a new API, where the class variables "is_monitor" - and "is_terminating" are provided to indicate if a particular handler - runs in the background during a Job and whether a handler should - terminate the job. Some errors may not be critical or may need to wait - for some other event to terminate a job. For example, - a particular error may require a flag to be set to request a job to - terminate gracefully once it finishes its current task. The handler to - set the flag should not terminate the job. - -0.6.3 ------ -1. Added buffer time option in PBSWalltimeHandler. -2. Improved Qchem jobs and handlers (Xiaohui Qu). -3. Vastly improved API docs. - -0.6.2 ------ -1. Bug fix release to support sub dirs in run folder when using scratch. -2. Improve handling of walltime in PBSWalltimeHander. - -0.6.1 ------ -1. Bug fix release to address minor issue with checkpointing. -2. Checkpointing is now turned off by default. - -0.6.0 ------ -1. Checkpointing implemented for Custodian. Custodian can now checkpoint all - files in the current working directory after every successful job. If the - job is resubmitted, it will restore files and start from the last - checkpoint. Particularly useful for multi-job runs. -2. Added PBSWalltimeHandler to handle wall times for PBS Vasp Jobs. -3. Qchem error handlers and jobs. - -0.5.0 ------ -1. Added scratch_dir option to Custodian class as well as run_vasp and - run_nwchem scripts. Many supercomputing clusters have a scratch space - which have significantly faster IO. This option provides a transparent way - to specify the jobs to be performed in the scratch. Especially useful for - jobs which have significant file IO. - -0.4.5 ------ -1. Fix gzip of output. - -0.4.3 ------ -1. Added handling for ZBRENT error for VASP. -2. Minor refactoring to consolidate backup and gzip directory methods. - -0.4.2 ------ -1. Rudimentary support for Nwchem error handling (by Shyue Ping Ong). -2. Improved VASP error handling (by Steve Dacek and Will Richards). - -0.4.1 ------ -1. Added hanlding of PRICEL error in VASP. -2. Speed and robustness improvements. -3. BRIONS error now handled by changing ISYM. - -0.4.0 ------ -1. Many VASP handlers are now consolidated into a single VaspErrorHandler. -2. Many more fixes for VASP runs, including the "TOO FEW BANDS", - "TRIPLE PRODUCT", "DENTET" and "BRIONS" errors. -3. VaspJob now includes the auto_npar and auto_gamma options, which - automatically optimizes the NPAR setting to be sqrt(number of cores) as - per the VASP recommendation for DFT runs and tries to search for a - gamma-only compiled version of VASP for gamma 1x1x1 runs. - -0.3.5 ------ -1. Bug fix for incorrect shift error handler in VASP. -2. More robust fix for unconverged VASP runs (switching from ALGO fast to - normal). -3. Expanded documentation. - -0.3.4 ------ -1. Added support for handlers that perform monitor a job as it is progressing - and terminates it if necessary. Useful for correcting errors that come up - by do not cause immediate job failures. - -0.3.2 ------ -1. Important bug fix for VaspJob and converge_kpoints script. - -0.3.0 ------ - -1. Major update to custodian API. Custodian now perform more comprehensive - logging in a file called custodian.json, which logs all jobs and - corrections performed. - -Version 0.2.6 -------------- -1. Bug fix for run_vasp script for static runs. - -Version 0.2.5 -------------- -1. run_vasp script that now provides flexible specification of vasp runs. -2. Vastly improved error handling for VASP runs. -3. Improved logging system for custodian. -4. Improved API for custodian return types during run. -5. First stable release. - -Version 0.2.4 -------------- - -1. Bug fixes for aflow style runs assimilation. diff --git a/docs/_sources/custodian.ansible.rst.txt b/docs/_sources/custodian.ansible.rst.txt deleted file mode 100644 index 5840ac5f..00000000 --- a/docs/_sources/custodian.ansible.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.ansible package -========================= - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.ansible.actions module --------------------------------- - -.. automodule:: custodian.ansible.actions - :members: - :undoc-members: - :show-inheritance: - -custodian.ansible.interpreter module ------------------------------------- - -.. automodule:: custodian.ansible.interpreter - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.ansible - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.cli.rst.txt b/docs/_sources/custodian.cli.rst.txt deleted file mode 100644 index c83b5d9c..00000000 --- a/docs/_sources/custodian.cli.rst.txt +++ /dev/null @@ -1,54 +0,0 @@ -custodian.cli package -===================== - -Submodules ----------- - -custodian.cli.converge\_geometry module ---------------------------------------- - -.. automodule:: custodian.cli.converge_geometry - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.converge\_kpoints module --------------------------------------- - -.. automodule:: custodian.cli.converge_kpoints - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.cstdn module --------------------------- - -.. automodule:: custodian.cli.cstdn - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.run\_nwchem module --------------------------------- - -.. automodule:: custodian.cli.run_nwchem - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.run\_vasp module ------------------------------- - -.. automodule:: custodian.cli.run_vasp - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.cli - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.feff.rst.txt b/docs/_sources/custodian.feff.rst.txt deleted file mode 100644 index 753541f9..00000000 --- a/docs/_sources/custodian.feff.rst.txt +++ /dev/null @@ -1,44 +0,0 @@ -custodian.feff package -====================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.feff.handlers module ------------------------------- - -.. automodule:: custodian.feff.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.feff.interpreter module ---------------------------------- - -.. automodule:: custodian.feff.interpreter - :members: - :undoc-members: - :show-inheritance: - -custodian.feff.jobs module --------------------------- - -.. automodule:: custodian.feff.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.feff - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.nwchem.rst.txt b/docs/_sources/custodian.nwchem.rst.txt deleted file mode 100644 index be9c01a4..00000000 --- a/docs/_sources/custodian.nwchem.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.nwchem package -======================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.nwchem.handlers module --------------------------------- - -.. automodule:: custodian.nwchem.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.nwchem.jobs module ----------------------------- - -.. automodule:: custodian.nwchem.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.nwchem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.qchem.rst.txt b/docs/_sources/custodian.qchem.rst.txt deleted file mode 100644 index 6fc3df09..00000000 --- a/docs/_sources/custodian.qchem.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.qchem package -======================= - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.qchem.handlers module -------------------------------- - -.. automodule:: custodian.qchem.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.qchem.jobs module ---------------------------- - -.. automodule:: custodian.qchem.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.qchem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.rst.txt b/docs/_sources/custodian.rst.txt deleted file mode 100644 index 97747550..00000000 --- a/docs/_sources/custodian.rst.txt +++ /dev/null @@ -1,42 +0,0 @@ -custodian package -================= - -Subpackages ------------ - -.. toctree:: - - custodian.ansible - custodian.cli - custodian.feff - custodian.nwchem - custodian.qchem - custodian.vasp - -Submodules ----------- - -custodian.custodian module --------------------------- - -.. automodule:: custodian.custodian - :members: - :undoc-members: - :show-inheritance: - -custodian.utils module ----------------------- - -.. automodule:: custodian.utils - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/custodian.vasp.rst.txt b/docs/_sources/custodian.vasp.rst.txt deleted file mode 100644 index 2d8dbc9b..00000000 --- a/docs/_sources/custodian.vasp.rst.txt +++ /dev/null @@ -1,52 +0,0 @@ -custodian.vasp package -====================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.vasp.handlers module ------------------------------- - -.. automodule:: custodian.vasp.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.interpreter module ---------------------------------- - -.. automodule:: custodian.vasp.interpreter - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.jobs module --------------------------- - -.. automodule:: custodian.vasp.jobs - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.validators module --------------------------------- - -.. automodule:: custodian.vasp.validators - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.vasp - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sources/index.rst.txt b/docs/_sources/index.rst.txt deleted file mode 100644 index eaa523f6..00000000 --- a/docs/_sources/index.rst.txt +++ /dev/null @@ -1,368 +0,0 @@ -Custodian -========= - -Custodian is a simple, robust and flexible just-in-time (JIT) job management -framework written in Python. Using custodian, you can create wrappers that -perform error checking, job management and error recovery. It has a simple -plugin framework that allows you to develop specific job management workflows -for different applications. - -Error recovery is an important aspect of many *high-throughput* projects that -generate data on a large scale. When you are running on the order of hundreds -of thousands of jobs, even an error rate of 1% would mean thousands of errored -jobs that would be impossible to deal with on a case-by-case basis. - -The specific use case for custodian is for long running jobs, with potentially -random errors. For example, there may be a script that takes several days to -run on a server, with a 1% chance of some IO error causing the job to fail. -Using custodian, one can develop a mechanism to gracefully recover from the -error, and restart the job with modified parameters if necessary. - -The current version of Custodian also comes with two sub-packages for error -handling for Vienna Ab Initio Simulation Package (VASP), NwChem and QChem -calculations. - -Change log -========== - -v2019.2.10 ----------- -* Improved slow convergence handling. (@shyamd) - -v2019.2.7 ---------- -* Improved error logging. -* Improved handling of frozen jobs and potim errors. -* Improved Exceptino handling. (Guido Petretto) - - -:doc:`Older versions ` - -Getting custodian -================= - -Stable version --------------- - -The version at the Python Package Index (PyPI) is always the latest stable -release that will be hopefully, be relatively bug-free. The easiest way to -install custodian on any system is to use easy_install or pip, as follows:: - - easy_install custodian - -or:: - - pip install custodian - -Some plugins (e.g., vasp management) require additional setup (please see -`pymatgen's documentation`_). - -Developmental version ---------------------- - -The bleeding edge developmental version is at the custodian's `Github repo -`_. The developmental -version is likely to be more buggy, but may contain new features. The -Github version include test files as well for complete unit testing. After -cloning the source, you can type:: - - python setup.py install - -or to install the package in developmental mode:: - - python setup.py develop - -Requirements -============ - -Custodian requires Python 2.7+. There are no other required dependencies. - -Optional dependencies ---------------------- - -Optional libraries that are required if you need certain features: - -1. Python Materials Genomics (`pymatgen`_) 2.8.10+: To use the plugin for - VASP, NwChem and Qchem. Please install using:: - - pip install pymatgen - - For more information, please consult `pymatgen's documentation`_. -2. nose - For complete unittesting. - -Usage -===== - -The main class in the workflow is known as Custodian, which manages a series -of jobs with a list of error handlers. The general workflow for Custodian is -presented in the figure below. - -.. figure:: _static/Custodian.png - :width: 500px - :align: center - :alt: Custodian workflow - :figclass: align-center - - Overview of the Custodian workflow. - -The Custodian class takes in two general inputs - a **list of Jobs** and -a **list of ErrorHandlers**. **Jobs** should be subclasses of the -:class:`custodian.custodian.Job` abstract base class and **ErrorHandlers** -should be subclasses of the :class:`custodian.custodian.ErrorHandler` abstract -base class. To use custodian, you need to implement concrete implementations -of these abstract base classes. - -Simple example --------------- - -An very simple example implementation is given in the custodian_examples.py -script in the scripts directory. We will now go through the example in detail -here. - -The ExampleJob has the following code. - -.. code-block:: python - - class ExampleJob(Job): - - def __init__(self, jobid, params=None): - if params is None: - params = {"initial": 0, "total": 0} - self.jobid = jobid - self.params = params - - def setup(self): - self.params["initial"] = 0 - self.params["total"] = 0 - - def run(self): - sequence = [random.uniform(0, 1) for i in range(100)] - self.params["total"] = self.params["initial"] + sum(sequence) - - def postprocess(self): - pass - - @property - def name(self): - return "ExampleJob{}".format(self.jobid) - - -The ExampleJob simply sums a random sequence of 100 numbers between 0 and -1, adds it to an initial value and puts the value in 'total' variable. The -ExampleJob subclasses the Job abstract base class, and implements the necessary -API comprising of just three key methods: **setup(), run(), -and postprocess()**. - -Let us now define an ErrorHandler that will check if the total value is >= 50, -and if it is not, it will increment the initial value by 1 and rerun the -ExampleJob again. - -.. code-block:: python - - - class ExampleHandler(ErrorHandler): - - def __init__(self, params): - self.params = params - - def check(self): - return self.params["total"] < 50 - - def correct(self): - self.params["initial"] += 1 - return {"errors": "total < 50", "actions": "increment by 1"} - -As you can see above, the ExampleHandler subclasses the ErrorHandler abstract -base class, and implements the necessary API comprising of just two key -methods: **check() and correct()**. - -The transfer of information between the Job and ErrorHandler is done using -the params argument in this example, which is not ideal but is sufficiently -for demonstrating the Custodian API. In real world usage, -a more common transfer of information may involve the Job writing the output -to a file, and the ErrorHandler checking the contents of those files to -detect error situations. - -To run the job, one simply needs to supply a list of ExampleJobs and -ErrorHandlers to a Custodian. - -.. code-block:: python - - njobs = 100 - params = {"initial": 0, "total": 0} - c = Custodian([ExampleHandler(params)], - [ExampleJob(i, params) for i in xrange(njobs)], - max_errors=njobs) - c.run() - -If you run custodian_example.py in the scripts directory, you will noticed that -a **custodian.json** file was generated, which summarizes the jobs that have -been run and any corrections performed. - -Practical example: Electronic structure calculations ----------------------------------------------------- - -A practical example where the Custodian framework is particularly useful is -in the area of electronic structure calculations. Electronic structure -calculations tend to be long running and often terminates due to errors, -random or otherwise. Such errors become a major issue in projects that -performs such calculations in high throughput, such as the `Materials -Project`_. - -The Custodian package comes with a fairly comprehensive plugin to deal -with jobs (:mod:`custodian.vasp.jobs`) and errors -(:mod:`custodian.vasp.handlers`) in electronic structure calculations based -on the Vienna Ab Initio Simulation Package (VASP). To do this, -Custodian uses the Python Materials Genomics (`pymatgen`_) package to -perform analysis and io from VASP input and output files. - -A simple example of a script using Custodian to run a two-relaxation VASP job -is as follows: - -.. code-block:: python - - from custodian.custodian import Custodian - from custodian.vasp.handlers import VaspErrorHandler, \ - UnconvergedErrorHandler, PoscarErrorHandler, DentetErrorHandler - from custodian.vasp.jobs import VaspJob - - handlers = [VaspErrorHandler(), UnconvergedErrorHandler(), - PoscarErrorHandler(), DentetErrorHandler()] - jobs = VaspJob.double_relaxation_run(args.command.split()) - c = Custodian(handlers, jobs, max_errors=10) - c.run() - -The above will gracefully deal with many VASP errors encountered during -relaxation. For example, it will correct ISMEAR to 0 if there are -insufficient KPOINTS to use ISMEAR = -5. - -Using custodian, you can even setup potentially indefinite jobs, -e.g. kpoints convergence jobs with a target energy convergence. Please see the -converge_kpoints script in the scripts for an example. - -.. versionadded:: 0.4.3 - - A new package for dealing with NwChem calculations has been added. - NwChem is an open-source code for performing computational chemistry - calculations. - -cstdn - A yaml-spec controlled job -================================== - -Custodian now comes with a cstdn script, which allows you to do fine-grained -control of a job using a yaml spec file. Below is an annotated example of how -you can specify a double VASP relaxation followed by a static calculation. -Minor modifications would allow very customizable calculations, though this is -obviously not meant for highly complex workflows. For those, usage of `FireWorks -`_ is highly recommended. - -Sample yaml spec:: - - # Specifies a list of jobs to run. - # Each job is specified by a `jb: ` with parameters specified - # via the params dict. - - jobs: - - jb: custodian.vasp.jobs.VaspJob - params: - final: False - suffix: .relax1 - - jb: custodian.vasp.jobs.VaspJob - params: - final: False - suffix: .relax2 - settings_override: - - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}} - - jb: custodian.vasp.jobs.VaspJob - params: - final: True - suffix: .static3 - settings_override: - - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}} - - {"dict": "INCAR", "action": {"_set": {"NSW": 0}}} - - - # This key specifies parameters common to all jobs. - # Keys starting with $ are expanded to the environmental values. - # The example below means the parameter vasp_cmd is set to the value with - # $PBS_NODEFILE expanded. - - jobs_common_params: - $vasp_cmd: ["mpirun", "-machinefile", "$PBS_NODEFILE", "-np", "24", "vasp"] - - - # Specifies a list of error handlers in the same format as jobs. Similarly, - # parameters passed to the handler __init__ can be configured the same - # way as for jobs. - handlers: - - hdlr: custodian.vasp.handlers.VaspErrorHandler - - hdlr: custodian.vasp.handlers.AliasingErrorHandler - - hdlr: custodian.vasp.handlers.MeshSymmetryErrorHandler - - # Specifies a list of error handlers in the same format as jobs. - validators: - - vldr: custodian.vasp.validators.VasprunXMLValidator - - #This sets all custodian running parameters. - custodian_params: - max_errors: 10 - scratch_dir: /tmp - gzipped_output: True - checkpoint: True - -You can then run the job using the following command:: - - cstdn run - -API/Reference Docs -================== - -The API docs are generated using Sphinx auto-doc and outlines the purpose of all -modules and classes, and the expected argument and returned objects for most -methods. They are available at the link below. - -:doc:`custodian API docs ` - -How to cite custodian -===================== - -If you use custodian in your research, especially the VASP component, please -consider citing the following work:: - - Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier, - Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent Chevrier, Kristin A. - Persson, Gerbrand Ceder. *Python Materials Genomics (pymatgen) : A Robust, - Open-Source Python Library for Materials Analysis.* Computational - Materials Science, 2013, 68, 314–319. `doi:10.1016/j.commatsci.2012.10.028 - `_ - -License -======= - -Custodian is released under the MIT License. The terms of the license are as -follows:: - - The MIT License (MIT) - Copyright (c) 2011-2012 MIT & LBNL - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software") - , to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - -.. _`pymatgen's documentation`: http://pymatgen.org -.. _`Materials Project`: https://www.materialsproject.org -.. _`pymatgen`: https://pypi.python.org/pypi/pymatgen diff --git a/docs/_sources/modules.rst.txt b/docs/_sources/modules.rst.txt deleted file mode 100644 index c241b4a4..00000000 --- a/docs/_sources/modules.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -custodian -========= - -.. toctree:: - :maxdepth: 6 - - custodian diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index 92680bf2..584dbda4 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '2019.8.23', + VERSION: '2019.8.24', LANGUAGE: 'None', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', diff --git a/docs/_themes/README.html b/docs/_themes/README.html index 055d525d..5928d650 100644 --- a/docs/_themes/README.html +++ b/docs/_themes/README.html @@ -4,7 +4,7 @@ - krTheme Sphinx Style — custodian 2019.8.23 documentation + krTheme Sphinx Style — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/changelog.html b/docs/changelog.html index 189415cf..62b7875e 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -4,7 +4,7 @@ - Change Log — custodian 2019.8.23 documentation + Change Log — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -48,6 +48,20 @@

    Navigation

    Change Log

    +
    +

    v2019.2.10

    +
      +
    • Improved slow convergence handling. (@shyamd)

    • +
    +
    +
    +

    v2019.2.7

    +
      +
    • Improved error logging.

    • +
    • Improved handling of frozen jobs and potim errors.

    • +
    • Improved Exceptino handling. (Guido Petretto)

    • +
    +

    v2017.12.23

    diff --git a/docs/custodian.cli.html b/docs/custodian.cli.html index adf3c0d0..d9182556 100644 --- a/docs/custodian.cli.html +++ b/docs/custodian.cli.html @@ -4,7 +4,7 @@ - custodian.cli package — custodian 2019.8.23 documentation + custodian.cli package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/custodian.feff.html b/docs/custodian.feff.html index 95900a3a..4f553247 100644 --- a/docs/custodian.feff.html +++ b/docs/custodian.feff.html @@ -4,7 +4,7 @@ - custodian.feff package — custodian 2019.8.23 documentation + custodian.feff package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/custodian.html b/docs/custodian.html index 556c0eb5..2a852731 100644 --- a/docs/custodian.html +++ b/docs/custodian.html @@ -4,7 +4,7 @@ - custodian package — custodian 2019.8.23 documentation + custodian package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/custodian.nwchem.html b/docs/custodian.nwchem.html index a7be0816..599b58e7 100644 --- a/docs/custodian.nwchem.html +++ b/docs/custodian.nwchem.html @@ -4,7 +4,7 @@ - custodian.nwchem package — custodian 2019.8.23 documentation + custodian.nwchem package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/custodian.qchem.html b/docs/custodian.qchem.html index 2695b4fc..d0dd7893 100644 --- a/docs/custodian.qchem.html +++ b/docs/custodian.qchem.html @@ -4,7 +4,7 @@ - custodian.qchem package — custodian 2019.8.23 documentation + custodian.qchem package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -169,7 +169,7 @@

    Submodules

    custodian.qchem.jobs module

    -class QCJob(qchem_command, max_cores, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', suffix='', scratch_dir='/dev/shm/qcscratch/', save_scratch=False, save_name='default_save_name', backup=True)[source]
    +class QCJob(qchem_command, max_cores, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', suffix='', scratch_dir='/Users/shyue/repos/custodian/docs_rst', save_scratch=False, save_name='saved_scratch', backup=True)[source]

    Bases: custodian.custodian.Job

    A basic QChem Job.

    @@ -183,11 +183,11 @@

    Submodules
    -classmethod opt_with_frequency_flattener(qchem_command, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', max_iterations=10, max_molecule_perturb_scale=0.3, check_connectivity=True, **QCJob_kwargs)[source]
    +classmethod opt_with_frequency_flattener(qchem_command, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', max_iterations=10, max_molecule_perturb_scale=0.3, check_connectivity=True, linked=True, **QCJob_kwargs)[source]

    Optimize a structure and calculate vibrational frequencies to check if the structure is in a true minima. If a frequency is negative, iteratively perturbe the geometry, optimize, and recalculate frequencies until all are @@ -258,6 +258,11 @@

    Submodulesperturb_coordinates(old_coords, negative_freq_vecs, molecule_perturb_scale, reversed_direction)[source]

    +
    +
    +vector_list_diff(vecs1, vecs2)[source]
    +
    +

    Module contents

    diff --git a/docs/custodian.vasp.html b/docs/custodian.vasp.html index 6dd1ff3e..dbba1db4 100644 --- a/docs/custodian.vasp.html +++ b/docs/custodian.vasp.html @@ -4,7 +4,7 @@ - custodian.vasp package — custodian 2019.8.23 documentation + custodian.vasp package — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -180,8 +180,12 @@

    Submodulescustodian.custodian.ErrorHandler

    Corrects for total drift exceeding the force convergence criteria.

    Initializes the handler with max drift -:param max_drift: This defines the max drift. Leaving this at the default of None gets the max_drift from EDFIFFG -:type max_drift: float

    +:param max_drift: This defines the max drift. Leaving this at the default of None gets the max_drift from

    +
    +

    EDFIFFG

    +
    +
    +
    check()[source]
    diff --git a/docs/doctrees/_themes/README.doctree b/docs/doctrees/_themes/README.doctree deleted file mode 100644 index 53b24676..00000000 Binary files a/docs/doctrees/_themes/README.doctree and /dev/null differ diff --git a/docs/doctrees/changelog.doctree b/docs/doctrees/changelog.doctree deleted file mode 100644 index a71275e8..00000000 Binary files a/docs/doctrees/changelog.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.ansible.doctree b/docs/doctrees/custodian.ansible.doctree deleted file mode 100644 index 554b5067..00000000 Binary files a/docs/doctrees/custodian.ansible.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.cli.doctree b/docs/doctrees/custodian.cli.doctree deleted file mode 100644 index e73f0444..00000000 Binary files a/docs/doctrees/custodian.cli.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.doctree b/docs/doctrees/custodian.doctree deleted file mode 100644 index edfd3797..00000000 Binary files a/docs/doctrees/custodian.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.feff.doctree b/docs/doctrees/custodian.feff.doctree deleted file mode 100644 index b6839adf..00000000 Binary files a/docs/doctrees/custodian.feff.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.nwchem.doctree b/docs/doctrees/custodian.nwchem.doctree deleted file mode 100644 index c30b69da..00000000 Binary files a/docs/doctrees/custodian.nwchem.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.qchem.doctree b/docs/doctrees/custodian.qchem.doctree deleted file mode 100644 index 53b7fa40..00000000 Binary files a/docs/doctrees/custodian.qchem.doctree and /dev/null differ diff --git a/docs/doctrees/custodian.vasp.doctree b/docs/doctrees/custodian.vasp.doctree deleted file mode 100644 index 10dea8d9..00000000 Binary files a/docs/doctrees/custodian.vasp.doctree and /dev/null differ diff --git a/docs/doctrees/environment.pickle b/docs/doctrees/environment.pickle deleted file mode 100644 index 5e2b9119..00000000 Binary files a/docs/doctrees/environment.pickle and /dev/null differ diff --git a/docs/doctrees/index.doctree b/docs/doctrees/index.doctree deleted file mode 100644 index 29507c70..00000000 Binary files a/docs/doctrees/index.doctree and /dev/null differ diff --git a/docs/doctrees/modules.doctree b/docs/doctrees/modules.doctree deleted file mode 100644 index fa835e4a..00000000 Binary files a/docs/doctrees/modules.doctree and /dev/null differ diff --git a/docs/genindex.html b/docs/genindex.html index 205a265d..573174d9 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -5,7 +5,7 @@ - Index — custodian 2019.8.23 documentation + Index — custodian 2019.8.24 documentation @@ -38,7 +38,7 @@

    Navigation

  • modules |
  • - +

    @@ -684,6 +684,8 @@

    V

  • VaspNpTMDValidator (class in custodian.vasp.validators)
  • VasprunXMLValidator (class in custodian.vasp.validators) +
  • +
  • vector_list_diff() (in module custodian.qchem.jobs)
  • diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo deleted file mode 100644 index e08b88b0..00000000 --- a/docs/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 97de76a622588bfc02d686015cbc7705 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/html/_images/Custodian.png b/docs/html/_images/Custodian.png deleted file mode 100644 index 20e8e690..00000000 Binary files a/docs/html/_images/Custodian.png and /dev/null differ diff --git a/docs/html/_modules/custodian/ansible/actions.html b/docs/html/_modules/custodian/ansible/actions.html deleted file mode 100644 index 59107c84..00000000 --- a/docs/html/_modules/custodian/ansible/actions.html +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - custodian.ansible.actions — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.ansible.actions

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division, print_function
    -import os
    -import shutil
    -
    -"""
    -This module defines various classes of supported actions. All actions are
    -implemented as static methods, but are defined using classes (as opposed to
    -modules) so that a set of well-defined actions can be namespaced easily.
    -"""
    -
    -__author__ = "Shyue Ping Ong"
    -__copyright__ = "Copyright 2012, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__date__ = "Jun 2, 2012"
    -
    -
    -
    [docs]def get_nested_dict(input_dict, key): - current = input_dict - toks = key.split("->") - n = len(toks) - for i, tok in enumerate(toks): - if tok not in current and i < n - 1: - current[tok] = {} - elif i == n - 1: - return current, toks[-1] - current = current[tok]
    - - -
    [docs]class DictActions(object): - """ - Class to implement the supported mongo-like modifications on a dict. - Supported keywords include the following Mongo-based keywords, with the - usual meanings (refer to Mongo documentation for information): - - _inc - _set - _unset - _push - _push_all - _add_to_set (but _each is not supported) - _pop - _pull - _pull_all - _rename - - However, note that "_set" does not support modification of nested dicts - using the mongo {"a.b":1} notation. This is because mongo does not allow - keys with "." to be inserted. Instead, nested dict modification is - supported using a special "->" keyword, e.g. {"a->b": 1} - """ - -
    [docs] @staticmethod - def set(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - d[key] = v
    - -
    [docs] @staticmethod - def unset(input_dict, settings): - for k in settings.keys(): - (d, key) = get_nested_dict(input_dict, k) - del d[key]
    - -
    [docs] @staticmethod - def push(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d: - d[key].append(v) - else: - d[key] = [v]
    - -
    [docs] @staticmethod - def push_all(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d: - d[key].extend(v) - else: - d[key] = v
    - -
    [docs] @staticmethod - def inc(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d: - d[key] += v - else: - d[key] = v
    - -
    [docs] @staticmethod - def rename(input_dict, settings): - for k, v in settings.items(): - if k in input_dict: - input_dict[v] = input_dict[k] - del input_dict[k]
    - -
    [docs] @staticmethod - def add_to_set(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d and (not isinstance(d[key], list)): - raise ValueError("Keyword {} does not refer to an array." - .format(k)) - if key in d and v not in d[key]: - d[key].append(v) - elif key not in d: - d[key] = v
    - -
    [docs] @staticmethod - def pull(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d and (not isinstance(d[key], list)): - raise ValueError("Keyword {} does not refer to an array." - .format(k)) - if key in d: - d[key] = [i for i in d[key] if i != v]
    - -
    [docs] @staticmethod - def pull_all(input_dict, settings): - for k, v in settings.items(): - if k in input_dict and (not isinstance(input_dict[k], list)): - raise ValueError("Keyword {} does not refer to an array." - .format(k)) - for i in v: - DictActions.pull(input_dict, {k: i})
    - -
    [docs] @staticmethod - def pop(input_dict, settings): - for k, v in settings.items(): - (d, key) = get_nested_dict(input_dict, k) - if key in d and (not isinstance(d[key], list)): - raise ValueError("Keyword {} does not refer to an array." - .format(k)) - if v == 1: - d[key].pop() - elif v == -1: - d[key].pop(0)
    - - -
    [docs]class FileActions(object): - """ - Class of supported file actions. For FileActions, the modder class takes in - a filename as a string. The filename should preferably be a full path to - avoid ambiguity. - """ - -
    [docs] @staticmethod - def file_create(filename, settings): - """ - Creates a file. - - Args: - filename (str): Filename. - settings (dict): Must be {"content": actual_content} - """ - if len(settings) != 1: - raise ValueError("Settings must only contain one item with key " - "'content'.") - for k, v in settings.items(): - if k == "content": - with open(filename, 'w') as f: - f.write(v)
    - -
    [docs] @staticmethod - def file_move(filename, settings): - """ - Moves a file. {'_file_move': {'dest': 'new_file_name'}} - - Args: - filename (str): Filename. - settings (dict): Must be {"dest": path of new file} - """ - if len(settings) != 1: - raise ValueError("Settings must only contain one item with key " - "'dest'.") - for k, v in settings.items(): - if k == "dest": - shutil.move(filename, v)
    - -
    [docs] @staticmethod - def file_delete(filename, settings): - """ - Deletes a file. {'_file_delete': {'mode': "actual"}} - - Args: - filename (str): Filename. - settings (dict): Must be {"mode": actual/simulated}. Simulated - mode only prints the action without performing it. - """ - if len(settings) != 1: - raise ValueError("Settings must only contain one item with key " - "'mode'.") - for k, v in settings.items(): - if k == "mode" and v == "actual": - try: - os.remove(filename) - except OSError: - #Skip file not found error. - pass - elif k == "mode" and v == "simulated": - print("Simulated removal of {}".format(filename))
    - -
    [docs] @staticmethod - def file_copy(filename, settings): - """ - Copies a file. {'_file_copy': {'dest': 'new_file_name'}} - - Args: - filename (str): Filename. - settings (dict): Must be {"dest": path of new file} - """ - for k, v in settings.items(): - if k.startswith("dest"): - shutil.copyfile(filename, v)
    - -
    [docs] @staticmethod - def file_modify(filename, settings): - """ - Modifies file access - - Args: - filename (str): Filename. - settings (dict): Can be "mode" or "owners" - """ - for k, v in settings.items(): - if k == "mode": - os.chmod(filename,v) - if k == "owners": - os.chown(filename,v)
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/ansible/interpreter.html b/docs/html/_modules/custodian/ansible/interpreter.html deleted file mode 100644 index 59d22398..00000000 --- a/docs/html/_modules/custodian/ansible/interpreter.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - custodian.ansible.interpreter — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.ansible.interpreter

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -"""
    -This module implements a Modder class that performs modifications on objects
    -using support actions.
    -"""
    -
    -
    -__author__ = "Shyue Ping Ong"
    -__copyright__ = "Copyright 2012, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__date__ = "Jun 1, 2012"
    -
    -
    -import re
    -
    -from custodian.ansible.actions import DictActions
    -
    -
    -
    [docs]class Modder(object): - """ - Class to modify a dict/file/any object using a mongo-like language. - Keywords are mostly adopted from mongo's syntax, but instead of $, an - underscore precedes action keywords. This is so that the modification can - be inserted into a mongo db easily. - - Allowable actions are supplied as a list of classes as an argument. Refer - to the action classes on what the actions do. Action classes are in - pymatpro.ansible.actions. - - Examples: - >>> modder = Modder() - >>> d = {"Hello": "World"} - >>> mod = {'_set': {'Hello':'Universe', 'Bye': 'World'}} - >>> modder.modify(mod, d) - >>> d['Bye'] - 'World' - >>> d['Hello'] - 'Universe' - """ - def __init__(self, actions=None, strict=True): - """ - Initializes a Modder from a list of supported actions. - - Args: - actions ([Action]): A sequence of supported actions. See - :mod:`custodian.ansible.actions`. Default is None, - which means only DictActions are supported. - strict (bool): Indicating whether to use strict mode. In non-strict - mode, unsupported actions are simply ignored without any - errors raised. In strict mode, if an unsupported action is - supplied, a ValueError is raised. Defaults to True. - """ - self.supported_actions = {} - actions = actions if actions is not None else [DictActions] - for action in actions: - for i in dir(action): - if (not re.match('__\w+__', i)) and \ - callable(getattr(action, i)): - self.supported_actions["_" + i] = getattr(action, i) - self.strict = strict - -
    [docs] def modify(self, modification, obj): - """ - Note that modify makes actual in-place modifications. It does not - return a copy. - - Args: - modification (dict): Modification must be {action_keyword : - settings}. E.g., {'_set': {'Hello':'Universe', 'Bye': 'World'}} - obj (dict/str/object): Object to modify depending on actions. For - example, for DictActions, obj will be a dict to be modified. - For FileActions, obj will be a string with a full pathname to a - file. - """ - for action, settings in modification.items(): - if action in self.supported_actions: - self.supported_actions[action].__call__(obj, settings) - elif self.strict: - raise ValueError("{} is not a supported action!" - .format(action))
    - -
    [docs] def modify_object(self, modification, obj): - """ - Modify an object that supports pymatgen's as_dict() and from_dict API. - - Args: - modification (dict): Modification must be {action_keyword : - settings}. E.g., {'_set': {'Hello':'Universe', 'Bye': 'World'}} - obj (object): Object to modify - """ - d = obj.as_dict() - self.modify(modification, d) - return obj.from_dict(d)
    - - -if __name__ == "__main__": - import doctest - doctest.testmod() -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/cli/converge_geometry.html b/docs/html/_modules/custodian/cli/converge_geometry.html deleted file mode 100644 index f59e341c..00000000 --- a/docs/html/_modules/custodian/cli/converge_geometry.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - custodian.cli.converge_geometry — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.cli.converge_geometry

    -#!/usr/bin/env python
    -
    -"""
    -This is a script to converge the geometry of a system
    -"""
    -
    -from __future__ import division
    -
    -__author__ = "Stephen Dacek"
    -__version__ = "0.1"
    -__maintainer__ = "Stephen Dacek"
    -__email__ = "sdacek@mit.edu"
    -__status__ = "Beta"
    -__date__ = "11/3/13"
    -
    -import logging
    -
    -from custodian.custodian import Custodian
    -from custodian.vasp.handlers import VaspErrorHandler, UnconvergedErrorHandler, \
    -    MeshSymmetryErrorHandler, NonConvergingErrorHandler, PotimErrorHandler
    -from custodian.vasp.jobs import VaspJob
    -from pymatgen.io.vasp.outputs import Vasprun
    -
    -
    -FORMAT = '%(asctime)s %(message)s'
    -logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log")
    -
    -
    -
    [docs]def get_runs(args): - - vasp_command = args.command.split() - converged = False - job_number = 0 - - while (not converged) and (job_number < args.max_relax): - - suffix = ".{}{}".format('relax', job_number + 1) - - if job_number == 0: - backup = True - #assume the initial guess is poor, - #start with conjugate gradients - settings = [ - {"dict": "INCAR", - "action": {"_set": {"IBRION": 2}}} - ] - - else: - backup = False - v = Vasprun("vasprun.xml") - - if len(v.ionic_steps) == 1: - converged = True - - if job_number < 2 and not converged: - - settings = [ - {"dict": "INCAR", - "action": {"_set": {"ISTART": 1}}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - - #switch to RMM-DIIS once we are near the - #local minimum (assumed after 2 runs of CG) - else: - settings = [ - {"dict": "INCAR", - "action": {"_set": {"ISTART": 1, "IBRION": 1}}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - - job_number += 1 - yield VaspJob(vasp_command, final=converged, backup=backup, - suffix=suffix, settings_override=settings)
    - - -
    [docs]def do_run(args): - handlers = [VaspErrorHandler(), MeshSymmetryErrorHandler(), - UnconvergedErrorHandler(), NonConvergingErrorHandler(), - PotimErrorHandler()] - c = Custodian(handlers, get_runs(args), max_errors=10, gzipped_output=args.gzip) - c.run() - logging.info("Geometry optimization complete")
    - - -if __name__ == "__main__": - import argparse - - parser = argparse.ArgumentParser(description=""" - converge_geometry performs a geometry optimization. What this script will do - is run a particular VASP relaxation repeatedly until the geometry - is converged within the first ionic step. This is a common practice for - converging molecular geometries in VASP, especially in situations where - the geometry needs to be precise: such as frequency calculations. - """, - epilog=""" - Author: Stephen Dacek - Version: {} - Last updated: {}""".format(__version__, __date__)) - - parser.add_argument( - "-c", "--command", dest="command", nargs="?", - default="pvasp", type=str, - help="VASP command. Defaults to pvasp. If you are using mpirun, " - "set this to something like \"mpirun pvasp\".", ) - - parser.add_argument( - "-z", "--gzip", dest="gzip", action="store_true", - help="Add this option to gzip the final output. Do not gzip if you " - "are going to perform an additional static run.") - - parser.add_argument( - "-mr", "--max_relaxtions", dest="max_relax", - default=10, type=int, - help="Maximum number of relaxations to allow") - - args = parser.parse_args() - do_run(args) -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/cli/converge_kpoints.html b/docs/html/_modules/custodian/cli/converge_kpoints.html deleted file mode 100644 index b13a54bf..00000000 --- a/docs/html/_modules/custodian/cli/converge_kpoints.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - custodian.cli.converge_kpoints — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.cli.converge_kpoints

    -#!/usr/bin/env python
    -
    -"""
    -This is a master vasp running script to perform variuos combinations of VASP
    -runs.
    -"""
    -
    -from __future__ import division
    -
    -__author__ = "shyuepingong"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "shyuep@gmail.com"
    -__status__ = "Beta"
    -__date__ = "2/4/13"
    -
    -import logging
    -
    -from custodian.custodian import Custodian
    -from custodian.vasp.handlers import VaspErrorHandler, \
    -    UnconvergedErrorHandler
    -from custodian.vasp.jobs import VaspJob
    -from pymatgen.io.vasp import VaspInput, Vasprun
    -
    -
    -FORMAT = '%(asctime)s %(message)s'
    -logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log")
    -
    -
    -
    [docs]def get_runs(vasp_command, target=1e-3, max_steps=10, mode="linear"): - energy = 0 - vinput = VaspInput.from_directory(".") - kpoints = vinput["KPOINTS"].kpts[0] - for i in range(max_steps): - if mode == "linear": - m = [k * (i + 1) for k in kpoints] - else: - m = [k + 1 for k in kpoints] - if i == 0: - settings = None - backup = True - else: - backup = False - v = Vasprun("vasprun.xml") - e_per_atom = v.final_energy / len(v.final_structure) - ediff = abs(e_per_atom - energy) - if ediff < target: - logging.info("Converged to {} eV/atom!".format(ediff)) - break - else: - energy = e_per_atom - settings = [ - {"dict": "INCAR", - "action": {"_set": {"ISTART": 1}}}, - {'dict': 'KPOINTS', - 'action': {'_set': {'kpoints': [m]}}}, - {"filename": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - yield VaspJob(vasp_command, final=False, backup=backup, - suffix=".kpoints.{}".format("x".join(map(str, m))), - settings_override=settings)
    - - -
    [docs]def do_run(args): - handlers = [VaspErrorHandler(), UnconvergedErrorHandler()] - c = Custodian(handlers, get_runs(vasp_command=args.command.split(), - target=args.target, mode=args.mode, - max_steps=args.max_steps), - max_errors=10) - c.run()
    - - -
    [docs]def main(): - import argparse - parser = argparse.ArgumentParser(description=""" - converge_kpoints perform a KPOINTS convergence. What this script will do - is to run a particular VASP run with increasing multiples of the initial - KPOINT grid until a target convergence in energy per atom is reached. - For example, let's say you have vasp input files that has a k-point grid - of 1x1x1. This script will perform sequence jobs with k-point grids of - 1x1x1, 2x2x2, 3x3x3, 4x4x4, ... until convergence is achieved. The - default convergence criteria is 1meV/atom, but this can be set using the - --target option. - """, - epilog=""" - Author: Shyue Ping Ong - Version: {} - Last updated: {}""".format(__version__, __date__)) - - parser.add_argument( - "-c", "--command", dest="command", nargs="?", - default="pvasp", type=str, - help="VASP command. Defaults to pvasp. If you are using mpirun, " - "set this to something like \"mpirun pvasp\".") - - parser.add_argument( - "-i", "--increment_mode", dest="mode", nargs="?", - default="linear", type=str, choices=["linear", "inc"], - help="Mode for increasing kpoints. In linear mode, multiples of " - "the existing kpoints are done. E.g., 2x4x2 -> 4x8x4 -> 6x12x6. " - "In inc mode, all KPOINTS are incremented by 1 at each stage, " - "i.e., 2x4x2 -> 3x5x3 ->4x6x4. Note that the latter mode does " - "not preserve KPOINTS symmetry, though it is probably less " - "expensive.") - - parser.add_argument( - "-m", "--max_steps", dest="max_steps", nargs="?", - default=10, type=int, - help="The maximum number of KPOINTS increment steps. This puts an " - "upper bound on the largest KPOINT converge grid attempted.") - - parser.add_argument( - "-t", "--target", dest="target", nargs="?", - default=0.001, type=float, - help="The target converge in energy per atom to achieve " - "convergence. E.g., 1e-3 means the KPOINTS will be increased " - "until a converged of 1meV is reached." - ) - - args = parser.parse_args() - do_run(args)
    - - -if __name__ == "__main__": - main() -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/cli/cstdn.html b/docs/html/_modules/custodian/cli/cstdn.html deleted file mode 100644 index d661e4cb..00000000 --- a/docs/html/_modules/custodian/cli/cstdn.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - custodian.cli.cstdn — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.cli.cstdn

    -#!/usr/bin/env python
    -# Copyright (c) Materials Virtual Lab.
    -# Distributed under the terms of the BSD License.
    -
    -from __future__ import division, unicode_literals, print_function
    -
    -import argparse
    -
    -import sys
    -from monty.serialization import loadfn
    -
    -from custodian.custodian import Custodian
    -import logging
    -
    -
    -example_yaml = """
    -# This is an example of a Custodian yaml spec file. It shows how you can specify
    -# a double relaxation followed by a static calculation. Minor modifications
    -# would allow very customizable calculations, though this is obviously not meant
    -# for highly complex workflows. For those, you will need to code and usage of
    -# FireWorks is highly recommended.
    -
    -
    -# Specifies a list of jobs to run.
    -# Each job is specified by a `jb: <full class path>` with parameters specified
    -# via the params dict.
    -
    -jobs:
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: False
    -    suffix: .relax1
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: False
    -    suffix: .relax2
    -    settings_override:
    -    - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: True
    -    suffix: .static3
    -    settings_override:
    -    - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}
    -    - {"dict": "INCAR", "action": {"_set": {"NSW": 0}}}
    -
    -
    -# This key specifies parameters common to all jobs.
    -# Keys starting with $ are expanded to the environmental values.
    -# The example below means the parameter vasp_cmd is set to the value with
    -# $PBS_NODEFILE expanded.
    -
    -jobs_common_params:
    -  $vasp_cmd: ["mpirun", "-machinefile", "$PBS_NODEFILE", "-np", "24", "vasp"]
    -
    -
    -# Specifies a list of error handlers in the same format as jobs.
    -handlers:
    -- hdlr: custodian.vasp.handlers.VaspErrorHandler
    -- hdlr: custodian.vasp.handlers.AliasingErrorHandler
    -- hdlr: custodian.vasp.handlers.MeshSymmetryErrorHandler
    -
    -
    -# Specifies a list of error handlers in the same format as jobs.
    -validators:
    -- vldr: custodian.vasp.validators.VasprunXMLValidator
    -
    -
    -#This sets all custodian running parameters.
    -custodian_params:
    -  max_errors: 10
    -  scratch_dir: /tmp
    -  gzipped_output: True
    -  checkpoint: True
    -"""
    -
    -
    -
    [docs]def run(args): - FORMAT = '%(asctime)s %(message)s' - logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log") - logging.info("Spec file is %s" % args.spec_file) - d = loadfn(args.spec_file[0]) - c = Custodian.from_spec(d) - c.run()
    - - - - - -
    [docs]def main(): - parser = argparse.ArgumentParser(description=""" - cstdn is a convenient script to run custodian style jobs using a - simple YAML spec.""", epilog="""Author: Shyue Ping Ong""") - - subparsers = parser.add_subparsers() - - prun = subparsers.add_parser("run", help="Run custodian.") - prun.add_argument("spec_file", metavar="spec_file", type=str, nargs=1, - help="YAML/JSON spec file.") - prun.set_defaults(func=run) - - prun = subparsers.add_parser( - "example", help="Print examples. Right now, there is only one example for VASP double relaxation.") - prun.set_defaults(func=print_example) - - args = parser.parse_args() - - try: - a = getattr(args, "func") - except AttributeError: - parser.print_help() - sys.exit(0) - args.func(args)
    - - -if __name__ == "__main__": - main() -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/cli/run_nwchem.html b/docs/html/_modules/custodian/cli/run_nwchem.html deleted file mode 100644 index c8c0de23..00000000 --- a/docs/html/_modules/custodian/cli/run_nwchem.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - custodian.cli.run_nwchem — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.cli.run_nwchem

    -#!/usr/bin/env python
    -
    -"""
    -Basic script to run nwchem job.
    -"""
    -
    -from __future__ import division
    -
    -__author__ = "shyuepingong"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "shyuep@gmail.com"
    -__status__ = "Beta"
    -__date__ = "6/18/13"
    -
    -
    -import logging
    -
    -from custodian.custodian import Custodian
    -from custodian.nwchem.handlers import NwchemErrorHandler
    -from custodian.nwchem.jobs import NwchemJob
    -
    -
    -
    [docs]def do_run(args): - logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO, - filename="run.log") - job = NwchemJob(nwchem_cmd=args.command.split(), - input_file=args.infile, - output_file=args.outfile) - c = Custodian([NwchemErrorHandler(output_filename=args.outfile)], [job], - max_errors=5, scratch_dir=args.scratch, - gzipped_output=args.gzipped, checkpoint=True) - c.run()
    - - -
    [docs]def main(): - import argparse - parser = argparse.ArgumentParser(description=""" - run_nwchem is a master script to perform various kinds of Nwchem runs. - """, - epilog=""" - Author: Shyue Ping Ong - Version: {} - Last updated: {}""".format(__version__, __date__)) - - parser.add_argument( - "-c", "--command", dest="command", nargs="?", - default="nwchem", type=str, - help="Nwchem command. Defaults to nwchem. If you are using mpirun, " - "set this to something like \"mpirun nwchem\".") - - parser.add_argument( - "-s", "--scratch", dest="scratch", nargs="?", - default=None, type=str, - help="Scratch directory to perform run in. Specify the root scratch " - "directory as the code will automatically create a temporary " - "subdirectory to run the job.") - - parser.add_argument( - "-i", "--infile", dest="infile", nargs="?", default="mol.nw", - type=str, help="Input filename.") - - parser.add_argument( - "-o", "--output", dest="outfile", nargs="?", default="mol.nwout", - type=str, help="Output filename." - ) - - parser.add_argument( - "-z", "--gzip", dest="gzip", action="store_true", - help="Add this option to gzip the final output. Do not gzip if you " - "are going to perform an additional static run." - ) - - args = parser.parse_args() - do_run(args)
    - - -if __name__ == "__main__": - main() -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/cli/run_vasp.html b/docs/html/_modules/custodian/cli/run_vasp.html deleted file mode 100644 index 04d5fd63..00000000 --- a/docs/html/_modules/custodian/cli/run_vasp.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - - custodian.cli.run_vasp — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.cli.run_vasp

    -#!/usr/bin/env python
    -
    -"""
    -This is a master vasp running script to perform various combinations of VASP
    -runs.
    -"""
    -
    -from __future__ import division
    -
    -import logging
    -import sys
    -import ruamel.yaml as yaml
    -
    -from custodian.custodian import Custodian
    -from custodian.vasp.jobs import VaspJob
    -from pymatgen.io.vasp import VaspInput, Incar, Kpoints
    -
    -__author__ = "Shyue Ping Ong"
    -__version__ = "0.5"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__status__ = "Beta"
    -__date__ = "12/31/13"
    -
    -
    -
    [docs]def load_class(mod, name): - toks = name.split("?") - params = {} - if len(toks) == 2: - for p in toks[-1].split(","): - ptoks = p.split("=") - params[ptoks[0]] = yaml.safe_load(ptoks[1]) - elif len(toks) > 2: - print("Bad handler specification") - sys.exit(-1) - mod = __import__(mod, globals(), locals(), [toks[0]], 0) - return getattr(mod, toks[0])(**params)
    - - -
    [docs]def get_jobs(args): - # Returns a generator of jobs. Allows of "infinite" jobs. - vasp_command = args.command.split() - # save initial INCAR for rampU runs - n_ramp_u = args.jobs.count('rampU') - ramps = 0 - if n_ramp_u: - incar = Incar.from_file('INCAR') - ldauu = incar['LDAUU'] - ldauj = incar['LDAUJ'] - - njobs = len(args.jobs) - post_settings = [] # append to this list to have settings applied on next job - for i, job in enumerate(args.jobs): - final = False if i != njobs - 1 else True - if any(c.isdigit() for c in job): - suffix = "." + job - else: - suffix = ".{}{}".format(job, i + 1) - settings = post_settings - post_settings = [] - backup = True if i == 0 else False - copy_magmom = False - vinput = VaspInput.from_directory(".") - if i > 0: - settings.append( - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}) - - job_type = job.lower() - auto_npar = True - - if args.no_auto_npar: - auto_npar = False - - if job_type.startswith("static_derived"): - from pymatgen.io.vasp.sets import MPStaticSet - vis = MPStaticSet.from_prev_calc( - ".", user_incar_settings={"LWAVE": True, "EDIFF": 1e-6}, - ediff_per_atom=False) - settings.extend([ - {"dict" : "INCAR", - "action": {"_set": dict(vis.incar)}}, - {'dict': 'KPOINTS', - 'action': {'_set': vis.kpoints.as_dict()}}]) - - if job_type.startswith("static_dielectric_derived"): - from pymatgen.io.vasp.sets import MPStaticSet, MPStaticDielectricDFPTVaspInputSet - - # vis = MPStaticSet.from_prev_calc( - # ".", user_incar_settings={"EDIFF": 1e-6, "IBRION": 8, - # "LEPSILON": True, 'LREAL':False, - # "LPEAD": True, "ISMEAR": 0, - # "SIGMA": 0.01}, - # ediff_per_atom=False) - vis = MPStaticDielectricDFPTVaspInputSet() - incar = vis.get_incar(vinput["POSCAR"].structure) - unset = {} - for k in ["NPAR", "KPOINT_BSE", "LAECHG", "LCHARG", "LVHAR", - "NSW"]: - incar.pop(k, None) - if k in vinput["INCAR"]: - unset[k] = 1 - kpoints = vis.get_kpoints(vinput["POSCAR"].structure) - settings.extend([ - {"dict": "INCAR", - "action": {"_set": dict(incar), - "_unset": unset}}, - {'dict': 'KPOINTS', - 'action': {'_set': kpoints.as_dict()}}]) - auto_npar = False - elif job_type.startswith("static"): - m = [i * args.static_kpoint for i in vinput["KPOINTS"].kpts[0]] - settings.extend([ - {"dict": "INCAR", - "action": {"_set": {"NSW": 0}}}, - {'dict': 'KPOINTS', - 'action': {'_set': {'kpoints': [m]}}}]) - - elif job_type.startswith("nonscf_derived"): - from pymatgen.io.vasp.sets import MPNonSCFSet - vis = MPNonSCFSet.from_prev_calc(".", copy_chgcar=False, - user_incar_settings={"LWAVE": True}) - settings.extend([ - {"dict": "INCAR", - "action": {"_set": dict(vis.incar)}}, - {'dict': 'KPOINTS', - 'action': {'_set': vis.kpoints.as_dict()}}]) - - elif job_type.startswith("optics_derived"): - from pymatgen.io.vasp.sets import MPNonSCFSet - vis = MPNonSCFSet.from_prev_calc( - ".", optics=True, copy_chgcar=False, - nedos=2001, mode="uniform", nbands_factor=5, - user_incar_settings={"LWAVE": True, "ALGO": "Exact", "SIGMA": 0.01, "EDIFF": 1e-6}, - ediff_per_atom=False) - settings.extend([ - {"dict": "INCAR", - "action": {"_set": dict(vis.incar)}}, - {'dict': 'KPOINTS', - 'action': {'_set': vis.kpoints.as_dict()}}]) - - elif job_type.startswith("rampu"): - f = ramps / (n_ramp_u - 1) - settings.append( - {"dict": "INCAR", - "action": {"_set": {"LDAUJ": [j * f for j in ldauj], - "LDAUU": [u * f for u in ldauu]}}}) - copy_magmom = True - ramps += 1 - elif job_type.startswith("quick_relax") or job_type.startswith(\ - "quickrelax"): - kpoints = vinput["KPOINTS"] - incar = vinput["INCAR"] - structure = vinput["POSCAR"].structure - if "ISMEAR" in incar: - post_settings.append( - {"dict": "INCAR", - "action": {"_set": {"ISMEAR": incar["ISMEAR"]}}}) - else: - post_settings.append( - {"dict": "INCAR", - "action": {"_unset": {"ISMEAR": 1}}}) - post_settings.append({"dict": "KPOINTS", - "action": {"_set": kpoints.as_dict()}}) - # lattice vectors with length < 9 will get >1 KPOINT - low_kpoints = Kpoints.gamma_automatic( - [max(int(18/l), 1) for l in structure.lattice.abc]) - settings.extend([ - {"dict": "INCAR", - "action": {"_set": {"ISMEAR": 0}}}, - {'dict': 'KPOINTS', - 'action': {'_set': low_kpoints.as_dict()}}]) - - # let vasp determine encut (will be lower than - # needed for compatibility with other runs) - if "ENCUT" in incar: - post_settings.append( - {"dict": "INCAR", - "action": {"_set": {"ENCUT": incar["ENCUT"]}}}) - settings.append( - {"dict": "INCAR", - "action": {"_unset": {"ENCUT": 1}}}) - - elif job_type.startswith("relax"): - pass - elif job_type.startswith("full_relax"): - for j in VaspJob.full_opt_run( - vasp_command): - yield j - else: - print("Unsupported job type: {}".format(job)) - sys.exit(-1) - - if not job_type.startswith("full_relax"): - yield VaspJob(vasp_command, final=final, suffix=suffix, - backup=backup, settings_override=settings, - copy_magmom=copy_magmom, auto_npar=auto_npar)
    - - -
    [docs]def do_run(args): - FORMAT = '%(asctime)s %(message)s' - logging.basicConfig(format=FORMAT, level=logging.INFO, filename="run.log") - logging.info("Handlers used are %s" % args.handlers) - handlers = [load_class("custodian.vasp.handlers", n) for n in - args.handlers] - validators = [load_class("custodian.vasp.validators", n) for n in - args.validators] - - c = Custodian(handlers, get_jobs(args), validators, - max_errors=args.max_errors, scratch_dir=args.scratch, - gzipped_output=args.gzip, - checkpoint=True) - c.run()
    - - -
    [docs]def main(): - import argparse - parser = argparse.ArgumentParser(description=""" - run_vasp is a master script to perform various kinds of VASP runs. - """, - epilog=""" - Author: Shyue Ping Ong - Version: {} - Last updated: {}""".format(__version__, __date__)) - - parser.add_argument( - "-c", "--command", dest="command", nargs="?", - default="pvasp", type=str, - help="VASP command. Defaults to pvasp. If you are using mpirun, " - "set this to something like \"mpirun pvasp\".") - - parser.add_argument( - "--no_auto_npar", action="store_true", - help="Set to true to turn off auto_npar. Useful for certain machines " - "and calculations where you want absolute control.") - - - parser.add_argument( - "-z", "--gzip", dest="gzip", action="store_true", - help="Add this option to gzip the final output. Do not gzip if you " - "are going to perform an additional static run." - ) - - parser.add_argument( - "-s", "--scratch", dest="scratch", nargs="?", - default=None, type=str, - help="Scratch directory to perform run in. Specify the root scratch " - "directory as the code will automatically create a temporary " - "subdirectory to run the job.") - - parser.add_argument( - "-ks", "--kpoint-static", dest="static_kpoint", nargs="?", - default=1, type=int, - help="The multiplier to use for the KPOINTS of a static run (if " - "any). For example, setting this to 2 means that if your " - "original run was done using a k-point grid of 2x3x3, " - "the static run will be done with a k-point grid of 4x6x6. This " - "defaults to 1, i.e., static runs are performed with the same " - "k-point grid as relaxation runs." - ) - - parser.add_argument( - "-me", "--max-errors", dest="max_errors", nargs="?", - default=10, type=int, - help="Maximum number of errors to allow before quitting") - - parser.add_argument( - "-hd", "--handlers", dest="handlers", nargs="+", - default=["VaspErrorHandler", "MeshSymmetryErrorHandler", - "UnconvergedErrorHandler", "NonConvergingErrorHandler", - "PotimErrorHandler"], type=str, - help="The ErrorHandlers to use specified as string class names, " - "with optional arguments specified as a url-like string. For " - "example, VaspErrorHandler?output_filename=myfile.out specifies a " - "VaspErrorHandler with output_name set to myfile.out. Multiple " - "arguments are joined by a comma. E.g., MyHandler?myfile=a," - "data=1. The arguments are deserialized using yaml." - ) - - parser.add_argument( - "-vd", "--validators", dest="validators", nargs="+", - default=["VasprunXMLValidator"], type=str, - help="The Validators to use specified as string class names, " - "with optional arguments specified as a url-like string. For " - "example, VaspErrorHandler?output_filename=myfile.out specifies a " - "VaspErrorHandler with output_name set to myfile.out. Multiple " - "arguments are joined by a comma. E.g., MyHandler?myfile=a," - "data=1. The arguments are deserialized using yaml." - ) - - parser.add_argument( - "jobs", metavar="jobs", type=str, nargs='+', - default=["relax", "relax"], - help="Jobs to execute. Only sequences of relax, " - "quickrelax, static, rampU, full_relax, static_derived, " - "nonscf_derived, optics_derived are " - "supported at the moment. For example, \"relax relax static\" " - "will run a double relaxation followed by a static " - "run. By default, suffixes are given sequential numbering," - "but this can be overrridden by adding a number to the job" - "type, e.g. relax5 relax6 relax7") - - args = parser.parse_args() - do_run(args)
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/custodian.html b/docs/html/_modules/custodian/custodian.html deleted file mode 100644 index 0aa53828..00000000 --- a/docs/html/_modules/custodian/custodian.html +++ /dev/null @@ -1,1060 +0,0 @@ - - - - - - - custodian.custodian — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.custodian

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -import logging
    -import subprocess
    -import sys
    -import datetime
    -import time
    -from glob import glob
    -import tarfile
    -import os
    -from abc import ABCMeta, abstractmethod
    -from itertools import islice
    -import warnings
    -from pprint import pformat
    -from ast import literal_eval
    -
    -import six
    -
    -from .utils import get_execution_host_info
    -
    -from monty.tempfile import ScratchDir
    -from monty.shutil import gzip_dir
    -from monty.json import MSONable, MontyEncoder, MontyDecoder
    -from monty.serialization import loadfn, dumpfn
    -
    -"""
    -This module implements the main Custodian class, which manages a list of jobs
    -given a set of error handlers, the abstract base classes for the
    -ErrorHandlers and Jobs.
    -"""
    -
    -__author__ = "Shyue Ping Ong, William Davidson Richards"
    -__copyright__ = "Copyright 2012, The Materials Project"
    -__version__ = "0.2"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__date__ = "Sep 17 2014"
    -
    -
    -logger = logging.getLogger(__name__)
    -
    -if "SENTRY_DSN" in os.environ:
    -    # Sentry.io is a service to aggregate logs remotely, this is useful
    -    # for Custodian to get statistics on which errors are most common.
    -    # If you do not have a SENTRY_DSN environment variable set, Sentry
    -    # will not be used.
    -
    -    import sentry_sdk
    -    sentry_sdk.init(dsn=os.environ["SENTRY_DSN"])
    -    
    -    with sentry_sdk.configure_scope() as scope:
    -        
    -        from getpass import getuser
    -        try:
    -            scope.user = {"username": getuser()}
    -        except:
    -            pass
    -            
    -
    -
    -# Sentry.io is a service to aggregate logs remotely, this is useful
    -# for Custodian to get statistics on which errors are most common.
    -# If you do not have a SENTRY_DSN environment variable set, or do
    -# not have CUSTODIAN_ERROR_REPORTING_OPT_IN set to True, then
    -# Sentry will not be enabled.
    -
    -SENTRY_DSN = None
    -if "SENTRY_DSN" in os.environ:
    -    SENTRY_DSN = os.environ["SENTRY_DSN"]
    -elif "CUSTODIAN_REPORTING_OPT_IN" in os.environ:
    -    # check for environment variable to automatically set SENTRY_DSN
    -    # will set for True, true, TRUE, etc.
    -    if literal_eval(os.environ.get("CUSTODIAN_REPORTING_OPT_IN", "False").title()):
    -        SENTRY_DSN = "https://0f7291738eb042a3af671df9fc68ae2a@sentry.io/1470881"
    -
    -if SENTRY_DSN:
    -
    -    import sentry_sdk
    -    sentry_sdk.init(dsn=SENTRY_DSN)
    -    
    -    with sentry_sdk.configure_scope() as scope:
    -        
    -        from getpass import getuser
    -        try:
    -            scope.user = {"username": getuser()}
    -        except:
    -            pass
    -        
    -        import socket
    -        scope.set_tag("hostname", socket.gethostname())
    -
    -
    -
    [docs]class Custodian(object): - """ - The Custodian class is the manager for a list of jobs given a list of - error handlers. The way it works is as follows: - - 1. Let's say you have defined a list of jobs as [job1, job2, job3, ...] and - you have defined a list of possible error handlers as [err1, err2, ...] - 2. Custodian will run the jobs in the order of job1, job2, ... During each - job, custodian will monitor for errors using the handlers that have - is_monitor == True. If an error is detected, corrective measures are - taken and the particular job is rerun. - 3. At the end of each individual job, Custodian will run through the list - error handlers that have is_monitor == False. If an error is detected, - corrective measures are taken and the particular job is rerun. - - .. attribute: max_errors - - Maximum number of errors allowed. - - .. attribute: handlers - - All error handlers (including monitors). All error handlers are used - to check for errors at the end of a run. - - .. attribute: monitors - - Error handlers that are Monitors, i.e., handlers that monitors a job - as it is being run. - - .. attribute: polling_time_step - - The length of time in seconds between steps in which a job is - checked for completion. - - .. attribute: monitor_freq - - The number of polling steps before monitoring occurs. For example, - if you have a polling_time_step of 10 seconds and a monitor_freq of - 30, this means that Custodian uses the monitors to check for errors - every 30 x 10 = 300 seconds, i.e., 5 minutes. - """ - LOG_FILE = "custodian.json" - - def __init__(self, handlers, jobs, validators=None, - max_errors_per_job=None, - max_errors=1, polling_time_step=10, monitor_freq=30, - skip_over_errors=False, scratch_dir=None, - gzipped_output=False, checkpoint=False, terminate_func=None, - terminate_on_nonzero_returncode=True): - """ - Initializes a Custodian from a list of jobs and error handler.s - - Args: - handlers ([ErrorHandler]): Error handlers. In order of priority of - fixing. - jobs ([Job]): Sequence of Jobs to be run. Note that this can be - any sequence or even a generator yielding jobs. - validators([Validator]): Validators to ensure job success - max_errors_per_job (int): Maximum number of errors per job allowed - before exiting. Defaults to None, which means it is set to be - equal to max_errors.. - max_errors (int): Maximum number of total errors allowed before - exiting. Defaults to 1. - polling_time_step (int): The length of time in seconds between - steps in which a job is checked for completion. Defaults to - 10 secs. - monitor_freq (int): The number of polling steps before monitoring - occurs. For example, if you have a polling_time_step of 10 - seconds and a monitor_freq of 30, this means that Custodian - uses the monitors to check for errors every 30 x 10 = 300 - seconds, i.e., 5 minutes. - skip_over_errors (bool): If set to True, custodian will skip over - error handlers that failed (raised an Exception of some sort). - Otherwise, custodian will simply exit on unrecoverable errors. - The former will lead to potentially more robust performance, - but may make it difficult to improve handlers. The latter - will allow one to catch potentially bad error handler - implementations. Defaults to False. - scratch_dir (str): If this is set, any files in the current - directory are copied to a temporary directory in a scratch - space first before any jobs are performed, and moved back to - the current directory upon completion of all jobs. This is - useful in some setups where a scratch partition has much - faster IO. To use this, set scratch_dir=root of directory you - want to use for runs. There is no need to provide unique - directory names; we will use python's tempfile creation - mechanisms. A symbolic link is created during the course of - the run in the working directory called "scratch_link" as - users may want to sometimes check the output during the - course of a run. If this is None (the default), the run is - performed in the current working directory. - gzipped_output (bool): Whether to gzip the final output to save - space. Defaults to False. - checkpoint (bool): Whether to checkpoint after each successful Job. - Checkpoints are stored as custodian.chk.#.tar.gz files. Defaults - to False. - terminate_func (callable): A function to be called to terminate a - running job. If None, the default is to call Popen.terminate. - terminate_on_nonzero_returncode (bool): If True, a non-zero return - code on any Job will result in a termination. Defaults to True. - """ - self.max_errors = max_errors - self.max_errors_per_job = max_errors_per_job or max_errors - self.jobs = jobs - self.handlers = handlers - self.validators = validators or [] - self.monitors = [h for h in handlers if h.is_monitor] - self.polling_time_step = polling_time_step - self.monitor_freq = monitor_freq - self.skip_over_errors = skip_over_errors - self.scratch_dir = scratch_dir - self.gzipped_output = gzipped_output - self.checkpoint = checkpoint - cwd = os.getcwd() - if self.checkpoint: - self.restart, self.run_log = Custodian._load_checkpoint(cwd) - else: - self.restart = 0 - self.run_log = [] - self.errors_current_job = 0 - self.total_errors = 0 - self.terminate_func = terminate_func - self.terminate_on_nonzero_returncode = terminate_on_nonzero_returncode - self.finished = False - - @staticmethod - def _load_checkpoint(cwd): - restart = 0 - run_log = [] - chkpts = glob(os.path.join(cwd, "custodian.chk.*.tar.gz")) - if chkpts: - chkpt = sorted(chkpts, key=lambda c: int(c.split(".")[-3]))[0] - restart = int(chkpt.split(".")[-3]) - logger.info("Loading from checkpoint file {}...".format(chkpt)) - t = tarfile.open(chkpt) - t.extractall() - # Log the corrections to a json file. - run_log = loadfn(Custodian.LOG_FILE, cls=MontyDecoder) - - return restart, run_log - - @staticmethod - def _delete_checkpoints(cwd): - for f in glob(os.path.join(cwd, "custodian.chk.*.tar.gz")): - os.remove(f) - - @staticmethod - def _save_checkpoint(cwd, index): - try: - Custodian._delete_checkpoints(cwd) - n = os.path.join(cwd, "custodian.chk.{}.tar.gz".format(index)) - with tarfile.open(n, mode="w:gz", compresslevel=3) as f: - f.add(cwd, arcname='.') - logger.info("Checkpoint written to {}".format(n)) - except Exception as ex: - logger.info("Checkpointing failed") - import traceback - logger.error(traceback.format_exc()) - -
    [docs] @classmethod - def from_spec(cls, spec): - """ - Load a Custodian instance where the jobs are specified from a - structure and a spec dict. This allows simple - custom job sequences to be constructed quickly via a YAML file. - - Args: - spec (dict): A dict specifying job. A sample of the dict in - YAML format for the usual MP workflow is given as follows - - ``` - jobs: - - jb: custodian.vasp.jobs.VaspJob - params: - final: False - suffix: .relax1 - - jb: custodian.vasp.jobs.VaspJob - params: - final: True - suffix: .relax2 - settings_override: {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}} - jobs_common_params: - vasp_cmd: /opt/vasp - handlers: - - hdlr: custodian.vasp.handlers.VaspErrorHandler - - hdlr: custodian.vasp.handlers.AliasingErrorHandler - - hdlr: custodian.vasp.handlers.MeshSymmetryHandler - validators: - - vldr: custodian.vasp.validators.VasprunXMLValidator - custodian_params: - scratch_dir: /tmp - ``` - - The `jobs` key is a list of jobs. Each job is - specified via "job": <explicit path>, and all parameters are - specified via `params` which is a dict. - - `common_params` specify a common set of parameters that are - passed to all jobs, e.g., vasp_cmd. - - Returns: - Custodian instance. - """ - - dec = MontyDecoder() - - def load_class(dotpath): - modname, classname = dotpath.rsplit(".", 1) - mod = __import__(modname, globals(), locals(), [classname], 0) - return getattr(mod, classname) - - def process_params(d): - decoded = {} - for k, v in d.items(): - if k.startswith("$"): - if isinstance(v, list): - v = [os.path.expandvars(i) for i in v] - elif isinstance(v, dict): - v = {k2: os.path.expandvars(v2) for k2, v2 in v.items()} - else: - v = os.path.expandvars(v) - decoded[k.strip("$")] = dec.process_decoded(v) - return decoded - - jobs = [] - common_params = process_params(spec.get("jobs_common_params", {})) - - for d in spec["jobs"]: - cls_ = load_class(d["jb"]) - params = process_params(d.get("params", {})) - params.update(common_params) - jobs.append(cls_(**params)) - - handlers = [] - for d in spec.get("handlers", []): - cls_ = load_class(d["hdlr"]) - params = process_params(d.get("params", {})) - handlers.append(cls_(**params)) - - validators = [] - for d in spec.get("validators", []): - cls_ = load_class(d["vldr"]) - params = process_params(d.get("params", {})) - validators.append(cls_(**params)) - - custodian_params = process_params(spec.get("custodian_params", {})) - - return cls(jobs=jobs, handlers=handlers, validators=validators, - **custodian_params)
    - -
    [docs] def run(self): - """ - Runs all jobs. - - Returns: - All errors encountered as a list of list. - [[error_dicts for job 1], [error_dicts for job 2], ....] - - Raises: - ValidationError: if a job fails validation - ReturnCodeError: if the process has a return code different from 0 - NonRecoverableError: if an unrecoverable occurs - MaxCorrectionsPerJobError: if max_errors_per_job is reached - MaxCorrectionsError: if max_errors is reached - MaxCorrectionsPerHandlerError: if max_errors_per_handler is reached - """ - cwd = os.getcwd() - - with ScratchDir(self.scratch_dir, create_symbolic_link=True, - copy_to_current_on_exit=True, - copy_from_current_on_enter=True) as temp_dir: - self.total_errors = 0 - start = datetime.datetime.now() - logger.info("Run started at {} in {}.".format( - start, temp_dir)) - v = sys.version.replace("\n", " ") - logger.info("Custodian running on Python version {}".format(v)) - logger.info("Hostname: {}, Cluster: {}".format( - *get_execution_host_info())) - - try: - # skip jobs until the restart - for job_n, job in islice(enumerate(self.jobs, 1), - self.restart, None): - self._run_job(job_n, job) - # We do a dump of the run log after each job. - dumpfn(self.run_log, Custodian.LOG_FILE, cls=MontyEncoder, - indent=4) - # Checkpoint after each job so that we can recover from last - # point and remove old checkpoints - if self.checkpoint: - self.restart = job_n - Custodian._save_checkpoint(cwd, job_n) - except CustodianError as ex: - logger.error(ex.message) - if ex.raises: - raise - finally: - # Log the corrections to a json file. - logger.info("Logging to {}...".format(Custodian.LOG_FILE)) - dumpfn(self.run_log, Custodian.LOG_FILE, cls=MontyEncoder, - indent=4) - end = datetime.datetime.now() - logger.info("Run ended at {}.".format(end)) - run_time = end - start - logger.info("Run completed. Total time taken = {}." - .format(run_time)) - if self.gzipped_output: - gzip_dir(".") - - # Cleanup checkpoint files (if any) if run is successful. - Custodian._delete_checkpoints(cwd) - - return self.run_log
    - - def _run_job(self, job_n, job): - """ - Runs a single job. - - Args: - job_n: job number (1 index) - job: Custodian job - - - Raises: - ValidationError: if a job fails validation - ReturnCodeError: if the process has a return code different from 0 - NonRecoverableError: if an unrecoverable occurs - MaxCorrectionsPerJobError: if max_errors_per_job is reached - MaxCorrectionsError: if max_errors is reached - MaxCorrectionsPerHandlerError: if max_errors_per_handler is reached - """ - self.run_log.append({"job": job.as_dict(), "corrections": [], - "handler": None, "validator": None, - "max_errors": False, "max_errors_per_job": False, - "max_errors_per_handler": False, - "nonzero_return_code": False}) - self.errors_current_job = 0 - # reset the counters of the number of times a correction has been - # applied for each handler - for h in self.handlers: - h.n_applied_corrections = 0 - - job.setup() - - attempt = 0 - while (self.total_errors < self.max_errors and - self.errors_current_job < self.max_errors_per_job): - attempt += 1 - logger.info( - "Starting job no. {} ({}) attempt no. {}. Total errors and " - "errors in job thus far = {}, {}.".format( - job_n, job.name, attempt, self.total_errors, - self.errors_current_job)) - - p = job.run() - # Check for errors using the error handlers and perform - # corrections. - has_error = False - zero_return_code = True - - # While the job is running, we use the handlers that are - # monitors to monitor the job. - if isinstance(p, subprocess.Popen): - if self.monitors: - n = 0 - while True: - n += 1 - time.sleep(self.polling_time_step) - if p.poll() is not None: - break - terminate = self.terminate_func or p.terminate - if n % self.monitor_freq == 0: - has_error = self._do_check(self.monitors, - terminate) - if terminate is not None and terminate != p.terminate: - time.sleep(self.polling_time_step) - else: - p.wait() - if self.terminate_func is not None and \ - self.terminate_func != p.terminate: - self.terminate_func() - time.sleep(self.polling_time_step) - - zero_return_code = p.returncode == 0 - - logger.info("{}.run has completed. " - "Checking remaining handlers".format(job.name)) - # Check for errors again, since in some cases non-monitor - # handlers fix the problems detected by monitors - # if an error has been found, not all handlers need to run - if has_error: - self._do_check([h for h in self.handlers - if not h.is_monitor]) - else: - has_error = self._do_check(self.handlers) - - if has_error: - # This makes sure the job is killed cleanly for certain systems. - job.terminate() - - # If there are no errors detected, perform - # postprocessing and exit. - if not has_error: - for v in self.validators: - if v.check(): - self.run_log[-1]["validator"] = v - s = "Validation failed: {}".format(v.__class__.__name__) - raise ValidationError(s, True, v) - if not zero_return_code: - if self.terminate_on_nonzero_returncode: - self.run_log[-1]["nonzero_return_code"] = True - s = "Job return code is %d. Terminating..." % \ - p.returncode - logger.info(s) - raise ReturnCodeError(s, True) - else: - warnings.warn("subprocess returned a non-zero return " - "code. Check outputs carefully...") - job.postprocess() - return - - # Check that all errors could be handled - for x in self.run_log[-1]["corrections"]: - if not x["actions"] and x["handler"].raises_runtime_error: - self.run_log[-1]["handler"] = x["handler"] - s = "Unrecoverable error for handler: {}".format(x["handler"]) - raise NonRecoverableError(s, True, x["handler"]) - for x in self.run_log[-1]["corrections"]: - if not x["actions"]: - self.run_log[-1]["handler"] = x["handler"] - s = "Unrecoverable error for handler: %s" % x["handler"] - raise NonRecoverableError(s, False, x["handler"]) - - if self.errors_current_job >= self.max_errors_per_job: - self.run_log[-1]["max_errors_per_job"] = True - msg = "Max errors per job reached: {}.".format(self.max_errors_per_job) - logger.info(msg) - raise MaxCorrectionsPerJobError(msg, True, self.max_errors_per_job, job) - else: - self.run_log[-1]["max_errors"] = True - msg = "Max errors reached: {}.".format(self.max_errors) - logger.info(msg) - raise MaxCorrectionsError(msg, True, self.max_errors) - -
    [docs] def run_interrupted(self): - """ - Runs custodian in a interuppted mode, which sets up and - validates jobs but doesn't run the executable - - Returns: - number of remaining jobs - - Raises: - ValidationError: if a job fails validation - ReturnCodeError: if the process has a return code different from 0 - NonRecoverableError: if an unrecoverable occurs - MaxCorrectionsPerJobError: if max_errors_per_job is reached - MaxCorrectionsError: if max_errors is reached - MaxCorrectionsPerHandlerError: if max_errors_per_handler is reached - """ - start = datetime.datetime.now() - try: - cwd = os.getcwd() - v = sys.version.replace("\n", " ") - logger.info("Custodian started in singleshot mode at {} in {}." - .format(start, cwd)) - logger.info("Custodian running on Python version {}".format(v)) - - # load run log - if os.path.exists(Custodian.LOG_FILE): - self.run_log = loadfn(Custodian.LOG_FILE, cls=MontyDecoder) - - if len(self.run_log) == 0: - # starting up an initial job - setup input and quit - job_n = 0 - job = self.jobs[job_n] - logger.info("Setting up job no. 1 ({}) ".format(job.name)) - job.setup() - self.run_log.append({"job": job.as_dict(), "corrections": [], - 'job_n': job_n}) - return len(self.jobs) - else: - # Continuing after running calculation - job_n = self.run_log[-1]['job_n'] - job = self.jobs[job_n] - - # If we had to fix errors from a previous run, insert clean log - # dict - if len(self.run_log[-1]['corrections']) > 0: - logger.info("Reran {}.run due to fixable errors".format( - job.name)) - - # check error handlers - logger.info("Checking error handlers for {}.run".format( - job.name)) - if self._do_check(self.handlers): - logger.info("Failed validation based on error handlers") - # raise an error for an unrecoverable error - for x in self.run_log[-1]["corrections"]: - if not x["actions"] and x["handler"].raises_runtime_error: - self.run_log[-1]["handler"] = x["handler"] - s = "Unrecoverable error for handler: {}. " \ - "Raising RuntimeError".format(x["handler"]) - raise NonRecoverableError(s, True, x["handler"]) - logger.info("Corrected input based on error handlers") - # Return with more jobs to run if recoverable error caught - # and corrected for - return len(self.jobs) - job_n - - # check validators - logger.info("Checking validator for {}.run".format(job.name)) - for v in self.validators: - if v.check(): - self.run_log[-1]["validator"] = v - logger.info("Failed validation based on validator") - s = "Validation failed: {}".format(v) - raise ValidationError(s, True, v) - - logger.info("Postprocessing for {}.run".format(job.name)) - job.postprocess() - - # IF DONE WITH ALL JOBS - DELETE ALL CHECKPOINTS AND RETURN - # VALIDATED - if len(self.jobs) == (job_n + 1): - self.finished = True - return 0 - - # Setup next job_n - job_n += 1 - job = self.jobs[job_n] - self.run_log.append({"job": job.as_dict(), "corrections": [], - 'job_n': job_n}) - job.setup() - return len(self.jobs) - job_n - - except CustodianError as ex: - logger.error(ex.message) - if ex.raises: - raise - - finally: - # Log the corrections to a json file. - logger.info("Logging to {}...".format(Custodian.LOG_FILE)) - dumpfn(self.run_log, Custodian.LOG_FILE, cls=MontyEncoder, - indent=4) - end = datetime.datetime.now() - logger.info("Run ended at {}.".format(end)) - run_time = end - start - logger.info("Run completed. Total time taken = {}." - .format(run_time)) - if self.finished and self.gzipped_output: - gzip_dir(".")
    - - def _do_check(self, handlers, terminate_func=None): - """ - checks the specified handlers. Returns True iff errors caught - """ - corrections = [] - for h in handlers: - try: - if h.check(): - if h.max_num_corrections is not None \ - and h.n_applied_corrections >= h.max_num_corrections: - msg = "Maximum number of corrections {} reached " \ - "for handler {}".format(h.max_num_corrections, h) - if h.raise_on_max: - self.run_log[-1]["handler"] = h - self.run_log[-1]["max_errors_per_handler"] = True - raise MaxCorrectionsPerHandlerError(msg, True, h.max_num_corrections, h) - else: - logger.warning(msg+" Correction not applied.") - continue - if terminate_func is not None and h.is_terminating: - logger.info("Terminating job") - terminate_func() - # make sure we don't terminate twice - terminate_func = None - d = h.correct() - logger.error(h.__class__.__name__, extra=d) - d["handler"] = h - corrections.append(d) - h.n_applied_corrections += 1 - except Exception: - if not self.skip_over_errors: - raise - else: - import traceback - logger.error("Bad handler %s " % h) - logger.error(traceback.format_exc()) - corrections.append( - {"errors": ["Bad handler %s " % h], - "actions": []}) - self.total_errors += len(corrections) - self.errors_current_job += len(corrections) - self.run_log[-1]["corrections"].extend(corrections) - # We do a dump of the run log after each check. - dumpfn(self.run_log, Custodian.LOG_FILE, cls=MontyEncoder, - indent=4) - return len(corrections) > 0
    - - -
    [docs]class Job(six.with_metaclass(ABCMeta, MSONable)): - """ - Abstract base class defining the interface for a Job. - """ - -
    [docs] @abstractmethod - def setup(self): - """ - This method is run before the start of a job. Allows for some - pre-processing. - """ - pass
    - -
    [docs] @abstractmethod - def run(self): - """ - This method perform the actual work for the job. If parallel error - checking (monitoring) is desired, this must return a Popen process. - """ - pass
    - -
    [docs] @abstractmethod - def postprocess(self): - """ - This method is called at the end of a job, *after* error detection. - This allows post-processing, such as cleanup, analysis of results, - etc. - """ - pass
    - -
    [docs] def terminate(self): - return None
    - - @property - def name(self): - """ - A nice string name for the job. - """ - return self.__class__.__name__
    - - -
    [docs]class ErrorHandler(MSONable): - """ - Abstract base class defining the interface for an ErrorHandler. - """ - - is_monitor = False - """ - This class property indicates whether the error handler is a monitor, - i.e., a handler that monitors a job as it is running. If a - monitor-type handler notices an error, the job will be sent a - termination signal, the error is then corrected, - and then the job is restarted. This is useful for catching errors - that occur early in the run but do not cause immediate failure. - """ - - is_terminating = True - """ - Whether this handler terminates a job upon error detection. By - default, this is True, which means that the current Job will be - terminated upon error detection, corrections applied, - and restarted. In some instances, some errors may not need the job to be - terminated or may need to wait for some other event to terminate a job. - For example, a particular error may require a flag to be set to request - a job to terminate gracefully once it finishes its current task. The - handler to set the flag should be classified as is_terminating = False to - not terminate the job. - """ - - raises_runtime_error = True - """ - Whether this handler causes custodian to raise a runtime error if it cannot - handle the error (i.e. if correct returns a dict with "actions":None, or - "actions":[]) - """ - - max_num_corrections = None - raise_on_max = False - """ - Whether corrections from this specific handler should be applied only a - fixed maximum number of times on a single job (i.e. the counter is reset - at the beginning of each job). If the maximum number is reached the code - will either raise a MaxCorrectionsPerHandlerError (raise_on_max==True) or stops - considering the correction (raise_on_max==False). If max_num_corrections - is None this option is not considered. These options can be overridden - as class attributes of the subclass or as customizable options setting - an instance attribute from __init__. - """ - -
    [docs] @abstractmethod - def check(self): - """ - This method is called during the job (for monitors) or at the end of - the job to check for errors. - - Returns: - (bool) Indicating if errors are detected. - """ - pass
    - -
    [docs] @abstractmethod - def correct(self): - """ - This method is called at the end of a job when an error is detected. - It should perform any corrective measures relating to the detected - error. - - Returns: - (dict) JSON serializable dict that describes the errors and - actions taken. E.g. - {"errors": list_of_errors, "actions": list_of_actions_taken}. - If this is an unfixable error, actions should be set to None. - """ - pass
    - - @property - def n_applied_corrections(self): - """ - The number of times the handler has given a correction and this - has been applied. - - Returns: - (int): the number of corrections applied. - """ - try: - return self._num_applied_corrections - except AttributeError: - self._num_applied_corrections = 0 - return self._num_applied_corrections - - @n_applied_corrections.setter - def n_applied_corrections(self, value): - """ - Setter for the number of corrections applied. - - Args: - value(int): the number of corrections applied - """ - self._num_applied_corrections = value
    - - -
    [docs]class Validator(six.with_metaclass(ABCMeta, MSONable)): - """ - Abstract base class defining the interface for a Validator. A Validator - differs from an ErrorHandler in that it does not correct a run and is run - only at the end of a Job. If errors are detected by a Validator, a run is - immediately terminated. - """ - -
    [docs] @abstractmethod - def check(self): - """ - This method is called at the end of a job. - - Returns: - (bool) Indicating if errors are detected. - """ - pass
    - - -
    [docs]class CustodianError(RuntimeError): - """ - Exception class for Custodian errors. - """ - - def __init__(self, message, raises=False): - """ - Initializes the error with a message. - - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - """ - super(CustodianError, self).__init__(message) - self.raises = raises - self.message = message
    - - -
    [docs]class ValidationError(CustodianError): - """ - Error raised when a validator does not pass the check - """ - - def __init__(self, message, raises, validator): - """ - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - validator (Validator): Validator that caused the exception. - """ - super(ValidationError, self).__init__(message, raises) - self.validator = validator
    - - -
    [docs]class NonRecoverableError(CustodianError): - """ - Error raised when a handler found an error but could not fix it - """ - - def __init__(self, message, raises, handler): - """ - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - handler (Handler): Handler that caused the exception. - """ - super(NonRecoverableError, self).__init__(message, raises) - self.handler = handler
    - - -
    [docs]class ReturnCodeError(CustodianError): - """ - Error raised when the process gave non zero return code - """ - pass
    - - -
    [docs]class MaxCorrectionsError(CustodianError): - """ - Error raised when the maximum allowed number of errors is reached - """ - - def __init__(self, message, raises, max_errors): - """ - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - max_errors (int): the number of errors reached - """ - super(MaxCorrectionsError, self).__init__(message, raises) - self.max_errors = max_errors
    - - -
    [docs]class MaxCorrectionsPerJobError(CustodianError): - """ - Error raised when the maximum allowed number of errors per job is reached - """ - - def __init__(self, message, raises, max_errors_per_job, job): - """ - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - max_errors_per_job (int): the number of errors per job reached - job (Job): the job that was stopped - """ - super(MaxCorrectionsPerJobError, self).__init__(message, raises) - self.max_errors_per_job = max_errors_per_job - self.job = job
    - - -
    [docs]class MaxCorrectionsPerHandlerError(CustodianError): - """ - Error raised when the maximum allowed number of errors per handler is reached - """ - - def __init__(self, message, raises, max_errors_per_handler, handler): - """ - Args: - message (str): Message passed to Exception - raises (bool): Whether this should be raised outside custodian - max_errors_per_handler (int): the number of errors per job reached - handler (Handler): the handler that caused the exception - """ - super(MaxCorrectionsPerHandlerError, self).__init__(message, raises) - self.max_errors_per_handler = max_errors_per_handler - self.handler = handler
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/feff/handlers.html b/docs/html/_modules/custodian/feff/handlers.html deleted file mode 100644 index 41572ad8..00000000 --- a/docs/html/_modules/custodian/feff/handlers.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - custodian.feff.handlers — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.feff.handlers

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -from custodian.custodian import ErrorHandler
    -import re
    -from custodian.utils import backup
    -from pymatgen.io.feff.sets import FEFFDictSet
    -from custodian.feff.interpreter import FeffModder
    -import logging
    -
    -""" This module implements specific error handler for FEFF runs. """
    -
    -__author__ = "Chen Zheng"
    -__copyright__ = "Copyright 2012, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Chen Zheng"
    -__email__ = "chz022@ucsd.edu"
    -__date__ = "Oct 18, 2017"
    -
    -FEFF_BACKUP_FILES = ["ATOMS", "HEADER", "PARAMETERS", "POTENTIALS", "feff.inp", "*.cif", "pot.bin"]
    -
    -logger = logging.getLogger(__name__)
    -
    -
    -
    [docs]class UnconvergedErrorHandler(ErrorHandler): - """ - Correct the unconverged error of FEFF's SCF calculation. - """ - - is_monitor = False - - def __init__(self, output_filename='log1.dat'): - """ - Initializes the handler with the output file to check - - Args: - output_filename (str): Filename for the log1.dat file. log1.dat file - contains the SCF calculation convergence information. Change this only - if it is different from the default (unlikely). - """ - self.output_filename = output_filename - -
    [docs] def check(self): - """ - If the FEFF run does not converge, the check will return - "TRUE" - """ - return self._notconverge_check()
    - - def _notconverge_check(self): - - # Process the output file and get converge information - not_converge_pattern = re.compile("Convergence not reached.*") - converge_pattern = re.compile('Convergence reached.*') - for _, line in enumerate(open(self.output_filename)): - if len(not_converge_pattern.findall(line)) > 0: - return True - - elif len(converge_pattern.findall(line)) > 0: - return False - -
    [docs] def correct(self): - backup(FEFF_BACKUP_FILES) - feff_input = FEFFDictSet.from_directory(".") - scf_values = feff_input.tags.get("SCF") - nscmt = scf_values[2] - ca = scf_values[3] - nmix = scf_values[4] - actions = [] - - #Add RESTART card to PARAMETERS - if not "RESTART" in feff_input.tags: - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"RESTART": []}}}) - - if nscmt < 100 and ca == 0.2: - scf_values[2] = 100 - scf_values[4] = 3 # Set nmix = 3 - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"SCF": scf_values}}}) - FeffModder().apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - - elif nscmt == 100 and nmix == 3 and ca > 0.01: - # Reduce the convergence accelerator factor - scf_values[3] = round(ca / 2, 2) - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"SCF": scf_values}}}) - FeffModder().apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - - elif nmix == 3 and ca == 0.01: - # Set ca = 0.05 and set nmix - scf_values[3] = 0.05 - scf_values[4] = 5 - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"SCF": scf_values}}}) - FeffModder().apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - - elif nmix == 5 and ca == 0.05: - # Set ca = 0.05 and set nmix - scf_values[3] = 0.05 - scf_values[4] = 10 - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"SCF": scf_values}}}) - FeffModder().apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - - elif nmix == 10 and ca < 0.2: - # loop through ca with nmix = 10 - scf_values[3] = round(ca * 2, 2) - actions.append({"dict": "PARAMETERS", - "action": {"_set": {"SCF": scf_values}}}) - FeffModder().apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - - # Unfixable error. Just return None for actions. - else: - return {"errors": ["Non-converging job"], "actions": None}
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/feff/interpreter.html b/docs/html/_modules/custodian/feff/interpreter.html deleted file mode 100644 index 2717bfb8..00000000 --- a/docs/html/_modules/custodian/feff/interpreter.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - custodian.feff.interpreter — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.feff.interpreter

    -# coding: utf-8
    -
    -from __future__ import unicode_literals
    -
    -from custodian.ansible.actions import FileActions, DictActions
    -from custodian.ansible.interpreter import Modder
    -from pymatgen.io.feff.sets import FEFFDictSet
    -import six
    -import os
    -
    -
    -
    [docs]class FeffModder(Modder): - def __init__(self, actions=None, strict=True, feffinp=None): - """ - Initializes a Modder for FeffInput sets - - Args: - actions ([Action]): A sequence of supported actions. See - actions ([Action]): A sequence of supported actions. See - :mod:`custodian.ansible.actions`. Default is None, - which means DictActions and FileActions are supported. - strict (bool): Indicating whether to use strict mode. In non-strict - mode, unsupported actions are simply ignored without any - errors raised. In strict mode, if an unsupported action is - supplied, a ValueError is raised. Defaults to True. - feffinp (FEFFInput): A FeffInput object from the current directory. - Initialized automatically if not passed (but passing it will - avoid having to reparse the directory). - """ - self.feffinp = feffinp or FEFFDictSet.from_directory('.') - self.feffinp = self.feffinp.all_input() - actions = actions or [FileActions, DictActions] - super(FeffModder, self).__init__(actions, strict) - -
    [docs] def apply_actions(self, actions): - """ - Applies a list of actions to the FEFF Input Set and rewrites modified - files. - - Args: - actions [dict]: A list of actions of the form {'file': filename, - 'action': moddermodification} or {'dict': feffinput_key, - 'action': moddermodification} - """ - modified = [] - for a in actions: - if "dict" in a: - k = a["dict"] - modified.append(k) - self.feffinp[k] = self.modify_object(a["action"], self.feffinp[k]) - elif "file" in a: - self.modify(a["action"], a["file"]) - else: - raise ValueError("Unrecognized format: {}".format(a)) - if modified: - feff = self.feffinp - feff_input = "\n\n".join(str(feff[k]) for k in - ["HEADER", "PARAMETERS", "POTENTIALS", "ATOMS"] - if k in feff) - for k, v in six.iteritems(feff): - with open(os.path.join('.', k), "w") as f: - f.write(str(v)) - - with open(os.path.join('.', "feff.inp"), "w") as f: - f.write(feff_input)
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/feff/jobs.html b/docs/html/_modules/custodian/feff/jobs.html deleted file mode 100644 index a2790500..00000000 --- a/docs/html/_modules/custodian/feff/jobs.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - custodian.feff.jobs — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.feff.jobs

    -# coding: utf-8
    -
    -import subprocess
    -import os
    -import shutil
    -import logging
    -from monty.shutil import decompress_dir
    -
    -from custodian.custodian import Job
    -from custodian.utils import backup
    -
    -""" This module implements basic kinds of jobs for FEFF runs."""
    -
    -logger = logging.getLogger(__name__)
    -
    -__author__ = "Chen Zheng"
    -__version__ = "0.1"
    -__maintainer__ = "Chen Zheng"
    -__email__ = "chz022@ucsd.edu"
    -__status__ = "Alpha"
    -__date__ = '10/20/17'
    -
    -FEFF_INPUT_FILES = {"feff.inp"}
    -FEFF_BACKUP_FILES = {"ATOMS", "HEADER", "PARAMETERS", "POTENTIALS"}
    -
    -
    -
    [docs]class FeffJob(Job): - """ - A basic FEFF job, run whatever is in the directory. - """ - - def __init__(self, feff_cmd, output_file="feff.out", - stderr_file="std_feff_err.txt", backup=True, - gzipped=False, gzipped_prefix='feff_out'): - """ - This constructor is used for a standard FEFF initialization - - Args: - feff_cmd (str): the name of the full executable for running FEFF - output_file (str): Name of file to direct standard out to. - Defaults to "feff.out". - stderr_file (str): Name of file direct standard error to. - Defaults to "std_feff_err.txt". - backup (bool): Indicating whether to backup the initial input files. - If True, the feff.inp will be copied with a ".orig" appended. - Defaults to True. - gzipped (bool): Whether to gzip the final output. Defaults to False. - gzipped_prefix (str): prefix to the feff output files archive. Defaults - to feff_out, which means a series of feff_out.1.tar.gz, feff_out.2.tar.gz, ... - will be generated. - """ - self.feff_cmd = feff_cmd - self.output_file = output_file - self.stderr_file = stderr_file - self.backup = backup - self.gzipped = gzipped - self.gzipped_prefix = gzipped_prefix - -
    [docs] def setup(self): - """ - Performs initial setup for FeffJob, do backing up. - Returns: - - """ - decompress_dir('.') - - if self.backup: - for f in FEFF_INPUT_FILES: - shutil.copy(f, "{}.orig".format(f)) - - for f in FEFF_BACKUP_FILES: - if os.path.isfile(f): - shutil.copy(f, "{}.orig".format(f))
    - -
    [docs] def run(self): - - """ - Performs the actual FEFF run - Returns: - (subprocess.Popen) Used for monitoring. - """ - with open(self.output_file, "w") as f_std, \ - open(self.stderr_file, "w", buffering=1) as f_err: - # Use line buffering for stderr - # On TSCC, need to run shell command - p = subprocess.Popen(self.feff_cmd, stdout=f_std, stderr=f_err, shell=True) - - return p
    - -
    [docs] def postprocess(self): - """ - Renaming or gzipping all the output as needed - """ - if self.gzipped: - backup("*", prefix=self.gzipped_prefix)
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/nwchem/handlers.html b/docs/html/_modules/custodian/nwchem/handlers.html deleted file mode 100644 index 44adf487..00000000 --- a/docs/html/_modules/custodian/nwchem/handlers.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - custodian.nwchem.handlers — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.nwchem.handlers

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -"""
    -This module implements error handlers for Nwchem runs. Currently tested only
    -for B3LYP DFT jobs.
    -"""
    -
    -
    -__author__ = "Shyue Ping Ong"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__status__ = "Beta"
    -__date__ = "5/20/13"
    -
    -
    -from custodian.custodian import ErrorHandler
    -from custodian.utils import backup
    -from pymatgen.io.nwchem import NwOutput, NwInput
    -from custodian.ansible.interpreter import Modder
    -
    -
    -
    [docs]class NwchemErrorHandler(ErrorHandler): - """ - Error handler for Nwchem Jobs. Currently tested only for B3LYP DFT jobs - generated by pymatgen. - """ - - def __init__(self, output_filename="mol.nwout"): - """ - Initializes with an output file name. - - Args: - output_filename (str): This is the file where the stdout for nwchem - is being redirected. The error messages that are checked are - present in the stdout. Defaults to "mol.nwout", which is the - default redirect used by :class:`custodian.nwchem.jobs - .NwchemJob`. - """ - self.output_filename = output_filename - -
    [docs] def check(self): - # Checks output file for errors. - out = NwOutput(self.output_filename) - self.errors = [] - self.input_file = out.job_info['input'] - if out.data[-1]["has_error"]: - self.errors.extend(out.data[-1]["errors"]) - self.errors = list(set(self.errors)) - self.ntasks = len(out.data) - return len(self.errors) > 0
    - - def _mod_input(self, search_string_func, mod_string_func): - with open(self.input_file) as f: - lines = [] - for l in f: - if search_string_func(l): - lines.append(mod_string_func(l)) - else: - lines.append(l) - - with open(self.input_file, "w") as fout: - fout.write("".join(lines)) - -
    [docs] def correct(self): - backup("*.nw*") - actions = [] - nwi = NwInput.from_file(self.input_file) - for e in self.errors: - if e == "autoz error": - action = {"_set": {"geometry_options": ["units", - "angstroms", - "noautoz"]}} - actions.append(action) - elif e == "Bad convergence": - t = nwi.tasks[self.ntasks - 1] - if "cgmin" in t.theory_directives: - nwi.tasks.pop(self.ntasks - 1) - else: - t.theory_directives["cgmin"] = "" - for t in nwi.tasks: - if t.operation.startswith("freq"): - #You cannot calculate hessian with cgmin. - t.theory_directives["nocgmin"] = "" - action = {"_set": {"tasks": [t.as_dict() for t in nwi.tasks]}} - actions.append(action) - else: - # For unimplemented errors, this should just cause the job to - # die. - return {"errors": self.errors, "actions": None} - - m = Modder() - for action in actions: - nwi = m.modify_object(action, nwi) - nwi.write_file(self.input_file) - return {"errors": self.errors, "actions": actions}
    - - def __str__(self): - return "NwchemErrorHandler"
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/nwchem/jobs.html b/docs/html/_modules/custodian/nwchem/jobs.html deleted file mode 100644 index 0a597352..00000000 --- a/docs/html/_modules/custodian/nwchem/jobs.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - custodian.nwchem.jobs — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.nwchem.jobs

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -import subprocess
    -import shutil
    -
    -from monty.io import zopen
    -
    -from custodian.custodian import Job
    -from monty.shutil import gzip_dir
    -
    -"""
    -This module implements basic kinds of jobs for Nwchem runs.
    -"""
    -
    -__author__ = "Shyue Ping Ong"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__status__ = "Beta"
    -__date__ = "5/20/13"
    -
    -
    -
    [docs]class NwchemJob(Job): - """ - A basic Nwchem job. - """ - - def __init__(self, nwchem_cmd, input_file="mol.nw", - output_file="mol.nwout", gzipped=False, - backup=True, settings_override=None): - """ - Initializes a basic NwChem job. - - Args: - nwchem_cmd ([str]): Command to run Nwchem as a list of args. For - example, ["nwchem"]. - input_file (str): Input file to run. Defaults to "mol.nw". - output_file (str): Name of file to direct standard out to. - Defaults to "mol.nwout". - backup (bool): Whether to backup the initial input files. If True, - the input files will be copied with a ".orig" appended. - Defaults to True. - gzipped (bool): Deprecated. Please use the Custodian class's - gzipped_output option instead. - settings_override ([dict]): - An ansible style list of dict to override changes. - #TODO: Not implemented yet. - """ - self.nwchem_cmd = nwchem_cmd - self.input_file = input_file - self.output_file = output_file - self.backup = backup - self.gzipped = gzipped - self.settings_override = settings_override - -
    [docs] def setup(self): - """ - Performs backup if necessary. - """ - if self.backup: - shutil.copy(self.input_file, "{}.orig".format(self.input_file))
    - -
    [docs] def run(self): - """ - Performs actual nwchem run. - """ - with zopen(self.output_file, 'w') as fout: - return subprocess.Popen(self.nwchem_cmd + [self.input_file], - stdout=fout)
    - -
    [docs] def postprocess(self): - """ - Renaming or gzipping as needed. - """ - if self.gzipped: - gzip_dir(".")
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/qchem/handlers.html b/docs/html/_modules/custodian/qchem/handlers.html deleted file mode 100644 index 123e4fd9..00000000 --- a/docs/html/_modules/custodian/qchem/handlers.html +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - - custodian.qchem.handlers — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.qchem.handlers

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -# This module implements new error handlers for QChem runs.
    -
    -import os
    -from pymatgen.io.qchem.inputs import QCInput
    -from pymatgen.io.qchem.outputs import QCOutput
    -from custodian.custodian import ErrorHandler
    -from custodian.utils import backup
    -
    -__author__ = "Samuel Blau, Brandon Wood, Shyam Dwaraknath"
    -__copyright__ = "Copyright 2018, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Samuel Blau"
    -__email__ = "samblau1@gmail.com"
    -__status__ = "Alpha"
    -__date__ = "3/26/18"
    -__credits__ = "Xiaohui Qu"
    -
    -
    -
    [docs]class QChemErrorHandler(ErrorHandler): - """ - Master QChemErrorHandler class that handles a number of common errors - that occur during QChem runs. - """ - - is_monitor = False - - def __init__(self, - input_file="mol.qin", - output_file="mol.qout", - scf_max_cycles=200, - geom_max_cycles=200): - """ - Initializes the error handler from a set of input and output files. - - Args: - input_file (str): Name of the QChem input file. - output_file (str): Name of the QChem output file. - scf_max_cycles (int): The max iterations to set to fix SCF failure. - geom_max_cycles (int): The max iterations to set to fix geometry - optimization failure. - """ - self.input_file = input_file - self.output_file = output_file - self.scf_max_cycles = scf_max_cycles - self.geom_max_cycles = geom_max_cycles - self.outdata = None - self.errors = [] - self.opt_error_history = [] - -
    [docs] def check(self): - # Checks output file for errors. - self.outdata = QCOutput(self.output_file).data - self.errors = self.outdata.get("errors") - # If we aren't out of optimization cycles, but we were in the past, reset the history - if "out_of_opt_cycles" not in self.errors and len(self.opt_error_history) > 0: - self.opt_error_history = [] - # If we're out of optimization cycles and we have unconnected fragments, no need to handle any errors - if "out_of_opt_cycles" in self.errors and self.outdata["structure_change"] == "unconnected_fragments": - return False - return len(self.errors) > 0
    - -
    [docs] def correct(self): - backup({self.input_file, self.output_file}) - actions = [] - self.qcinp = QCInput.from_file(self.input_file) - - if "SCF_failed_to_converge" in self.errors: - # Check number of SCF cycles. If not set or less than scf_max_cycles, - # increase to that value and rerun. If already set, check if - # scf_algorithm is unset or set to DIIS, in which case set to GDM. - # Otherwise, tell user to call SCF error handler and do nothing. - if str(self.qcinp.rem.get("max_scf_cycles")) != str( - self.scf_max_cycles): - self.qcinp.rem["max_scf_cycles"] = self.scf_max_cycles - actions.append({"max_scf_cycles": self.scf_max_cycles}) - elif self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis": - self.qcinp.rem["scf_algorithm"] = "gdm" - actions.append({"scf_algorithm": "gdm"}) - elif self.qcinp.rem.get("scf_algorithm", "gdm").lower() == "gdm": - self.qcinp.rem["scf_algorithm"] = "diis_gdm" - actions.append({"scf_algorithm": "diis_gdm"}) - else: - print( - "More advanced changes may impact the SCF result. Use the SCF error handler" - ) - - elif "out_of_opt_cycles" in self.errors: - # Check number of opt cycles. If less than geom_max_cycles, increase - # to that value, set last geom as new starting geom and rerun. - if str(self.qcinp.rem.get( - "geom_opt_max_cycles")) != str(self.geom_max_cycles): - self.qcinp.rem["geom_opt_max_cycles"] = self.geom_max_cycles - actions.append({"geom_max_cycles:": self.scf_max_cycles}) - if len(self.outdata.get("energy_trajectory")) > 1: - self.qcinp.molecule = self.outdata.get( - "molecule_from_last_geometry") - actions.append({"molecule": "molecule_from_last_geometry"}) - # If already at geom_max_cycles, often can just get convergence by restarting - # from the geometry of the last cycle. But we'll also save any structural - # changes that happened along the way. - else: - self.opt_error_history += [self.outdata["structure_change"]] - if len(self.opt_error_history) > 1: - if self.opt_error_history[-1] == "no_change": - # If no structural changes occured in two consecutive optimizations, - # and we still haven't converged, then just exit. - return {"errors": self.errors, "actions": None, "opt_error_history": self.opt_error_history} - self.qcinp.molecule = self.outdata.get("molecule_from_last_geometry") - actions.append({"molecule": "molecule_from_last_geometry"}) - - elif "unable_to_determine_lamda" in self.errors: - # Set last geom as new starting geom and rerun. If no opt cycles, - # use diff SCF strat? Diff initial guess? Change basis? - if len(self.outdata.get("energy_trajectory")) > 1: - self.qcinp.molecule = self.outdata.get( - "molecule_from_last_geometry") - actions.append({"molecule": "molecule_from_last_geometry"}) - elif self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis": - self.qcinp.rem["scf_algorithm"] = "rca_diis" - actions.append({"scf_algorithm": "rca_diis"}) - if self.qcinp.rem.get("gen_scfman"): - self.qcinp.rem["gen_scfman"] = False - actions.append({"gen_scfman": False}) - else: - print( - "Use a different initial guess? Perhaps a different basis?" - ) - - elif "linear_dependent_basis" in self.errors: - # DIIS -> RCA_DIIS. If already RCA_DIIS, change basis? - if self.qcinp.rem.get("scf_algorithm", "diis").lower() == "diis": - self.qcinp.rem["scf_algorithm"] = "rca_diis" - actions.append({"scf_algorithm": "rca_diis"}) - if self.qcinp.rem.get("gen_scfman"): - self.qcinp.rem["gen_scfman"] = False - actions.append({"gen_scfman": False}) - else: - print("Perhaps use a better basis?") - - elif "failed_to_transform_coords" in self.errors: - # Check for symmetry flag in rem. If not False, set to False and rerun. - # If already False, increase threshold? - if not self.qcinp.rem.get("sym_ignore") or self.qcinp.rem.get( - "symmetry"): - self.qcinp.rem["sym_ignore"] = True - self.qcinp.rem["symmetry"] = False - actions.append({"sym_ignore": True}) - actions.append({"symmetry": False}) - else: - print("Perhaps increase the threshold?") - - elif "input_file_error" in self.errors: - print( - "Something is wrong with the input file. Examine error message by hand." - ) - return {"errors": self.errors, "actions": None} - - elif "failed_to_read_input" in self.errors: - # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is. - actions.append({"rerun job as-is"}) - - elif "IO_error" in self.errors: - # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is. - actions.append({"rerun job as-is"}) - - elif "read_molecule_error" in self.errors: - # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is. - actions.append({"rerun job as-is"}) - - elif "never_called_qchem" in self.errors: - # Almost certainly just a temporary problem that will not be encountered again. Rerun job as-is. - actions.append({"rerun job as-is"}) - - elif "unknown_error" in self.errors: - print("Examine error message by hand.") - return {"errors": self.errors, "actions": None} - - else: - # You should never get here. If correct is being called then errors should have at least one entry, - # in which case it should have been caught by the if/elifs above. - print( - "If you get this message, something has gone terribly wrong!") - return {"errors": self.errors, "actions": None} - - os.rename(self.input_file, self.input_file + ".last") - self.qcinp.write_file(self.input_file) - return {"errors": self.errors, "actions": actions}
    - - -
    [docs]class QChemSCFErrorHandler(ErrorHandler): - """ - QChem ErrorHandler class that addresses SCF non-convergence. - """ - - is_monitor = False - - def __init__(self, - input_file="mol.qin", - output_file="mol.qout", - rca_gdm_thresh=1.0E-3, - scf_max_cycles=200): - """ - Initializes the error handler from a set of input and output files. - - Args: - input_file (str): Name of the QChem input file. - output_file (str): Name of the QChem output file. - rca_gdm_thresh (float): The threshold for the prior scf algorithm. - If last deltaE is larger than the threshold try RCA_DIIS - first, else, try DIIS_GDM first. - scf_max_cycles (int): The max iterations to set to fix SCF failure. - """ - self.input_file = input_file - self.output_file = output_file - self.scf_max_cycles = scf_max_cycles - self.geom_max_cycles = geom_max_cycles - self.qcinp = QCInput.from_file(self.input_file) - self.outdata = None - self.errors = None - self.qchem_job = qchem_job - -
    [docs] def check(self): - # Checks output file for errors. - self.outdata = QCOutput(self.output_file).data - self.errors = self.outdata.get("errors") - return len(self.errors) > 0
    - -
    [docs] def correct(self): - print("This hasn't been implemented yet!") - return {"errors": self.errors, "actions": None}
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/qchem/jobs.html b/docs/html/_modules/custodian/qchem/jobs.html deleted file mode 100644 index 81f8756a..00000000 --- a/docs/html/_modules/custodian/qchem/jobs.html +++ /dev/null @@ -1,380 +0,0 @@ - - - - - - - custodian.qchem.jobs — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.qchem.jobs

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -import math
    -
    -# New QChem job module
    -
    -
    -import os
    -import shutil
    -import copy
    -import subprocess
    -import numpy as np
    -from pymatgen.core import Molecule
    -from pymatgen.io.qchem.inputs import QCInput
    -from pymatgen.io.qchem.outputs import QCOutput
    -from pymatgen.analysis.graphs import MoleculeGraph
    -from pymatgen.analysis.local_env import OpenBabelNN
    -from custodian.custodian import Job
    -
    -
    -__author__ = "Samuel Blau, Brandon Wood, Shyam Dwaraknath"
    -__copyright__ = "Copyright 2018, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Samuel Blau"
    -__email__ = "samblau1@gmail.com"
    -__status__ = "Alpha"
    -__date__ = "3/20/18"
    -__credits__ = "Xiaohui Qu"
    -
    -
    -
    [docs]class QCJob(Job): - """ - A basic QChem Job. - """ - - def __init__(self, - qchem_command, - max_cores, - multimode="openmp", - input_file="mol.qin", - output_file="mol.qout", - qclog_file="mol.qclog", - suffix="", - scratch_dir="/dev/shm/qcscratch/", - save_scratch=False, - save_name="default_save_name", - backup=True): - """ - Args: - qchem_command (str): Command to run QChem. - max_cores (int): Maximum number of cores to parallelize over. - multimode (str): Parallelization scheme, either openmp or mpi. - input_file (str): Name of the QChem input file. - output_file (str): Name of the QChem output file. - qclog_file (str): Name of the file to redirect the standard output - to. None means not to record the standard output. - suffix (str): String to append to the file in postprocess. - scratch_dir (str): QCSCRATCH directory. Defaults to "/dev/shm/qcscratch/". - save_scratch (bool): Whether to save scratch directory contents. - Defaults to False. - save_name (str): Name of the saved scratch directory. Defaults to - to "default_save_name". - backup (bool): Whether to backup the initial input file. If True, the - input will be copied with a ".orig" appended. Defaults to True. - """ - self.qchem_command = qchem_command.split(" ") - self.multimode = multimode - self.input_file = input_file - self.output_file = output_file - self.max_cores = max_cores - self.qclog_file = qclog_file - self.suffix = suffix - self.scratch_dir = scratch_dir - self.save_scratch = save_scratch - self.save_name = save_name - self.backup = backup - - @property - def current_command(self): - multimode_index = 0 - if self.save_scratch: - command = [ - "-save", "", - str(self.max_cores), self.input_file, self.output_file, - self.save_name - ] - multimode_index = 1 - else: - command = [ - "", str(self.max_cores), self.input_file, self.output_file - ] - if self.multimode == 'openmp': - command[multimode_index] = "-nt" - elif self.multimode == 'mpi': - command[multimode_index] = "-np" - else: - print("ERROR: Multimode should only be set to openmp or mpi") - command = self.qchem_command + command - return command - -
    [docs] def setup(self): - if self.backup: - shutil.copy(self.input_file, "{}.orig".format(self.input_file)) - os.putenv("QCSCRATCH", self.scratch_dir) - if self.multimode == 'openmp': - os.putenv('QCTHREADS', str(self.max_cores)) - os.putenv('OMP_NUM_THREADS', str(self.max_cores))
    - -
    [docs] def postprocess(self): - if self.save_scratch: - shutil.copytree( - os.path.join(self.scratch_dir, self.save_name), - os.path.join(os.path.dirname(self.input_file), self.save_name)) - if self.suffix != "": - shutil.move(self.input_file, self.input_file + self.suffix) - shutil.move(self.output_file, self.output_file + self.suffix) - shutil.move(self.qclog_file, self.qclog_file + self.suffix)
    - -
    [docs] def run(self): - """ - Perform the actual QChem run. - - Returns: - (subprocess.Popen) Used for monitoring. - """ - qclog = open(self.qclog_file, 'w') - p = subprocess.Popen(self.current_command, stdout=qclog) - return p
    - -
    [docs] @classmethod - def opt_with_frequency_flattener(cls, - qchem_command, - multimode="openmp", - input_file="mol.qin", - output_file="mol.qout", - qclog_file="mol.qclog", - max_iterations=10, - max_molecule_perturb_scale=0.3, - check_connectivity=True, - **QCJob_kwargs): - """ - Optimize a structure and calculate vibrational frequencies to check if the - structure is in a true minima. If a frequency is negative, iteratively - perturbe the geometry, optimize, and recalculate frequencies until all are - positive, aka a true minima has been found. - - Args: - qchem_command (str): Command to run QChem. - multimode (str): Parallelization scheme, either openmp or mpi. - input_file (str): Name of the QChem input file. - output_file (str): Name of the QChem output file. - max_iterations (int): Number of perturbation -> optimization -> frequency - iterations to perform. Defaults to 10. - max_molecule_perturb_scale (float): The maximum scaled perturbation that - can be applied to the molecule. Defaults to 0.3. - check_connectivity (bool): Whether to check differences in connectivity - introduced by structural perturbation. Defaults to True. - **QCJob_kwargs: Passthrough kwargs to QCJob. See - :class:`custodian.qchem.jobs.QCJob`. - """ - - min_molecule_perturb_scale = 0.1 - scale_grid = 10 - perturb_scale_grid = ( - max_molecule_perturb_scale - min_molecule_perturb_scale - ) / scale_grid - - if not os.path.exists(input_file): - raise AssertionError('Input file must be present!') - orig_opt_input = QCInput.from_file(input_file) - orig_opt_rem = copy.deepcopy(orig_opt_input.rem) - orig_freq_rem = copy.deepcopy(orig_opt_input.rem) - orig_freq_rem["job_type"] = "freq" - first = True - reversed_direction = False - num_neg_freqs = [] - - for ii in range(max_iterations): - yield (QCJob( - qchem_command=qchem_command, - multimode=multimode, - input_file=input_file, - output_file=output_file, - qclog_file=qclog_file, - suffix=".opt_" + str(ii), - backup=first, - **QCJob_kwargs)) - first = False - opt_outdata = QCOutput(output_file + ".opt_" + str(ii)).data - if opt_outdata["structure_change"] == "unconnected_fragments" and not opt_outdata["completion"]: - print("Unstable molecule broke into unconnected fragments which failed to optimize! Exiting...") - break - else: - freq_QCInput = QCInput( - molecule=opt_outdata.get("molecule_from_optimized_geometry"), - rem=orig_freq_rem, - opt=orig_opt_input.opt, - pcm=orig_opt_input.pcm, - solvent=orig_opt_input.solvent) - freq_QCInput.write_file(input_file) - yield (QCJob( - qchem_command=qchem_command, - multimode=multimode, - input_file=input_file, - output_file=output_file, - qclog_file=qclog_file, - suffix=".freq_" + str(ii), - backup=first, - **QCJob_kwargs)) - outdata = QCOutput(output_file + ".freq_" + str(ii)).data - errors = outdata.get("errors") - if len(errors) != 0: - raise AssertionError('No errors should be encountered while flattening frequencies!') - if outdata.get('frequencies')[0] > 0.0: - print("All frequencies positive!") - break - else: - num_neg_freqs += [sum(1 for freq in outdata.get('frequencies') if freq < 0)] - if len(num_neg_freqs) > 1: - if num_neg_freqs[-1] == num_neg_freqs[-2] and not reversed_direction: - reversed_direction = True - elif num_neg_freqs[-1] == num_neg_freqs[-2] and reversed_direction: - if len(num_neg_freqs) < 3: - raise AssertionError("ERROR: This should only be possible after at least three frequency flattening iterations! Exiting...") - else: - raise Exception("ERROR: Reversing the perturbation direction still could not flatten any frequencies. Exiting...") - elif num_neg_freqs[-1] != num_neg_freqs[-2] and reversed_direction: - reversed_direction = False - - negative_freq_vecs = outdata.get("frequency_mode_vectors")[0] - structure_successfully_perturbed = False - - for molecule_perturb_scale in np.arange( - max_molecule_perturb_scale, min_molecule_perturb_scale, - -perturb_scale_grid): - new_coords = perturb_coordinates( - old_coords=outdata.get("initial_geometry"), - negative_freq_vecs=negative_freq_vecs, - molecule_perturb_scale=molecule_perturb_scale, - reversed_direction=reversed_direction) - new_molecule = Molecule( - species=outdata.get('species'), - coords=new_coords, - charge=outdata.get('charge'), - spin_multiplicity=outdata.get('multiplicity')) - if check_connectivity: - old_molgraph = MoleculeGraph.with_local_env_strategy(outdata.get("initial_molecule"), - OpenBabelNN(), - reorder=False, - extend_structure=False) - new_molgraph = MoleculeGraph.with_local_env_strategy(new_molecule, - OpenBabelNN(), - reorder=False, - extend_structure=False) - if old_molgraph.isomorphic_to(new_molgraph): - structure_successfully_perturbed = True - break - if not structure_successfully_perturbed: - raise Exception( - "ERROR: Unable to perturb coordinates to remove negative frequency without changing the connectivity! Exiting..." - ) - - new_opt_QCInput = QCInput( - molecule=new_molecule, - rem=orig_opt_rem, - opt=orig_opt_input.opt, - pcm=orig_opt_input.pcm, - solvent=orig_opt_input.solvent) - new_opt_QCInput.write_file(input_file)
    - - -
    [docs]def perturb_coordinates(old_coords, negative_freq_vecs, molecule_perturb_scale, - reversed_direction): - max_dis = max( - [math.sqrt(sum([x**2 for x in vec])) for vec in negative_freq_vecs]) - scale = molecule_perturb_scale / max_dis - normalized_vecs = [[x * scale for x in vec] for vec in negative_freq_vecs] - direction = 1.0 - if reversed_direction: - direction = -1.0 - return [[c + v * direction for c, v in zip(coord, vec)] - for coord, vec in zip(old_coords, normalized_vecs)]
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/utils.html b/docs/html/_modules/custodian/utils.html deleted file mode 100644 index 2eaa52a8..00000000 --- a/docs/html/_modules/custodian/utils.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - custodian.utils — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.utils

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -"""
    -Utility function and classes.
    -"""
    -
    -
    -__author__ = "Shyue Ping Ong"
    -__copyright__ = "Copyright 2012, The Materials Project"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "shyuep@gmail.com"
    -__date__ = "1/12/14"
    -
    -from glob import glob
    -import logging
    -import os
    -import tarfile
    -
    -
    -
    [docs]def backup(filenames, prefix="error"): - """ - Backup files to a tar.gz file. Used, for example, in backing up the - files of an errored run before performing corrections. - - Args: - filenames ([str]): List of files to backup. Supports wildcards, e.g., - *.*. - prefix (str): prefix to the files. Defaults to error, which means a - series of error.1.tar.gz, error.2.tar.gz, ... will be generated. - """ - num = max([0] + [int(f.split(".")[1]) - for f in glob("{}.*.tar.gz".format(prefix))]) - filename = "{}.{}.tar.gz".format(prefix, num + 1) - logging.info("Backing up run to {}.".format(filename)) - with tarfile.open(filename, "w:gz") as tar: - for fname in filenames: - for f in glob(fname): - tar.add(f)
    - - -
    [docs]def get_execution_host_info(): - """ - Tries to return a tuple describing the execution host. - Doesn't work for all queueing systems - - Returns: - (HOSTNAME, CLUSTER_NAME) - """ - host = os.environ.get('HOSTNAME', None) - cluster = os.environ.get('SGE_O_HOST', None) - if host is None: - try: - import socket - host = host or socket.gethostname() - except: - pass - return host or 'unknown', cluster or 'unknown'
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/vasp/handlers.html b/docs/html/_modules/custodian/vasp/handlers.html deleted file mode 100644 index a928e363..00000000 --- a/docs/html/_modules/custodian/vasp/handlers.html +++ /dev/null @@ -1,1419 +0,0 @@ - - - - - - - custodian.vasp.handlers — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.vasp.handlers

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -from monty.os.path import zpath
    -import os
    -import time
    -import datetime
    -import operator
    -import shutil
    -import logging
    -from functools import reduce
    -from collections import Counter
    -import re
    -
    -import numpy as np
    -
    -from monty.dev import deprecated
    -from monty.serialization import loadfn
    -
    -from custodian.custodian import ErrorHandler
    -from custodian.utils import backup
    -from pymatgen.io.vasp import Poscar, VaspInput, Incar, Kpoints, Vasprun, \
    -    Oszicar, Outcar
    -from pymatgen.transformations.standard_transformations import \
    -    SupercellTransformation
    -
    -from custodian.ansible.interpreter import Modder
    -from custodian.ansible.actions import FileActions
    -from custodian.vasp.interpreter import VaspModder
    -
    -"""
    -This module implements specific error handlers for VASP runs. These handlers
    -tries to detect common errors in vasp runs and attempt to fix them on the fly
    -by modifying the input files.
    -"""
    -
    -__author__ = "Shyue Ping Ong, William Davidson Richards, Anubhav Jain, " \
    -             "Wei Chen, Stephen Dacek"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "ongsp@ucsd.edu"
    -__status__ = "Beta"
    -__date__ = "2/4/13"
    -
    -VASP_BACKUP_FILES = {"INCAR", "KPOINTS", "POSCAR", "OUTCAR", "CONTCAR",
    -                     "OSZICAR", "vasprun.xml", "vasp.out", "std_err.txt"}
    -
    -
    -
    [docs]class VaspErrorHandler(ErrorHandler): - """ - Master VaspErrorHandler class that handles a number of common errors - that occur during VASP runs. - """ - - is_monitor = True - - error_msgs = { - "tet": ["Tetrahedron method fails for NKPT<4", - "Fatal error detecting k-mesh", - "Fatal error: unable to match k-point", - "Routine TETIRR needs special values", - "Tetrahedron method fails (number of k-points < 4)"], - "inv_rot_mat": ["inverse of rotation matrix was not found (increase " - "SYMPREC)"], - "brmix": ["BRMIX: very serious problems"], - "subspacematrix": ["WARNING: Sub-Space-Matrix is not hermitian in " - "DAV"], - "tetirr": ["Routine TETIRR needs special values"], - "incorrect_shift": ["Could not get correct shifts"], - "real_optlay": ["REAL_OPTLAY: internal error", - "REAL_OPT: internal ERROR"], - "rspher": ["ERROR RSPHER"], - "dentet": ["DENTET"], - "too_few_bands": ["TOO FEW BANDS"], - "triple_product": ["ERROR: the triple product of the basis vectors"], - "rot_matrix": ["Found some non-integer element in rotation matrix"], - "brions": ["BRIONS problems: POTIM should be increased"], - "pricel": ["internal error in subroutine PRICEL"], - "zpotrf": ["LAPACK: Routine ZPOTRF failed"], - "amin": ["One of the lattice vectors is very long (>50 A), but AMIN"], - "zbrent": ["ZBRENT: fatal internal in", - "ZBRENT: fatal error in bracketing"], - "pssyevx": ["ERROR in subspace rotation PSSYEVX"], - "eddrmm": ["WARNING in EDDRMM: call to ZHEGV failed"], - "edddav": ["Error EDDDAV: Call to ZHEGV failed"], - "grad_not_orth": [ - "EDWAV: internal error, the gradient is not orthogonal"], - "nicht_konv": ["ERROR: SBESSELITER : nicht konvergent"], - "zheev": ["ERROR EDDIAG: Call to routine ZHEEV failed!"], - "elf_kpar": ["ELF: KPAR>1 not implemented"], - "elf_ncl": ["WARNING: ELF not implemented for non collinear case"], - "rhosyg": ["RHOSYG internal error"], - "posmap": ["POSMAP internal error: symmetry equivalent atom not found"], - "point_group": ["Error: point group operation missing"] - } - - def __init__(self, output_filename="vasp.out", natoms_large_cell=100, - errors_subset_to_catch=None): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the file where the stdout for vasp - is being redirected. The error messages that are checked are - present in the stdout. Defaults to "vasp.out", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - natoms_large_cell (int): Number of atoms threshold to treat cell - as large. Affects the correction of certain errors. Defaults to - 100. - errors_subset_to_detect (list): A subset of errors to catch. The - default is None, which means all supported errors are detected. - Use this to only catch only a subset of supported errors. - E.g., ["eddrrm", "zheev"] will only catch the eddrmm and zheev - errors, and not others. If you wish to only excluded one or - two of the errors, you can create this list by the following - lines: - - ``` - subset = list(VaspErrorHandler.error_msgs.keys()) - subset.pop("eddrrm") - - handler = VaspErrorHandler(errors_subset_to_catch=subset) - ``` - """ - self.output_filename = output_filename - self.errors = set() - self.error_count = Counter() - # threshold of number of atoms to treat the cell as large. - self.natoms_large_cell = natoms_large_cell - self.errors_subset_to_catch = errors_subset_to_catch or \ - list(VaspErrorHandler.error_msgs.keys()) - self.logger = logging.getLogger(self.__class__.__name__) - -
    [docs] def check(self): - incar = Incar.from_file("INCAR") - self.errors = set() - with open(self.output_filename, "r") as f: - for line in f: - l = line.strip() - for err, msgs in VaspErrorHandler.error_msgs.items(): - if err in self.errors_subset_to_catch: - for msg in msgs: - if l.find(msg) != -1: - # this checks if we want to run a charged - # computation (e.g., defects) if yes we don't - # want to kill it because there is a change in - # e-density (brmix error) - if err == "brmix" and 'NELECT' in incar: - continue - self.errors.add(err) - self.logger.error(msg, extra={"incar": incar.as_dict()}) - return len(self.errors) > 0
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - actions = [] - vi = VaspInput.from_directory(".") - - if self.errors.intersection(["tet", "dentet"]): - actions.append({"dict": "INCAR", - "action": {"_set": {"ISMEAR": 0, "SIGMA": 0.05}}}) - - if "inv_rot_mat" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-8}}}) - - if "brmix" in self.errors: - # If there is not a valid OUTCAR already, increment - # error count to 1 to skip first fix - if self.error_count['brmix'] == 0: - try: - assert (Outcar(zpath(os.path.join( - os.getcwd(), "OUTCAR"))).is_stopped is False) - except: - self.error_count['brmix'] += 1 - - if self.error_count['brmix'] == 0: - # Valid OUTCAR - simply rerun the job and increment - # error count for next time - actions.append({"dict": "INCAR", - "action": {"_set": {"ISTART": 1}}}) - self.error_count['brmix'] += 1 - - elif self.error_count['brmix'] == 1: - # Use Kerker mixing w/default values for other parameters - actions.append({"dict": "INCAR", - "action": {"_set": {"IMIX": 1}}}) - self.error_count['brmix'] += 1 - - elif self.error_count['brmix'] == 2 and vi["KPOINTS"].style \ - == Kpoints.supported_modes.Gamma: - actions.append({"dict": "KPOINTS", - "action": {"_set": {"generation_style": - "Monkhorst"}}}) - actions.append({"dict": "INCAR", - "action": {"_unset": {"IMIX": 1}}}) - self.error_count['brmix'] += 1 - - elif self.error_count['brmix'] in [2, 3] and vi["KPOINTS"].style \ - == Kpoints.supported_modes.Monkhorst: - actions.append({"dict": "KPOINTS", - "action": {"_set": {"generation_style": - "Gamma"}}}) - actions.append({"dict": "INCAR", - "action": {"_unset": {"IMIX": 1}}}) - self.error_count['brmix'] += 1 - - if vi["KPOINTS"].num_kpts < 1: - all_kpts_even = all([ - bool(n % 2 == 0) for n in vi["KPOINTS"].kpts[0] - ]) - if all_kpts_even: - new_kpts = ( - tuple(n + 1 for n in vi["KPOINTS"].kpts[0]),) - actions.append({"dict": "KPOINTS", "action": {"_set": { - "kpoints": new_kpts - }}}) - - else: - actions.append({"dict": "INCAR", - "action": {"_set": {"ISYM": 0}}}) - - if vi["KPOINTS"].style == Kpoints.supported_modes.Monkhorst: - actions.append({"dict": "KPOINTS", - "action": { - "_set": {"generation_style": "Gamma"}}}) - - # Based on VASP forum's recommendation, you should delete the - # CHGCAR and WAVECAR when dealing with this error. - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.append({"file": "CHGCAR", - "action": { - "_file_delete": {'mode': "actual"}}}) - actions.append({"file": "WAVECAR", - "action": { - "_file_delete": {'mode': "actual"}}}) - - if "zpotrf" in self.errors: - # Usually caused by short bond distances. If on the first step, - # volume needs to be increased. Otherwise, it was due to a step - # being too big and POTIM should be decreased. If a static run - # try turning off symmetry. - try: - oszicar = Oszicar("OSZICAR") - nsteps = len(oszicar.ionic_steps) - except: - nsteps = 0 - - if nsteps >= 1: - potim = float(vi["INCAR"].get("POTIM", 0.5)) / 2.0 - actions.append( - {"dict": "INCAR", - "action": {"_set": {"ISYM": 0, "POTIM": potim}}}) - elif vi["INCAR"].get("NSW", 0) == 0 \ - or vi["INCAR"].get("ISIF", 0) in range(3): - actions.append( - {"dict": "INCAR", "action": {"_set": {"ISYM": 0}}}) - else: - s = vi["POSCAR"].structure - s.apply_strain(0.2) - actions.append({"dict": "POSCAR", - "action": {"_set": {"structure": s.as_dict()}}}) - - # Based on VASP forum's recommendation, you should delete the - # CHGCAR and WAVECAR when dealing with this error. - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.append({"file": "CHGCAR", - "action": {"_file_delete": {'mode': "actual"}}}) - actions.append({"file": "WAVECAR", - "action": {"_file_delete": {'mode': "actual"}}}) - - if self.errors.intersection(["subspacematrix"]): - if self.error_count["subspacematrix"] == 0: - actions.append({"dict": "INCAR", - "action": {"_set": {"LREAL": False}}}) - else: - actions.append({"dict": "INCAR", - "action": {"_set": {"PREC": "Accurate"}}}) - self.error_count["subspacematrix"] += 1 - - if self.errors.intersection(["rspher", "real_optlay", "nicht_konv"]): - s = vi["POSCAR"].structure - if len(s) < self.natoms_large_cell: - actions.append({"dict": "INCAR", - "action": {"_set": {"LREAL": False}}}) - else: - # for large supercell, try an in-between option LREAL = True - # prior to LREAL = False - if self.error_count['real_optlay'] == 0: - # use real space projectors generated by pot - actions.append({"dict": "INCAR", - "action": {"_set": {"LREAL": True}}}) - elif self.error_count['real_optlay'] == 1: - actions.append({"dict": "INCAR", - "action": {"_set": {"LREAL": False}}}) - self.error_count['real_optlay'] += 1 - - if self.errors.intersection(["tetirr", "incorrect_shift"]): - - if vi["KPOINTS"].style == Kpoints.supported_modes.Monkhorst: - actions.append({"dict": "KPOINTS", - "action": { - "_set": {"generation_style": "Gamma"}}}) - - if "rot_matrix" in self.errors: - if vi["KPOINTS"].style == Kpoints.supported_modes.Monkhorst: - actions.append({"dict": "KPOINTS", - "action": { - "_set": {"generation_style": "Gamma"}}}) - else: - actions.append({"dict": "INCAR", - "action": {"_set": {"ISYM": 0}}}) - - if "amin" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"AMIN": "0.01"}}}) - - if "triple_product" in self.errors: - s = vi["POSCAR"].structure - trans = SupercellTransformation(((1, 0, 0), (0, 0, 1), (0, 1, 0))) - new_s = trans.apply_transformation(s) - actions.append({"dict": "POSCAR", - "action": {"_set": {"structure": new_s.as_dict()}}, - "transformation": trans.as_dict()}) - - if "pricel" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-8, "ISYM": 0}}}) - - if "brions" in self.errors: - potim = float(vi["INCAR"].get("POTIM", 0.5)) + 0.1 - actions.append({"dict": "INCAR", - "action": {"_set": {"POTIM": potim}}}) - - if "zbrent" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"IBRION": 1}}}) - actions.append({"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}) - - if "too_few_bands" in self.errors: - if "NBANDS" in vi["INCAR"]: - nbands = int(vi["INCAR"]["NBANDS"]) - else: - with open("OUTCAR") as f: - for line in f: - if "NBANDS" in line: - try: - d = line.split("=") - nbands = int(d[-1].strip()) - break - except (IndexError, ValueError): - pass - actions.append({"dict": "INCAR", - "action": {"_set": {"NBANDS": int(1.1 * nbands)}}}) - - if "pssyevx" in self.errors: - actions.append({"dict": "INCAR", "action": - {"_set": {"ALGO": "Normal"}}}) - if "eddrmm" in self.errors: - # RMM algorithm is not stable for this calculation - if vi["INCAR"].get("ALGO", "Normal") in ["Fast", "VeryFast"]: - actions.append({"dict": "INCAR", "action": - {"_set": {"ALGO": "Normal"}}}) - else: - potim = float(vi["INCAR"].get("POTIM", 0.5)) / 2.0 - actions.append({"dict": "INCAR", - "action": {"_set": {"POTIM": potim}}}) - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.append({"file": "CHGCAR", - "action": {"_file_delete": {'mode': "actual"}}}) - actions.append({"file": "WAVECAR", - "action": {"_file_delete": {'mode': "actual"}}}) - - if "edddav" in self.errors: - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.append({"file": "CHGCAR", - "action": {"_file_delete": {'mode': "actual"}}}) - actions.append({"dict": "INCAR", "action": - {"_set": {"ALGO": "All"}}}) - - if "grad_not_orth" in self.errors: - if vi["INCAR"].get("ISMEAR", 1) < 0: - actions.append({"dict": "INCAR", - "action": {"_set": {"ISMEAR": 0, "SIGMA": 0.05}}}) - - if "zheev" in self.errors: - if vi["INCAR"].get("ALGO", "Fast").lower() != "exact": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Exact"}}}) - if "elf_kpar" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"KPAR": 1}}}) - - if "rhosyg" in self.errors: - if vi["INCAR"].get("SYMPREC", 1e-4) == 1e-4: - actions.append({"dict": "INCAR", - "action": {"_set": {"ISYM": 0}}}) - actions.append({"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-4}}}) - - if "posmap" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-6}}}) - - if "point_group" in self.errors: - actions.append({"dict": "INCAR", - "action": {"_set": {"ISYM": 0}}}) - - VaspModder(vi=vi).apply_actions(actions) - return {"errors": list(self.errors), "actions": actions}
    - - -
    [docs]class LrfCommutatorHandler(ErrorHandler): - """ - Corrects LRF_COMMUTATOR errors by setting LPEAD=True if not already set. - Note that switching LPEAD=T can slightly change results versus the - default due to numerical evaluation of derivatives. - """ - - is_monitor = True - - error_msgs = { - "lrf_comm": ["LRF_COMMUTATOR internal error"], - } - - def __init__(self, output_filename="std_err.txt"): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the file where the stderr for vasp - is being redirected. The error messages that are checked are - present in the stderr. Defaults to "std_err.txt", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - """ - self.output_filename = output_filename - self.errors = set() - self.error_count = Counter() - -
    [docs] def check(self): - self.errors = set() - with open(self.output_filename, "r") as f: - for line in f: - l = line.strip() - for err, msgs in LrfCommutatorHandler.error_msgs.items(): - for msg in msgs: - if l.find(msg) != -1: - self.errors.add(err) - return len(self.errors) > 0
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - actions = [] - vi = VaspInput.from_directory(".") - - if "lrf_comm" in self.errors: - if Outcar(zpath(os.path.join( - os.getcwd(), "OUTCAR"))).is_stopped is False: - if not vi["INCAR"].get("LPEAD"): - actions.append({"dict": "INCAR", - "action": {"_set": {"LPEAD": True}}}) - - VaspModder(vi=vi).apply_actions(actions) - return {"errors": list(self.errors), "actions": actions}
    - - -
    [docs]class StdErrHandler(ErrorHandler): - """ - Master StdErr class that handles a number of common errors - that occur during VASP runs with error messages only in - the standard error. - """ - - is_monitor = True - - error_msgs = { - "kpoints_trans": ["internal error in GENERATE_KPOINTS_TRANS: " - "number of G-vector changed in star"], - "out_of_memory": ["Allocation would exceed memory limit"] - } - - def __init__(self, output_filename="std_err.txt"): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the file where the stderr for vasp - is being redirected. The error messages that are checked are - present in the stderr. Defaults to "std_err.txt", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - """ - self.output_filename = output_filename - self.errors = set() - self.error_count = Counter() - -
    [docs] def check(self): - self.errors = set() - with open(self.output_filename, "r") as f: - for line in f: - l = line.strip() - for err, msgs in StdErrHandler.error_msgs.items(): - for msg in msgs: - if l.find(msg) != -1: - self.errors.add(err) - return len(self.errors) > 0
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - actions = [] - vi = VaspInput.from_directory(".") - - if "kpoints_trans" in self.errors: - if self.error_count["kpoints_trans"] == 0: - m = reduce(operator.mul, vi["KPOINTS"].kpts[0]) - m = max(int(round(m ** (1 / 3))), 1) - if vi["KPOINTS"].style.name.lower().startswith("m"): - m += m % 2 - actions.append({"dict": "KPOINTS", - "action": {"_set": {"kpoints": [[m] * 3]}}}) - self.error_count['kpoints_trans'] += 1 - - if "out_of_memory" in self.errors: - if vi["INCAR"].get("KPAR", 1) > 1: - reduced_kpar = max(vi["INCAR"].get("KPAR", 1) // 2, 1) - actions.append({"dict": "INCAR", - "action": {"_set": {"KPAR": reduced_kpar}}}) - - VaspModder(vi=vi).apply_actions(actions) - return {"errors": list(self.errors), "actions": actions}
    - - -
    [docs]class AliasingErrorHandler(ErrorHandler): - """ - Master VaspErrorHandler class that handles a number of common errors - that occur during VASP runs. - """ - - is_monitor = True - - error_msgs = { - "aliasing": [ - "WARNING: small aliasing (wrap around) errors must be expected"], - "aliasing_incar": ["Your FFT grids (NGX,NGY,NGZ) are not sufficient " - "for an accurate"] - } - - def __init__(self, output_filename="vasp.out"): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the file where the stdout for vasp - is being redirected. The error messages that are checked are - present in the stdout. Defaults to "vasp.out", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - """ - self.output_filename = output_filename - self.errors = set() - -
    [docs] def check(self): - incar = Incar.from_file("INCAR") - self.errors = set() - with open(self.output_filename, "r") as f: - for line in f: - l = line.strip() - for err, msgs in AliasingErrorHandler.error_msgs.items(): - for msg in msgs: - if l.find(msg) != -1: - # this checks if we want to run a charged - # computation (e.g., defects) if yes we don't - # want to kill it because there is a change in e- - # density (brmix error) - if err == "brmix" and 'NELECT' in incar: - continue - self.errors.add(err) - return len(self.errors) > 0
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - actions = [] - vi = VaspInput.from_directory(".") - - if "aliasing" in self.errors: - with open("OUTCAR") as f: - grid_adjusted = False - changes_dict = {} - r = re.compile(".+aliasing errors.*(NG.)\s*to\s*(\d+)") - for line in f: - m = r.match(line) - if m: - changes_dict[m.group(1)] = int(m.group(2)) - grid_adjusted = True - # Ensure that all NGX, NGY, NGZ have been checked - if grid_adjusted and 'NGZ' in line: - actions.append( - {"dict": "INCAR", "action": {"_set": changes_dict}}) - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.extend([{"file": "CHGCAR", - "action": {"_file_delete": { - 'mode': "actual"}}}, - {"file": "WAVECAR", - "action": {"_file_delete": { - 'mode': "actual"}}}]) - break - - if "aliasing_incar" in self.errors: - # vasp seems to give different warnings depending on whether the - # aliasing error was caused by user supplied inputs - d = {k: 1 for k in ['NGX', 'NGY', 'NGZ'] if k in vi['INCAR'].keys()} - actions.append({"dict": "INCAR", "action": {"_unset": d}}) - - if vi["INCAR"].get("ICHARG", 0) < 10: - actions.extend([{"file": "CHGCAR", - "action": { - "_file_delete": {'mode': "actual"}}}, - {"file": "WAVECAR", - "action": { - "_file_delete": {'mode': "actual"}}}]) - - VaspModder(vi=vi).apply_actions(actions) - return {"errors": list(self.errors), "actions": actions}
    - - -
    [docs]class DriftErrorHandler(ErrorHandler): - """ - Corrects for total drift exceeding the force convergence criteria. - """ - - def __init__(self, max_drift=None, to_average=3, enaug_multiply=2): - """ - Initializes the handler with max drift - Args: - max_drift (float): This defines the max drift. Leaving this at the default of None gets the max_drift from EDFIFFG - """ - - self.max_drift = max_drift - self.to_average = int(to_average) - self.enaug_multiply = enaug_multiply - -
    [docs] def check(self): - - incar = Incar.from_file("INCAR") - if incar.get("EDIFFG", 0.1) >= 0 or incar.get("NSW", 0) == 0: - # Only activate when force relaxing and ionic steps - # NSW check prevents accidental effects when running DFPT - return False - - if not self.max_drift: - self.max_drift = incar["EDIFFG"] * -1 - - try: - outcar = Outcar("OUTCAR") - except: - # Can't perform check if Outcar not valid - return False - - if len(outcar.data.get('drift', [])) < self.to_average: - # Ensure enough steps to get average drift - return False - else: - curr_drift = outcar.data.get("drift", [])[::-1][:self.to_average] - curr_drift = np.average([np.linalg.norm(d) for d in curr_drift]) - return curr_drift > self.max_drift
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES) - actions = [] - vi = VaspInput.from_directory(".") - - incar = vi["INCAR"] - outcar = Outcar("OUTCAR") - - # Move CONTCAR to POSCAR - actions.append({"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}) - - # First try adding ADDGRID - if not incar.get("ADDGRID", False): - actions.append({"dict": "INCAR", - "action": {"_set": {"ADDGRID": True}}}) - # Otherwise set PREC to High so ENAUG can be used to control Augmentation Grid Size - elif incar.get("PREC", "Accurate").lower() != "high": - actions.append({"dict": "INCAR", - "action": {"_set": {"PREC": "High"}}}) - actions.append({"dict": "INCAR", - "action": {"_set": {"ENAUG": incar.get("ENCUT", 520) * 2}}}) - # PREC is already high and ENAUG set so just increase it - else: - actions.append({"dict": "INCAR", - "action": {"_set": {"ENAUG": int(incar.get("ENAUG", 1040) * self.enaug_multiply)}}}) - - curr_drift = outcar.data.get("drift", [])[::-1][:self.to_average] - curr_drift = np.average([np.linalg.norm(d) for d in curr_drift]) - VaspModder(vi=vi).apply_actions(actions) - return {"errors": "Excessive drift {} > {}".format(curr_drift, self.max_drift), "actions": actions}
    - - -
    [docs]class MeshSymmetryErrorHandler(ErrorHandler): - """ - Corrects the mesh symmetry error in VASP. This error is sometimes - non-fatal. So this error handler only checks at the end of the run, - and if the run has converged, no error is recorded. - """ - is_monitor = False - - def __init__(self, output_filename="vasp.out", - output_vasprun="vasprun.xml"): - """ - Initializes the handler with the output files to check. - - Args: - output_filename (str): This is the file where the stdout for vasp - is being redirected. The error messages that are checked are - present in the stdout. Defaults to "vasp.out", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - output_vasprun (str): Filename for the vasprun.xml file. Change - this only if it is different from the default (unlikely). - """ - self.output_filename = output_filename - self.output_vasprun = output_vasprun - -
    [docs] def check(self): - msg = "Reciprocal lattice and k-lattice belong to different class of" \ - " lattices." - - vi = VaspInput.from_directory('.') - # According to VASP admins, you can disregard this error - # if symmetry is off - # Also disregard if automatic KPOINT generation is used - if (not vi["INCAR"].get('ISYM', True)) or \ - vi[ - "KPOINTS"].style == Kpoints.supported_modes.Automatic: - return False - - try: - v = Vasprun(self.output_vasprun) - if v.converged: - return False - except: - pass - with open(self.output_filename, "r") as f: - for line in f: - l = line.strip() - if l.find(msg) != -1: - return True - return False
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - vi = VaspInput.from_directory(".") - m = reduce(operator.mul, vi["KPOINTS"].kpts[0]) - m = max(int(round(m ** (1 / 3))), 1) - if vi["KPOINTS"].style.name.lower().startswith("m"): - m += m % 2 - actions = [{"dict": "KPOINTS", - "action": {"_set": {"kpoints": [[m] * 3]}}}] - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["mesh_symmetry"], "actions": actions}
    - - -
    [docs]class UnconvergedErrorHandler(ErrorHandler): - """ - Check if a run is converged. - """ - is_monitor = False - - def __init__(self, output_filename="vasprun.xml"): - """ - Initializes the handler with the output file to check. - - Args: - output_vasprun (str): Filename for the vasprun.xml file. Change - this only if it is different from the default (unlikely). - """ - self.output_filename = output_filename - -
    [docs] def check(self): - try: - v = Vasprun(self.output_filename) - if not v.converged: - return True - except: - pass - return False
    - -
    [docs] def correct(self): - v = Vasprun(self.output_filename) - actions = [] - if not v.converged_electronic: - # Ladder from VeryFast to Fast to Fast to All - # These progressively switches to more stable but more - # expensive algorithms - algo = v.incar.get("ALGO", "Normal") - if algo == "VeryFast": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Fast"}}}) - elif algo == "Fast": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Normal"}}}) - elif algo == "Normal": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "All"}}}) - else: - # Try mixing as last resort - new_settings = {"ISTART": 1, - "ALGO": "Normal", - "NELMDL": -6, - "BMIX": 0.001, - "AMIX_MAG": 0.8, - "BMIX_MAG": 0.001} - - if not all([v.incar.get(k, "") == val for k, val in new_settings.items()]): - actions.append({"dict": "INCAR", - "action": {"_set": new_settings}}) - - elif not v.converged_ionic: - # Just continue optimizing and let other handles fix ionic - # optimizer parameters - actions.append({"dict": "INCAR", - "action": {"_set": {"IBRION": 1}}}) - actions.append({"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}) - - if actions: - vi = VaspInput.from_directory(".") - backup(VASP_BACKUP_FILES) - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["Unconverged"], "actions": actions} - else: - # Unfixable error. Just return None for actions. - return {"errors": ["Unconverged"], "actions": None}
    - - -
    [docs]class MaxForceErrorHandler(ErrorHandler): - """ - Checks that the desired force convergence has been achieved. Otherwise - restarts the run with smaller EDIFF. (This is necessary since energy - and force convergence criteria cannot be set simultaneously) - """ - is_monitor = False - - def __init__(self, output_filename="vasprun.xml", - max_force_threshold=0.25): - """ - Args: - input_filename (str): name of the vasp INCAR file - output_filename (str): name to look for the vasprun - max_force_threshold (float): Threshold for max force for - restarting the run. (typically should be set to the value - that the creator looks for) - """ - self.output_filename = output_filename - self.max_force_threshold = max_force_threshold - -
    [docs] def check(self): - try: - v = Vasprun(self.output_filename) - forces = np.array(v.ionic_steps[-1]['forces']) - sdyn = v.final_structure.site_properties.get('selective_dynamics') - if sdyn: - forces[np.logical_not(sdyn)] = 0 - max_force = max(np.linalg.norm(forces, axis=1)) - if max_force > self.max_force_threshold and v.converged is True: - return True - except: - pass - return False
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - vi = VaspInput.from_directory(".") - ediff = float(vi["INCAR"].get("EDIFF", 1e-4)) - ediffg = float(vi["INCAR"].get("EDIFFG", ediff * 10)) - actions = [{"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}, - {"dict": "INCAR", - "action": {"_set": {"EDIFFG": ediffg * 0.5}}}] - VaspModder(vi=vi).apply_actions(actions) - - return {"errors": ["MaxForce"], "actions": actions}
    - - -
    [docs]class PotimErrorHandler(ErrorHandler): - """ - Check if a run has excessively large positive energy changes. - This is typically caused by too large a POTIM. Runs typically - end up crashing with some other error (e.g. BRMIX) as the geometry - gets progressively worse. - """ - is_monitor = True - - def __init__(self, input_filename="POSCAR", output_filename="OSZICAR", - dE_threshold=1): - """ - Initializes the handler with the input and output files to check. - - Args: - input_filename (str): This is the POSCAR file that the run - started from. Defaults to "POSCAR". Change - this only if it is different from the default (unlikely). - output_filename (str): This is the OSZICAR file. Change - this only if it is different from the default (unlikely). - dE_threshold (float): The threshold energy change. Defaults to 1eV. - """ - self.input_filename = input_filename - self.output_filename = output_filename - self.dE_threshold = dE_threshold - -
    [docs] def check(self): - try: - oszicar = Oszicar(self.output_filename) - n = len(Poscar.from_file(self.input_filename).structure) - max_dE = max([s['dE'] for s in oszicar.ionic_steps[1:]]) / n - if max_dE > self.dE_threshold: - return True - except: - return False
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES) - vi = VaspInput.from_directory(".") - potim = float(vi["INCAR"].get("POTIM", 0.5)) - ibrion = int(vi["INCAR"].get("IBRION", 0)) - if potim < 0.2 and ibrion != 3: - actions = [{"dict": "INCAR", - "action": {"_set": {"IBRION": 3, - "SMASS": 0.75}}}] - elif potim < 0.1: - actions = [{"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-8}}}] - else: - actions = [{"dict": "INCAR", - "action": {"_set": {"POTIM": potim * 0.5}}}] - - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["POTIM"], "actions": actions}
    - - -
    [docs]class FrozenJobErrorHandler(ErrorHandler): - """ - Detects an error when the output file has not been updated - in timeout seconds. Changes ALGO to Normal from Fast - """ - - is_monitor = True - - def __init__(self, output_filename="vasp.out", timeout=21600): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the file where the stdout for vasp - is being redirected. The error messages that are checked are - present in the stdout. Defaults to "vasp.out", which is the - default redirect used by :class:`custodian.vasp.jobs.VaspJob`. - timeout (int): The time in seconds between checks where if there - is no activity on the output file, the run is considered - frozen. Defaults to 3600 seconds, i.e., 1 hour. - """ - self.output_filename = output_filename - self.timeout = timeout - -
    [docs] def check(self): - st = os.stat(self.output_filename) - if time.time() - st.st_mtime > self.timeout: - return True
    - -
    [docs] def correct(self): - backup(VASP_BACKUP_FILES | {self.output_filename}) - - vi = VaspInput.from_directory('.') - actions = [] - if vi["INCAR"].get("ALGO", "Normal") == "Fast": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Normal"}}}) - else: - actions.append({"dict": "INCAR", - "action": {"_set": {"SYMPREC": 1e-8}}}) - - VaspModder(vi=vi).apply_actions(actions) - - return {"errors": ["Frozen job"], "actions": actions}
    - - -
    [docs]class NonConvergingErrorHandler(ErrorHandler): - """ - Check if a run is hitting the maximum number of electronic steps at the - last nionic_steps ionic steps (default=10). If so, change ALGO from Fast to - Normal or kill the job. - """ - is_monitor = True - - def __init__(self, output_filename="OSZICAR", nionic_steps=10): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the OSZICAR file. Change - this only if it is different from the default (unlikely). - nionic_steps (int): The threshold number of ionic steps that - needs to hit the maximum number of electronic steps for the - run to be considered non-converging. - """ - self.output_filename = output_filename - self.nionic_steps = nionic_steps - -
    [docs] def check(self): - vi = VaspInput.from_directory(".") - nelm = vi["INCAR"].get("NELM", 60) - try: - oszicar = Oszicar(self.output_filename) - esteps = oszicar.electronic_steps - if len(esteps) > self.nionic_steps: - return all([len(e) == nelm - for e in esteps[-(self.nionic_steps + 1):-1]]) - except: - pass - return False
    - -
    [docs] def correct(self): - vi = VaspInput.from_directory(".") - algo = vi["INCAR"].get("ALGO", "Normal") - amix = vi["INCAR"].get("AMIX", 0.4) - bmix = vi["INCAR"].get("BMIX", 1.0) - amin = vi["INCAR"].get("AMIN", 0.1) - actions = [] - # Ladder from VeryFast to Fast to Fast to All - # These progressively switches to more stable but more - # expensive algorithms - if algo == "VeryFast": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Fast"}}}) - elif algo == "Fast": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "Normal"}}}) - elif algo == "Normal": - actions.append({"dict": "INCAR", - "action": {"_set": {"ALGO": "All"}}}) - elif amix > 0.1 and bmix > 0.01: - # Try linear mixing - actions.append({"dict": "INCAR", - "action": {"_set": {"AMIX": 0.1, "BMIX": 0.01, - "ICHARG": 2}}}) - elif bmix < 3.0 and amin > 0.01: - # Try increasing bmix - actions.append({"dict": "INCAR", - "action": {"_set": {"AMIN": 0.01, "BMIX": 3.0, - "ICHARG": 2}}}) - - if actions: - backup(VASP_BACKUP_FILES) - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["Non-converging job"], "actions": actions} - # Unfixable error. Just return None for actions. - else: - return {"errors": ["Non-converging job"], "actions": None}
    - -
    [docs]class WalltimeHandler(ErrorHandler): - """ - Check if a run is nearing the walltime. If so, write a STOPCAR with - LSTOP or LABORT = .True.. You can specify the walltime either in the init ( - which is unfortunately necessary for SGE and SLURM systems. If you happen - to be running on a PBS system and the PBS_WALLTIME variable is in the run - environment, the wall time will be automatically determined if not set. - """ - is_monitor = True - - # The WalltimeHandler should not terminate as we want VASP to terminate - # itself naturally with the STOPCAR. - is_terminating = False - - # This handler will be unrecoverable, but custodian shouldn't raise an - # error - raises_runtime_error = False - - def __init__(self, wall_time=None, buffer_time=300, - electronic_step_stop=False): - """ - Initializes the handler with a buffer time. - - Args: - wall_time (int): Total walltime in seconds. If this is None and - the job is running on a PBS system, the handler will attempt to - determine the walltime from the PBS_WALLTIME environment - variable. If the wall time cannot be determined or is not - set, this handler will have no effect. - buffer_time (int): The min amount of buffer time in secs at the - end that the STOPCAR will be written. The STOPCAR is written - when the time remaining is < the higher of 3 x the average - time for each ionic step and the buffer time. Defaults to - 300 secs, which is the default polling time of Custodian. - This is typically sufficient for the current ionic step to - complete. But if other operations are being performed after - the run has stopped, the buffer time may need to be increased - accordingly. - electronic_step_stop (bool): Whether to check for electronic steps - instead of ionic steps (e.g. for static runs on large systems or - static HSE runs, ...). Be careful that results such as density - or wavefunctions might not be converged at the electronic level. - Should be used with LWAVE = .True. to be useful. If this is - True, the STOPCAR is written with LABORT = .TRUE. instead of - LSTOP = .TRUE. - """ - if wall_time is not None: - self.wall_time = wall_time - elif "PBS_WALLTIME" in os.environ: - self.wall_time = int(os.environ["PBS_WALLTIME"]) - elif "SBATCH_TIMELIMIT" in os.environ: - self.wall_time = int(os.environ["SBATCH_TIMELIMIT"]) - else: - self.wall_time = None - self.buffer_time = buffer_time - # Sets CUSTODIAN_WALLTIME_START as the start time to use for - # future jobs in the same batch environment. Can also be - # set manually be the user in the batch environment. - if "CUSTODIAN_WALLTIME_START" in os.environ: - self.start_time = datetime.datetime.strptime( - os.environ["CUSTODIAN_WALLTIME_START"], "%a %b %d %H:%M:%S %Z %Y") - else: - self.start_time = datetime.datetime.now() - os.environ["CUSTODIAN_WALLTIME_START"] = datetime.datetime.strftime( - self.start_time, "%a %b %d %H:%M:%S UTC %Y") - - self.electronic_step_stop = electronic_step_stop - self.electronic_steps_timings = [0] - self.prev_check_time = self.start_time - -
    [docs] def check(self): - if self.wall_time: - run_time = datetime.datetime.now() - self.start_time - total_secs = run_time.total_seconds() - outcar = Outcar("OUTCAR") - if not self.electronic_step_stop: - # Determine max time per ionic step. - outcar.read_pattern({"timings": "LOOP\+.+real time(.+)"}, - postprocess=float) - time_per_step = np.max(outcar.data.get('timings')) if outcar.data.get("timings", []) else 0 - else: - # Determine max time per electronic step. - outcar.read_pattern({"timings": "LOOP:.+real time(.+)"}, - postprocess=float) - time_per_step = np.max(outcar.data.get('timings')) if outcar.data.get("timings", []) else 0 - - # If the remaining time is less than average time for 3 - # steps or buffer_time. - time_left = self.wall_time - total_secs - if time_left < max(time_per_step * 3, self.buffer_time): - return True - - return False
    - -
    [docs] def correct(self): - - content = "LSTOP = .TRUE." if not self.electronic_step_stop else \ - "LABORT = .TRUE." - # Write STOPCAR - actions = [{"file": "STOPCAR", - "action": {"_file_create": {'content': content}}}] - - m = Modder(actions=[FileActions]) - for a in actions: - m.modify(a["action"], a["file"]) - return {"errors": ["Walltime reached"], "actions": None}
    - - -@deprecated(replacement=WalltimeHandler) -class PBSWalltimeHandler(WalltimeHandler): - - def __init__(self, buffer_time=300): - super(PBSWalltimeHandler, self).__init__(None, buffer_time=buffer_time) - - -
    [docs]class CheckpointHandler(ErrorHandler): - """ - This is not an error handler per se, but rather a checkpointer. What this - does is that every X seconds, a STOPCAR and CHKPT will be written. This - forces VASP to stop at the end of the next ionic step. The files are then - copied into a subdir, and then the job is restarted. To use this proper, - max_errors in Custodian must be set to a very high value, and you - probably wouldn't want to use any standard VASP error handlers. The - checkpoint will be stored in subdirs chk_#. This should be used in - combiantion with the StoppedRunHandler. - """ - is_monitor = True - - # The CheckpointHandler should not terminate as we want VASP to terminate - # itself naturally with the STOPCAR. - is_terminating = False - - def __init__(self, interval=3600): - """ - Initializes the handler with an interval. - - Args: - interval (int): Interval at which to checkpoint in seconds. - Defaults to 3600 (1 hr). - """ - self.interval = interval - self.start_time = datetime.datetime.now() - self.chk_counter = 0 - -
    [docs] def check(self): - run_time = datetime.datetime.now() - self.start_time - total_secs = run_time.seconds + run_time.days * 3600 * 24 - if total_secs > self.interval: - return True - return False
    - -
    [docs] def correct(self): - content = "LSTOP = .TRUE." - chkpt_content = "Index: %d\nTime: \"%s\"" % (self.chk_counter, - datetime.datetime.now()) - self.chk_counter += 1 - - # Write STOPCAR - actions = [{"file": "STOPCAR", - "action": {"_file_create": {'content': content}}}, - {"file": "chkpt.yaml", - "action": {"_file_create": {'content': chkpt_content}}}] - - m = Modder(actions=[FileActions]) - for a in actions: - m.modify(a["action"], a["file"]) - - # Reset the clock. - self.start_time = datetime.datetime.now() - - return {"errors": ["Checkpoint reached"], "actions": actions}
    - - def __str__(self): - return "CheckpointHandler with interval %d" % self.interval
    - - -
    [docs]class StoppedRunHandler(ErrorHandler): - """ - This is not an error handler per se, but rather a checkpointer. What this - does is that every X seconds, a STOPCAR will be written. This forces VASP to - stop at the end of the next ionic step. The files are then copied into a - subdir, and then the job is restarted. To use this proper, max_errors in - Custodian must be set to a very high value, and you probably wouldn't - want to use any standard VASP error handlers. The checkpoint will be - stored in subdirs chk_#. This should be used in combination with the - StoppedRunHandler. - """ - is_monitor = False - - # The CheckpointHandler should not terminate as we want VASP to terminate - # itself naturally with the STOPCAR. - is_terminating = False - - def __init__(self): - pass - -
    [docs] def check(self): - return os.path.exists("chkpt.yaml")
    - -
    [docs] def correct(self): - d = loadfn("chkpt.yaml") - i = d["Index"] - name = shutil.make_archive( - os.path.join(os.getcwd(), "vasp.chk.%d" % i), "gztar") - - actions = [{"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - - m = Modder(actions=[FileActions]) - for a in actions: - m.modify(a["action"], a["file"]) - - actions.append({"Checkpoint": name}) - - return {"errors": ["Stopped run."], - "actions": actions}
    - - -
    [docs]class PositiveEnergyErrorHandler(ErrorHandler): - """ - Check if a run has positive absolute energy. - If so, change ALGO from Fast to Normal or kill the job. - """ - is_monitor = True - - def __init__(self, output_filename="OSZICAR"): - """ - Initializes the handler with the output file to check. - - Args: - output_filename (str): This is the OSZICAR file. Change - this only if it is different from the default (unlikely). - """ - self.output_filename = output_filename - -
    [docs] def check(self): - try: - oszicar = Oszicar(self.output_filename) - if oszicar.final_energy > 0: - return True - except: - pass - return False
    - -
    [docs] def correct(self): - # change ALGO = Fast to Normal if ALGO is !Normal - vi = VaspInput.from_directory(".") - algo = vi["INCAR"].get("ALGO", "Normal") - if algo.lower() not in ['normal', 'n']: - backup(VASP_BACKUP_FILES) - actions = [{"dict": "INCAR", - "action": {"_set": {"ALGO": "Normal"}}}] - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["Positive energy"], "actions": actions} - elif algo == "Normal": - potim = float(vi["INCAR"].get("POTIM", 0.5)) / 2.0 - actions = [{"dict": "INCAR", - "action": {"_set": {"POTIM": potim}}}] - VaspModder(vi=vi).apply_actions(actions) - return {"errors": ["Positive energy"], "actions": actions} - # Unfixable error. Just return None for actions. - else: - return {"errors": ["Positive energy"], "actions": None}
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/vasp/interpreter.html b/docs/html/_modules/custodian/vasp/interpreter.html deleted file mode 100644 index cab14a4a..00000000 --- a/docs/html/_modules/custodian/vasp/interpreter.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - custodian.vasp.interpreter — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.vasp.interpreter

    -# coding: utf-8
    -
    -from __future__ import unicode_literals
    -
    -from custodian.ansible.actions import FileActions, DictActions
    -from custodian.ansible.interpreter import Modder
    -from pymatgen.io.vasp import VaspInput
    -
    -
    -
    [docs]class VaspModder(Modder): - def __init__(self, actions=None, strict=True, vi=None): - """ - Initializes a Modder for VaspInput sets - - Args: - actions ([Action]): A sequence of supported actions. See - :mod:`custodian.ansible.actions`. Default is None, - which means DictActions and FileActions are supported. - strict (bool): Indicating whether to use strict mode. In non-strict - mode, unsupported actions are simply ignored without any - errors raised. In strict mode, if an unsupported action is - supplied, a ValueError is raised. Defaults to True. - vi (VaspInput): A VaspInput object from the current directory. - Initialized automatically if not passed (but passing it will - avoid having to reparse the directory). - """ - self.vi = vi or VaspInput.from_directory('.') - actions = actions or [FileActions, DictActions] - super(VaspModder, self).__init__(actions, strict) - -
    [docs] def apply_actions(self, actions): - """ - Applies a list of actions to the Vasp Input Set and rewrites modified - files. - Args: - actions [dict]: A list of actions of the form {'file': filename, - 'action': moddermodification} or {'dict': vaspinput_key, - 'action': moddermodification} - """ - modified = [] - for a in actions: - if "dict" in a: - k = a["dict"] - modified.append(k) - self.vi[k] = self.modify_object(a["action"], self.vi[k]) - elif "file" in a: - self.modify(a["action"], a["file"]) - else: - raise ValueError("Unrecognized format: {}".format(a)) - for f in modified: - self.vi[f].write_file(f)
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/vasp/jobs.html b/docs/html/_modules/custodian/vasp/jobs.html deleted file mode 100644 index 528c0dc6..00000000 --- a/docs/html/_modules/custodian/vasp/jobs.html +++ /dev/null @@ -1,939 +0,0 @@ - - - - - - - custodian.vasp.jobs — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.vasp.jobs

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -import subprocess
    -import os
    -import shutil
    -import math
    -import logging
    -
    -import numpy as np
    -
    -from pymatgen import Structure
    -from pymatgen.io.vasp import VaspInput, Incar, Poscar, Outcar, Kpoints, Vasprun
    -from monty.os.path import which
    -from monty.shutil import decompress_dir
    -from monty.serialization import dumpfn, loadfn
    -
    -from custodian.custodian import Job, SENTRY_DSN
    -from custodian.utils import backup
    -from custodian.vasp.interpreter import VaspModder
    -from custodian.vasp.handlers import VASP_BACKUP_FILES
    -
    -"""
    -This module implements basic kinds of jobs for VASP runs.
    -"""
    -
    -
    -logger = logging.getLogger(__name__)
    -
    -
    -__author__ = "Shyue Ping Ong"
    -__version__ = "0.1"
    -__maintainer__ = "Shyue Ping Ong"
    -__email__ = "shyuep@gmail.com"
    -__status__ = "Beta"
    -__date__ = "2/4/13"
    -
    -
    -VASP_INPUT_FILES = {"INCAR", "POSCAR", "POTCAR", "KPOINTS"}
    -
    -VASP_OUTPUT_FILES = ['DOSCAR', 'INCAR', 'KPOINTS', 'POSCAR', 'PROCAR',
    -                     'vasprun.xml', 'CHGCAR', 'CHG', 'EIGENVAL', 'OSZICAR',
    -                     'WAVECAR', 'CONTCAR', 'IBZKPT', 'OUTCAR']
    -
    -VASP_NEB_INPUT_FILES = {'INCAR', 'POTCAR', 'KPOINTS'}
    -
    -VASP_NEB_OUTPUT_FILES = ['INCAR', 'KPOINTS', 'POTCAR', 'vasprun.xml']
    -
    -VASP_NEB_OUTPUT_SUB_FILES = ['CHG', 'CHGCAR', 'CONTCAR', 'DOSCAR',
    -                             'EIGENVAL', 'IBZKPT', 'PCDAT', 'POSCAR',
    -                             'REPORT', 'PROCAR', 'OSZICAR', 'OUTCAR',
    -                             'WAVECAR', 'XDATCAR']
    -
    -
    -
    [docs]class VaspJob(Job): - """ - A basic vasp job. Just runs whatever is in the directory. But conceivably - can be a complex processing of inputs etc. with initialization. - """ - - def __init__(self, vasp_cmd, output_file="vasp.out", - stderr_file="std_err.txt", suffix="", final=True, - backup=True, auto_npar=False, auto_gamma=True, - settings_override=None, gamma_vasp_cmd=None, - copy_magmom=False, auto_continue=False): - """ - This constructor is necessarily complex due to the need for - flexibility. For standard kinds of runs, it's often better to use one - of the static constructors. The defaults are usually fine too. - - Args: - vasp_cmd (str): Command to run vasp as a list of args. For example, - if you are using mpirun, it can be something like - ["mpirun", "pvasp.5.2.11"] - output_file (str): Name of file to direct standard out to. - Defaults to "vasp.out". - stderr_file (str): Name of file to direct standard error to. - Defaults to "std_err.txt". - suffix (str): A suffix to be appended to the final output. E.g., - to rename all VASP output from say vasp.out to - vasp.out.relax1, provide ".relax1" as the suffix. - final (bool): Indicating whether this is the final vasp job in a - series. Defaults to True. - backup (bool): Whether to backup the initial input files. If True, - the INCAR, KPOINTS, POSCAR and POTCAR will be copied with a - ".orig" appended. Defaults to True. - auto_npar (bool): Whether to automatically tune NPAR to be sqrt( - number of cores) as recommended by VASP for DFT calculations. - Generally, this results in significant speedups. Defaults to - True. Set to False for HF, GW and RPA calculations. - auto_gamma (bool): Whether to automatically check if run is a - Gamma 1x1x1 run, and whether a Gamma optimized version of - VASP exists with ".gamma" appended to the name of the VASP - executable (typical setup in many systems). If so, run the - gamma optimized version of VASP instead of regular VASP. You - can also specify the gamma vasp command using the - gamma_vasp_cmd argument if the command is named differently. - settings_override ([dict]): An ansible style list of dict to - override changes. For example, to set ISTART=1 for subsequent - runs and to copy the CONTCAR to the POSCAR, you will provide:: - - [{"dict": "INCAR", "action": {"_set": {"ISTART": 1}}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - gamma_vasp_cmd (str): Command for gamma vasp version when - auto_gamma is True. Should follow the list style of - subprocess. Defaults to None, which means ".gamma" is added - to the last argument of the standard vasp_cmd. - copy_magmom (bool): Whether to copy the final magmom from the - OUTCAR to the next INCAR. Useful for multi-relaxation runs - where the CHGCAR and WAVECAR are sometimes deleted (due to - changes in fft grid, etc.). Only applies to non-final runs. - auto_continue (bool): Whether to automatically continue a run - if a STOPCAR is present. This is very useful if using the - wall-time handler which will write a read-only STOPCAR to - prevent VASP from deleting it once it finishes - """ - self.vasp_cmd = vasp_cmd - self.output_file = output_file - self.stderr_file = stderr_file - self.final = final - self.backup = backup - self.suffix = suffix - self.settings_override = settings_override - self.auto_npar = auto_npar - self.auto_gamma = auto_gamma - self.gamma_vasp_cmd = gamma_vasp_cmd - self.copy_magmom = copy_magmom - self.auto_continue = auto_continue - - if SENTRY_DSN: - # if using Sentry logging, add specific VASP executable to scope - from sentry_sdk import configure_scope - with configure_scope() as scope: - try: - if isinstance(vasp_cmd, str): - vasp_path = which(vasp_cmd.split(' ')[-1]) - elif isinstance(vasp_cmd, list): - vasp_path = which(vasp_cmd[-1]) - scope.set_tag("vasp_path", vasp_path) - scope.set_tag("vasp_cmd", vasp_cmd) - except: - logger.error("Failed to detect VASP path: {}".format(vasp_cmd), exc_info=True) - scope.set_tag("vasp_cmd", vasp_cmd) - -
    [docs] def setup(self): - """ - Performs initial setup for VaspJob, including overriding any settings - and backing up. - """ - decompress_dir('.') - - if self.backup: - for f in VASP_INPUT_FILES: - shutil.copy(f, "{}.orig".format(f)) - - if self.auto_npar: - try: - incar = Incar.from_file("INCAR") - # Only optimized NPAR for non-HF and non-RPA calculations. - if not (incar.get("LHFCALC") or incar.get("LRPA") or - incar.get("LEPSILON")): - if incar.get("IBRION") in [5, 6, 7, 8]: - # NPAR should not be set for Hessian matrix - # calculations, whether in DFPT or otherwise. - del incar["NPAR"] - else: - import multiprocessing - # try sge environment variable first - # (since multiprocessing counts cores on the current - # machine only) - ncores = os.environ.get('NSLOTS') or \ - multiprocessing.cpu_count() - ncores = int(ncores) - for npar in range(int(math.sqrt(ncores)), - ncores): - if ncores % npar == 0: - incar["NPAR"] = npar - break - incar.write_file("INCAR") - except: - pass - - if self.auto_continue: - if os.path.exists("continue.json"): - actions = loadfn("continue.json").get("actions") - logger.info("Continuing previous VaspJob. Actions: {}".format(actions)) - backup(VASP_BACKUP_FILES, prefix="prev_run") - VaspModder().apply_actions(actions) - - else: - # Default functionality is to copy CONTCAR to POSCAR and set - # ISTART to 1 in the INCAR, but other actions can be specified - if self.auto_continue is True: - actions = [{"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}, - {"dict": "INCAR", - "action": {"_set": {"ISTART": 1}}}] - else: - actions = self.auto_continue - dumpfn({"actions": actions}, "continue.json") - - if self.settings_override is not None: - VaspModder().apply_actions(self.settings_override)
    - -
    [docs] def run(self): - """ - Perform the actual VASP run. - - Returns: - (subprocess.Popen) Used for monitoring. - """ - cmd = list(self.vasp_cmd) - if self.auto_gamma: - vi = VaspInput.from_directory(".") - kpts = vi["KPOINTS"] - if kpts.style == Kpoints.supported_modes.Gamma \ - and tuple(kpts.kpts[0]) == (1, 1, 1): - if self.gamma_vasp_cmd is not None and which( - self.gamma_vasp_cmd[-1]): - cmd = self.gamma_vasp_cmd - elif which(cmd[-1] + ".gamma"): - cmd[-1] += ".gamma" - logger.info("Running {}".format(" ".join(cmd))) - with open(self.output_file, 'w') as f_std, \ - open(self.stderr_file, "w", buffering=1) as f_err: - # use line buffering for stderr - p = subprocess.Popen(cmd, stdout=f_std, stderr=f_err) - return p
    - -
    [docs] def postprocess(self): - """ - Postprocessing includes renaming and gzipping where necessary. - Also copies the magmom to the incar if necessary - """ - for f in VASP_OUTPUT_FILES + [self.output_file]: - if os.path.exists(f): - if self.final and self.suffix != "": - shutil.move(f, "{}{}".format(f, self.suffix)) - elif self.suffix != "": - shutil.copy(f, "{}{}".format(f, self.suffix)) - - if self.copy_magmom and not self.final: - try: - outcar = Outcar("OUTCAR") - magmom = [m['tot'] for m in outcar.magnetization] - incar = Incar.from_file("INCAR") - incar['MAGMOM'] = magmom - incar.write_file("INCAR") - except: - logger.error('MAGMOM copy from OUTCAR to INCAR failed') - - # Remove continuation so if a subsequent job is run in - # the same directory, will not restart this job. - if os.path.exists("continue.json"): - os.remove("continue.json")
    - -
    [docs] @classmethod - def double_relaxation_run(cls, vasp_cmd, auto_npar=True, ediffg=-0.05, - half_kpts_first_relax=False, auto_continue=False): - """ - Returns a list of two jobs corresponding to an AFLOW style double - relaxation run. - - Args: - vasp_cmd (str): Command to run vasp as a list of args. For example, - if you are using mpirun, it can be something like - ["mpirun", "pvasp.5.2.11"] - auto_npar (bool): Whether to automatically tune NPAR to be sqrt( - number of cores) as recommended by VASP for DFT calculations. - Generally, this results in significant speedups. Defaults to - True. Set to False for HF, GW and RPA calculations. - ediffg (float): Force convergence criteria for subsequent runs ( - ignored for the initial run.) - half_kpts_first_relax (bool): Whether to halve the kpoint grid - for the first relaxation. Speeds up difficult convergence - considerably. Defaults to False. - - Returns: - List of two jobs corresponding to an AFLOW style run. - """ - incar_update = {"ISTART": 1} - if ediffg: - incar_update["EDIFFG"] = ediffg - settings_overide_1 = None - settings_overide_2 = [ - {"dict": "INCAR", - "action": {"_set": incar_update}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - if half_kpts_first_relax and os.path.exists("KPOINTS") and \ - os.path.exists("POSCAR"): - kpts = Kpoints.from_file("KPOINTS") - orig_kpts_dict = kpts.as_dict() - # lattice vectors with length < 8 will get >1 KPOINT - kpts.kpts = np.round(np.maximum(np.array(kpts.kpts) / 2, - 1)).astype(int).tolist() - low_kpts_dict = kpts.as_dict() - settings_overide_1 = [ - {"dict": "KPOINTS", - "action": {"_set": low_kpts_dict}} - ] - settings_overide_2.append( - {"dict": "KPOINTS", - "action": {"_set": orig_kpts_dict}} - ) - - return [VaspJob(vasp_cmd, final=False, suffix=".relax1", - auto_npar=auto_npar, auto_continue=auto_continue, - settings_override=settings_overide_1), - VaspJob(vasp_cmd, final=True, backup=False, suffix=".relax2", - auto_npar=auto_npar, auto_continue=auto_continue, - settings_override=settings_overide_2)]
    - -
    [docs] @classmethod - def metagga_opt_run(cls, vasp_cmd, auto_npar=True, ediffg=-0.05, - half_kpts_first_relax=False, auto_continue=False): - """ - Returns a list of thres jobs to perform an optimization for any - metaGGA functional. There is an initial calculation of the - GGA wavefunction which is fed into the initial metaGGA optimization - to precondition the electronic structure optimizer. The metaGGA - optimization is performed using the double relaxation scheme - """ - - incar = Incar.from_file("INCAR") - # Defaults to using the SCAN metaGGA - metaGGA = incar.get("METAGGA", "SCAN") - - # Pre optimze WAVECAR and structure using regular GGA - pre_opt_setings = [{"dict": "INCAR", - "action": {"_set": {"METAGGA": None, - "LWAVE": True, - "NSW": 0}}}] - jobs = [VaspJob(vasp_cmd, auto_npar=auto_npar, - final=False, suffix=".precondition", - settings_override=pre_opt_setings)] - - # Finish with regular double relaxation style run using SCAN - jobs.extend(VaspJob.double_relaxation_run(vasp_cmd, auto_npar=auto_npar, - ediffg=ediffg, - half_kpts_first_relax=half_kpts_first_relax)) - - # Ensure the first relaxation doesn't overwrite the original inputs - jobs[1].backup = False - - # Update double_relaxation job to start from pre-optimized run - post_opt_settings = [{"dict": "INCAR", - "action": {"_set": {"METAGGA": metaGGA, "ISTART": 1, - "NSW": incar.get("NSW", 99), - "LWAVE": incar.get("LWAVE", False)}}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - if jobs[1].settings_override: - post_opt_settings = jobs[1].settings_override + post_opt_settings - jobs[1].settings_override = post_opt_settings - - return jobs
    - -
    [docs] @classmethod - def full_opt_run(cls, vasp_cmd, vol_change_tol=0.02, - max_steps=10, ediffg=-0.05, half_kpts_first_relax=False, - **vasp_job_kwargs): - """ - Returns a generator of jobs for a full optimization run. Basically, - this runs an infinite series of geometry optimization jobs until the - % vol change in a particular optimization is less than vol_change_tol. - - Args: - vasp_cmd (str): Command to run vasp as a list of args. For example, - if you are using mpirun, it can be something like - ["mpirun", "pvasp.5.2.11"] - vol_change_tol (float): The tolerance at which to stop a run. - Defaults to 0.05, i.e., 5%. - max_steps (int): The maximum number of runs. Defaults to 10 ( - highly unlikely that this limit is ever reached). - ediffg (float): Force convergence criteria for subsequent runs ( - ignored for the initial run.) - half_kpts_first_relax (bool): Whether to halve the kpoint grid - for the first relaxation. Speeds up difficult convergence - considerably. Defaults to False. - \*\*vasp_job_kwargs: Passthrough kwargs to VaspJob. See - :class:`custodian.vasp.jobs.VaspJob`. - - Returns: - Generator of jobs. - """ - for i in range(max_steps): - if i == 0: - settings = None - backup = True - if half_kpts_first_relax and os.path.exists("KPOINTS") and \ - os.path.exists("POSCAR"): - kpts = Kpoints.from_file("KPOINTS") - orig_kpts_dict = kpts.as_dict() - kpts.kpts = np.maximum(np.array(kpts.kpts) / 2, 1).tolist() - low_kpts_dict = kpts.as_dict() - settings = [ - {"dict": "KPOINTS", - "action": {"_set": low_kpts_dict}} - ] - else: - backup = False - initial = Poscar.from_file("POSCAR").structure - final = Poscar.from_file("CONTCAR").structure - vol_change = (final.volume - initial.volume) / initial.volume - - logger.info("Vol change = %.1f %%!" % (vol_change * 100)) - if abs(vol_change) < vol_change_tol: - logger.info("Stopping optimization!") - break - else: - incar_update = {"ISTART": 1} - if ediffg: - incar_update["EDIFFG"] = ediffg - settings = [ - {"dict": "INCAR", - "action": {"_set": incar_update}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - if i == 1 and half_kpts_first_relax: - settings.append({"dict": "KPOINTS", - "action": {"_set": orig_kpts_dict}}) - logger.info("Generating job = %d!" % (i+1)) - yield VaspJob(vasp_cmd, final=False, backup=backup, - suffix=".relax%d" % (i+1), settings_override=settings, - **vasp_job_kwargs)
    - -
    [docs] @classmethod - def constrained_opt_run(cls, vasp_cmd, lattice_direction, initial_strain, - atom_relax=True, max_steps=20, algo="bfgs", - **vasp_job_kwargs): - """ - Returns a generator of jobs for a constrained optimization run. Typical - use case is when you want to approximate a biaxial strain situation, - e.g., you apply a defined strain to a and b directions of the lattice, - but allows the c-direction to relax. - - Some guidelines on the use of this method: - i. It is recommended you do not use the Auto kpoint generation. The - grid generated via Auto may fluctuate with changes in lattice - param, resulting in numerical noise. - ii. Make sure your EDIFF/EDIFFG is properly set in your INCAR. The - optimization relies on these values to determine convergence. - - Args: - vasp_cmd (str): Command to run vasp as a list of args. For example, - if you are using mpirun, it can be something like - ["mpirun", "pvasp.5.2.11"] - lattice_direction (str): Which direction to relax. Valid values are - "a", "b" or "c". - initial_strain (float): An initial strain to be applied to the - lattice_direction. This can usually be estimated as the - negative of the strain applied in the other two directions. - E.g., if you apply a tensile strain of 0.05 to the a and b - directions, you can use -0.05 as a reasonable first guess for - initial strain. - atom_relax (bool): Whether to relax atomic positions. - max_steps (int): The maximum number of runs. Defaults to 20 ( - highly unlikely that this limit is ever reached). - algo (str): Algorithm to use to find minimum. Default is "bfgs", - which is fast, but can be sensitive to numerical noise - in energy calculations. The alternative is "bisection", - which is more robust but can be a bit slow. The code does fall - back on the bisection when bfgs gives a non-sensical result, - e.g., negative lattice params. - \*\*vasp_job_kwargs: Passthrough kwargs to VaspJob. See - :class:`custodian.vasp.jobs.VaspJob`. - - Returns: - Generator of jobs. At the end of the run, an "EOS.txt" is written - which provides a quick look at the E vs lattice parameter. - """ - nsw = 99 if atom_relax else 0 - - incar = Incar.from_file("INCAR") - - # Set the energy convergence criteria as the EDIFFG (if present) or - # 10 x EDIFF (which itself defaults to 1e-4 if not present). - if incar.get("EDIFFG") and incar.get("EDIFFG") > 0: - etol = incar["EDIFFG"] - else: - etol = incar.get("EDIFF", 1e-4) * 10 - - if lattice_direction == "a": - lattice_index = 0 - elif lattice_direction == "b": - lattice_index = 1 - else: - lattice_index = 2 - - energies = {} - - for i in range(max_steps): - if i == 0: - settings = [ - {"dict": "INCAR", - "action": {"_set": {"ISIF": 2, "NSW": nsw}}}] - structure = Poscar.from_file("POSCAR").structure - x = structure.lattice.abc[lattice_index] - backup = True - else: - backup = False - v = Vasprun("vasprun.xml") - structure = v.final_structure - energy = v.final_energy - lattice = structure.lattice - - x = lattice.abc[lattice_index] - - energies[x] = energy - - if i == 1: - x *= (1 + initial_strain) - else: - # Sort the lattice parameter by energies. - min_x = min(energies.keys(), key=lambda e: energies[e]) - sorted_x = sorted(energies.keys()) - ind = sorted_x.index(min_x) - if ind == 0: - other = ind + 1 - elif ind == len(sorted_x) - 1: - other = ind - 1 - else: - other = ind + 1 \ - if energies[sorted_x[ind + 1]] \ - < energies[sorted_x[ind - 1]] \ - else ind - 1 - if abs(energies[min_x] - - energies[sorted_x[other]]) < etol: - logger.info("Stopping optimization! Final %s = %f" - % (lattice_direction, min_x)) - break - - if ind == 0 and len(sorted_x) > 2: - # Lowest energy lies outside of range of lowest value. - # we decrease the lattice parameter in the next - # iteration to find a minimum. This applies only when - # there are at least 3 values. - x = sorted_x[0] - abs(sorted_x[1] - sorted_x[0]) - logger.info("Lowest energy lies below bounds. " - "Setting %s = %f." % (lattice_direction, x)) - elif ind == len(sorted_x) - 1 and len(sorted_x) > 2: - # Lowest energy lies outside of range of highest value. - # we increase the lattice parameter in the next - # iteration to find a minimum. This applies only when - # there are at least 3 values. - x = sorted_x[-1] + abs(sorted_x[-1] - sorted_x[-2]) - logger.info("Lowest energy lies above bounds. " - "Setting %s = %f." % (lattice_direction, x)) - else: - if algo.lower() == "bfgs" and len(sorted_x) >= 4: - try: - # If there are more than 4 data points, we will - # do a quadratic fit to accelerate convergence. - x1 = list(energies.keys()) - y1 = [energies[j] for j in x1] - z1 = np.polyfit(x1, y1, 2) - pp = np.poly1d(z1) - from scipy.optimize import minimize - result = minimize( - pp, min_x, - bounds=[(sorted_x[0], sorted_x[-1])]) - if (not result.success) or result.x[0] < 0: - raise ValueError( - "Negative lattice constant!") - x = result.x[0] - logger.info("BFGS minimized %s = %f." - % (lattice_direction, x)) - except ValueError as ex: - # Fall back on bisection algo if the bfgs fails. - logger.info(str(ex)) - x = (min_x + sorted_x[other]) / 2 - logger.info("Falling back on bisection %s = %f." - % (lattice_direction, x)) - else: - x = (min_x + sorted_x[other]) / 2 - logger.info("Bisection %s = %f." - % (lattice_direction, x)) - - lattice = lattice.matrix - lattice[lattice_index] = lattice[lattice_index] / \ - np.linalg.norm(lattice[lattice_index]) * x - - s = Structure(lattice, structure.species, structure.frac_coords) - fname = "POSCAR.%f" % x - s.to(filename=fname) - - incar_update = {"ISTART": 1, "NSW": nsw, "ISIF": 2} - - settings = [ - {"dict": "INCAR", - "action": {"_set": incar_update}}, - {"file": fname, - "action": {"_file_copy": {"dest": "POSCAR"}}}] - - logger.info("Generating job = %d with parameter %f!" % (i + 1, x)) - yield VaspJob(vasp_cmd, final=False, backup=backup, - suffix=".static.%f" % x, - settings_override=settings, **vasp_job_kwargs) - - with open("EOS.txt", "wt") as f: - f.write("# %s energy\n" % lattice_direction) - for k in sorted(energies.keys()): - f.write("%f %f\n" % (k, energies[k]))
    - -
    [docs] def terminate(self): - for k in self.vasp_cmd: - if "vasp" in k: - try: - os.system("killall %s" % k) - except: - pass
    - - -
    [docs]class VaspNEBJob(Job): - """ - A NEB vasp job, especially for CI-NEB running at PBS clusters. - The class is added for the purpose of handling a different folder - arrangement in NEB calculation. - """ - - def __init__(self, vasp_cmd, - output_file="neb_vasp.out", stderr_file="neb_std_err.txt", - suffix="", final=True, backup=True, auto_npar=True, - half_kpts=False, auto_gamma=True, auto_continue=False, - gamma_vasp_cmd=None, settings_override=None): - """ - This constructor is a simplified version of VaspJob, which satisfies - the need for flexibility. For standard kinds of runs, it's often - better to use one of the static constructors. The defaults are - usually fine too. - - Args: - vasp_cmd (str): Command to run vasp as a list of args. For example, - if you are using mpirun, it can be something like - ["mpirun", "pvasp.5.2.11"] - output_file (str): Name of file to direct standard out to. - Defaults to "vasp.out". - stderr_file (str): Name of file to direct standard error to. - Defaults to "std_err.txt". - suffix (str): A suffix to be appended to the final output. E.g., - to rename all VASP output from say vasp.out to - vasp.out.relax1, provide ".relax1" as the suffix. - final (bool): Indicating whether this is the final vasp job in a - series. Defaults to True. - backup (bool): Whether to backup the initial input files. If True, - the INCAR, KPOINTS, POSCAR and POTCAR will be copied with a - ".orig" appended. Defaults to True. - auto_npar (bool): Whether to automatically tune NPAR to be sqrt( - number of cores) as recommended by VASP for DFT calculations. - Generally, this results in significant speedups. Defaults to - True. Set to False for HF, GW and RPA calculations. - half_kpts (bool): Whether to halve the kpoint grid for NEB. - Speeds up convergence considerably. Defaults to False. - auto_gamma (bool): Whether to automatically check if run is a - Gamma 1x1x1 run, and whether a Gamma optimized version of - VASP exists with ".gamma" appended to the name of the VASP - executable (typical setup in many systems). If so, run the - gamma optimized version of VASP instead of regular VASP. You - can also specify the gamma vasp command using the - gamma_vasp_cmd argument if the command is named differently. - auto_continue (bool): Whether to automatically continue a run - if a STOPCAR is present. This is very useful if using the - wall-time handler which will write a read-only STOPCAR to - prevent VASP from deleting it once it finishes. - gamma_vasp_cmd (str): Command for gamma vasp version when - auto_gamma is True. Should follow the list style of - subprocess. Defaults to None, which means ".gamma" is added - to the last argument of the standard vasp_cmd. - settings_override ([dict]): An ansible style list of dict to - override changes. For example, to set ISTART=1 for subsequent - runs and to copy the CONTCAR to the POSCAR, you will provide:: - - [{"dict": "INCAR", "action": {"_set": {"ISTART": 1}}}, - {"file": "CONTCAR", - "action": {"_file_copy": {"dest": "POSCAR"}}}] - """ - - self.vasp_cmd = vasp_cmd - self.output_file = output_file - self.stderr_file = stderr_file - self.final = final - self.backup = backup - self.suffix = suffix - self.auto_npar = auto_npar - self.half_kpts = half_kpts - self.auto_gamma = auto_gamma - self.gamma_vasp_cmd = gamma_vasp_cmd - self.auto_continue = auto_continue - self.settings_override = settings_override - self.neb_dirs = [] # 00, 01, etc. - self.neb_sub = [] # 01, 02, etc. - - for path in os.listdir("."): - if os.path.isdir(path) and path.isdigit(): - self.neb_dirs.append(path) - self.neb_dirs = sorted(self.neb_dirs) - self.neb_sub = self.neb_dirs[1: -1] - -
    [docs] def setup(self): - """ - Performs initial setup for VaspNEBJob, including overriding any settings - and backing up. - """ - neb_dirs = self.neb_dirs - - if self.backup: - # Back up KPOINTS, INCAR, POTCAR - for f in VASP_NEB_INPUT_FILES: - shutil.copy(f, "{}.orig".format(f)) - # Back up POSCARs - for path in neb_dirs: - poscar = os.path.join(path, "POSCAR") - shutil.copy(poscar, "{}.orig".format(poscar)) - - if self.half_kpts and os.path.exists("KPOINTS"): - kpts = Kpoints.from_file("KPOINTS") - kpts.kpts = np.maximum(np.array(kpts.kpts) / 2, 1) - kpts.kpts = kpts.kpts.astype(int).tolist() - if tuple(kpts.kpts[0]) == (1, 1, 1): - kpt_dic = kpts.as_dict() - kpt_dic["generation_style"] = 'Gamma' - kpts = Kpoints.from_dict(kpt_dic) - kpts.write_file("KPOINTS") - - if self.auto_npar: - try: - incar = Incar.from_file("INCAR") - import multiprocessing - # Try sge environment variable first - # (since multiprocessing counts cores on the current - # machine only) - ncores = os.environ.get('NSLOTS') or multiprocessing.cpu_count() - ncores = int(ncores) - for npar in range(int(math.sqrt(ncores)), - ncores): - if ncores % npar == 0: - incar["NPAR"] = npar - break - incar.write_file("INCAR") - except: - pass - - if self.auto_continue and \ - os.path.exists("STOPCAR") and \ - not os.access("STOPCAR", os.W_OK): - # Remove STOPCAR - os.chmod("STOPCAR", 0o644) - os.remove("STOPCAR") - - # Copy CONTCAR to POSCAR - for path in self.neb_sub: - contcar = os.path.join(path, "CONTCAR") - poscar = os.path.join(path, "POSCAR") - shutil.copy(contcar, poscar) - - if self.settings_override is not None: - VaspModder().apply_actions(self.settings_override)
    - -
    [docs] def run(self): - """ - Perform the actual VASP run. - - Returns: - (subprocess.Popen) Used for monitoring. - """ - cmd = list(self.vasp_cmd) - if self.auto_gamma: - kpts = Kpoints.from_file("KPOINTS") - if kpts.style == Kpoints.supported_modes.Gamma \ - and tuple(kpts.kpts[0]) == (1, 1, 1): - if self.gamma_vasp_cmd is not None and which( - self.gamma_vasp_cmd[-1]): - cmd = self.gamma_vasp_cmd - elif which(cmd[-1] + ".gamma"): - cmd[-1] += ".gamma" - logger.info("Running {}".format(" ".join(cmd))) - with open(self.output_file, 'w') as f_std, \ - open(self.stderr_file, "w", buffering=1) as f_err: - - # Use line buffering for stderr - p = subprocess.Popen(cmd, stdout=f_std, stderr=f_err) - return p
    - -
    [docs] def postprocess(self): - """ - Postprocessing includes renaming and gzipping where necessary. - """ - # Add suffix to all sub_dir/{items} - for path in self.neb_dirs: - for f in VASP_NEB_OUTPUT_SUB_FILES: - f = os.path.join(path, f) - if os.path.exists(f): - if self.final and self.suffix != "": - shutil.move(f, "{}{}".format(f, self.suffix)) - elif self.suffix != "": - shutil.copy(f, "{}{}".format(f, self.suffix)) - - # Add suffix to all output files - for f in VASP_NEB_OUTPUT_FILES + [self.output_file]: - if os.path.exists(f): - if self.final and self.suffix != "": - shutil.move(f, "{}{}".format(f, self.suffix)) - elif self.suffix != "": - shutil.copy(f, "{}{}".format(f, self.suffix))
    - - -
    [docs]class GenerateVaspInputJob(Job): - - def __init__(self, input_set, contcar_only=True, **kwargs): - """ - Generates a VASP input based on an existing directory. This is typically - used to modify the VASP input files before the next VaspJob. - - Args: - input_set (str): Full path to the input set. E.g., - "pymatgen.io.vasp.sets.MPNonSCFSet". - contcar_only (bool): If True (default), only CONTCAR structures - are used as input to the input set. - """ - self.input_set = input_set - self.contcar_only = contcar_only - self.kwargs = kwargs - -
    [docs] def setup(self): - pass
    - -
    [docs] def run(self): - if os.path.exists("CONTCAR"): - structure = Structure.from_file("CONTCAR") - elif (not self.contcar_only) and os.path.exists("POSCAR"): - structure = Structure.from_file("POSCAR") - else: - raise RuntimeError("No CONTCAR/POSCAR detected to generate input!") - modname, classname = self.input_set.rsplit(".", 1) - mod = __import__(modname, globals(), locals(), [classname], 0) - vis = getattr(mod, classname)(structure, **self.kwargs) - vis.write_input(".")
    - -
    [docs] def postprocess(self): - pass
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/custodian/vasp/validators.html b/docs/html/_modules/custodian/vasp/validators.html deleted file mode 100644 index d866767a..00000000 --- a/docs/html/_modules/custodian/vasp/validators.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - custodian.vasp.validators — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Source code for custodian.vasp.validators

    -# coding: utf-8
    -
    -from __future__ import unicode_literals, division
    -
    -from custodian.custodian import Validator
    -from pymatgen.io.vasp import Vasprun, Incar, Outcar, Chgcar
    -from collections import deque
    -
    -import os
    -import logging
    -
    -
    -
    [docs]class VasprunXMLValidator(Validator): - """ - Checks that a valid vasprun.xml was generated - """ - - def __init__(self, output_file="vasp.out", stderr_file="std_err.txt"): - """ - Args: - output_file (str): Name of file VASP standard output is directed to. - Defaults to "vasp.out". - stderr_file (str): Name of file VASP standard error is direct to. - Defaults to "std_err.txt". - """ - self.output_file = output_file - self.stderr_file = stderr_file - self.logger = logging.getLogger(self.__class__.__name__) - -
    [docs] def check(self): - try: - Vasprun("vasprun.xml") - except: - exception_context = {} - - if os.path.exists(self.output_file): - with open(self.output_file, "r") as output_file: - output_file_tail = deque(output_file, maxlen=10) - exception_context["output_file_tail"] = "".join(output_file_tail) - - if os.path.exists(self.stderr_file): - with open(self.stderr_file, "r") as stderr_file: - stderr_file_tail = deque(stderr_file, maxlen=10) - exception_context["stderr_file_tail"] = "".join(stderr_file_tail) - - if os.path.exists("vasprun.xml"): - - stat = os.stat("vasprun.xml") - exception_context["vasprun_st_size"] = stat.st_size - exception_context["vasprun_st_atime"] = stat.st_atime - exception_context["vasprun_st_mtime"] = stat.st_mtime - exception_context["vasprun_st_ctime"] = stat.st_ctime - - with open("vasprun.xml", "r") as vasprun: - vasprun_tail = deque(vasprun, maxlen=10) - exception_context["vasprun_tail"] = "".join(vasprun_tail) - - self.logger.error("Failed to load vasprun.xml", - exc_info=True, extra=exception_context) - - return True - return False
    - - -
    [docs]class VaspFilesValidator(Validator): - """ - Check for existence of some of the files that VASP - normally create upon running. - """ - - def __init__(self): - pass - -
    [docs] def check(self): - for vfile in ["CONTCAR", "OSZICAR", "OUTCAR"]: - if not os.path.exists(vfile): - return True - return False
    - - -
    [docs]class VaspNpTMDValidator(Validator): - """ - Check NpT-AIMD settings is loaded by VASP compiled with -Dtbdyn. - Currently, VASP only have Langevin thermostat (MDALGO = 3) for NpT ensemble. - """ - - def __init__(self): - pass - -
    [docs] def check(self): - incar = Incar.from_file("INCAR") - is_npt = incar.get("MDALGO") == 3 - if not is_npt: - return False - - outcar = Outcar("OUTCAR") - patterns = {"MDALGO": "MDALGO\s+=\s+([\d]+)"} - outcar.read_pattern(patterns=patterns) - if outcar.data["MDALGO"] == [['3']]: - return False - else: - return True
    - -
    [docs]class VaspAECCARValidator(Validator): - """ - Check if the data in the AECCAR is corrupted - """ - - def __init__(self): - pass - -
    [docs] def check(self): - aeccar0 = Chgcar.from_file("AECCAR0") - aeccar2 = Chgcar.from_file("AECCAR2") - aeccar = aeccar0 + aeccar2 - return check_broken_chgcar(aeccar)
    - -
    [docs]def check_broken_chgcar(chgcar): - chgcar_data = chgcar.data['total'] - if (chgcar_data < 0).sum() > 100: - # a decent bunch of the values are negative - return True - - diff = chgcar_data[:-1, :-1, :-1] - chgcar_data[1:, 1:, 1:] - if diff.max()/(chgcar_data.max() - chgcar_data.min()) > 0.95: - # Some single diagonal finite difference is more than 95% of the entire range - return True - - return False
    -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/index.html b/docs/html/_modules/index.html deleted file mode 100644 index 56a6d705..00000000 --- a/docs/html/_modules/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - Overview: module code — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/html/_sources/_themes/README.rst.txt b/docs/html/_sources/_themes/README.rst.txt deleted file mode 100644 index e8179f96..00000000 --- a/docs/html/_sources/_themes/README.rst.txt +++ /dev/null @@ -1,25 +0,0 @@ -krTheme Sphinx Style -==================== - -This repository contains sphinx styles Kenneth Reitz uses in most of -his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. - -2. add this to your conf.py: :: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'kr' - -The following themes exist: - -**kr** - the standard flask documentation theme for large projects - -**kr_small** - small one-page theme. Intended to be used by very small addon libraries. - diff --git a/docs/html/_sources/changelog.rst.txt b/docs/html/_sources/changelog.rst.txt deleted file mode 100644 index c975f125..00000000 --- a/docs/html/_sources/changelog.rst.txt +++ /dev/null @@ -1,218 +0,0 @@ -Change Log -========== - -v2017.12.23 ------------ -* cstdn command line tool is now official with docs. -* Fine-grained control of VaspErrorHandler is now possible using - `errors_subset_to_catch`. -* Switched to date-based versioning for custodian like pymatgen. - -v1.1.1 ------- -* DriftErrorHandler (Shyam) - -v1.1.0 ------- -* Improved error handling for Qchem calculations. - -v1.0.4 ------- -* Improved handling of non-zero return codes. - -v1.0.2 ------- -* Interrupted run feature. (Shyam Dwaraknath) - -v1.0.1 ------- -* Pymatgen 4.0.0 compatible release. - -v1.0.0 ------- -* Custodian now comes with a "cstdn" script that enables the arbitrary creation - of simple job sequences using a yaml file, and the running of calculations - based on these yaml specifications. - -v0.8.8 ------- -1. Fix setup.py. - -v0.8.5 ------- -1. Refactoring to support pymatgen 3.1.4. - -v0.8.2 ------- -1. Made auto_npar optional for double relaxation VASP run. - -v0.8.1 ------- -1. Misc bug fixes (minor). - -v0.8.0 ------- -1. Major refactoring of Custodian to introdce Validators, - which are effectively post-Job checking mechanisms that do not perform - error correction. -2. **Backwards incompatibility** BadVasprunXMLHandler is now a validator, - which must be separately imported to be used. -3. Miscellaneous cleanup of Py3k fixes. -v0.7.6 ------- -1. Custodian is now Python 3 compatible and uses the latest versions of - pymatgen and monty. - -v0.7.5 ------- -1. **Major** Custodian now exits with RuntimeError when max_errors or - unrecoverable_error is encountered. -2. Added BadVasprunXMLHandler. - -v0.7.4 ------- -1. auto_npar option in VaspJob now properly handles Hessian calculations. -2. WalltimeHandler now supports termination at electronic step (David - Waroquiers). -3. Improved handling of BRMIX fixes. - -v0.7.3 ------- -1. Improved backwards compatibility for WallTimeHandler. -2. Improvements to VaspErrorHandler. No longer catches spurious BRMIX error - messages when NELECT is specified in INCAR, and pricel and rot_mat errors - are now fixed with symmetry precision and gamma centered KPOINTS instead. -3. Improved Qchem error handler (Xiaohui Qu). - -v0.7.2 ------- -1. Improved WalltimeHandler (PBSWalltimeHandler is a subset and is now - deprecated). -2. New monty required version (>= 0.2.2). - -v0.7.1 ------- -1. Much improved qchem error handling (Xiaohui Qu). -2. New Monty required version (>= 0.2.0). - -v0.7.0 ------- -1. **Backwards incompatible with v0.6.3. Refactoring to move commonly used - Python utility functions to `Monty package `_, which is now a depedency - for custodian. -2. Custodian now requires pymatgen >= 2.9.0 for VASP, Qchem and Nwchem jobs - and handlers. -3. converge_kpoints script now has increment mode. -4. ErrorHandlers now have a new API, where the class variables "is_monitor" - and "is_terminating" are provided to indicate if a particular handler - runs in the background during a Job and whether a handler should - terminate the job. Some errors may not be critical or may need to wait - for some other event to terminate a job. For example, - a particular error may require a flag to be set to request a job to - terminate gracefully once it finishes its current task. The handler to - set the flag should not terminate the job. - -0.6.3 ------ -1. Added buffer time option in PBSWalltimeHandler. -2. Improved Qchem jobs and handlers (Xiaohui Qu). -3. Vastly improved API docs. - -0.6.2 ------ -1. Bug fix release to support sub dirs in run folder when using scratch. -2. Improve handling of walltime in PBSWalltimeHander. - -0.6.1 ------ -1. Bug fix release to address minor issue with checkpointing. -2. Checkpointing is now turned off by default. - -0.6.0 ------ -1. Checkpointing implemented for Custodian. Custodian can now checkpoint all - files in the current working directory after every successful job. If the - job is resubmitted, it will restore files and start from the last - checkpoint. Particularly useful for multi-job runs. -2. Added PBSWalltimeHandler to handle wall times for PBS Vasp Jobs. -3. Qchem error handlers and jobs. - -0.5.0 ------ -1. Added scratch_dir option to Custodian class as well as run_vasp and - run_nwchem scripts. Many supercomputing clusters have a scratch space - which have significantly faster IO. This option provides a transparent way - to specify the jobs to be performed in the scratch. Especially useful for - jobs which have significant file IO. - -0.4.5 ------ -1. Fix gzip of output. - -0.4.3 ------ -1. Added handling for ZBRENT error for VASP. -2. Minor refactoring to consolidate backup and gzip directory methods. - -0.4.2 ------ -1. Rudimentary support for Nwchem error handling (by Shyue Ping Ong). -2. Improved VASP error handling (by Steve Dacek and Will Richards). - -0.4.1 ------ -1. Added hanlding of PRICEL error in VASP. -2. Speed and robustness improvements. -3. BRIONS error now handled by changing ISYM. - -0.4.0 ------ -1. Many VASP handlers are now consolidated into a single VaspErrorHandler. -2. Many more fixes for VASP runs, including the "TOO FEW BANDS", - "TRIPLE PRODUCT", "DENTET" and "BRIONS" errors. -3. VaspJob now includes the auto_npar and auto_gamma options, which - automatically optimizes the NPAR setting to be sqrt(number of cores) as - per the VASP recommendation for DFT runs and tries to search for a - gamma-only compiled version of VASP for gamma 1x1x1 runs. - -0.3.5 ------ -1. Bug fix for incorrect shift error handler in VASP. -2. More robust fix for unconverged VASP runs (switching from ALGO fast to - normal). -3. Expanded documentation. - -0.3.4 ------ -1. Added support for handlers that perform monitor a job as it is progressing - and terminates it if necessary. Useful for correcting errors that come up - by do not cause immediate job failures. - -0.3.2 ------ -1. Important bug fix for VaspJob and converge_kpoints script. - -0.3.0 ------ - -1. Major update to custodian API. Custodian now perform more comprehensive - logging in a file called custodian.json, which logs all jobs and - corrections performed. - -Version 0.2.6 -------------- -1. Bug fix for run_vasp script for static runs. - -Version 0.2.5 -------------- -1. run_vasp script that now provides flexible specification of vasp runs. -2. Vastly improved error handling for VASP runs. -3. Improved logging system for custodian. -4. Improved API for custodian return types during run. -5. First stable release. - -Version 0.2.4 -------------- - -1. Bug fixes for aflow style runs assimilation. diff --git a/docs/html/_sources/custodian.ansible.rst.txt b/docs/html/_sources/custodian.ansible.rst.txt deleted file mode 100644 index 5840ac5f..00000000 --- a/docs/html/_sources/custodian.ansible.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.ansible package -========================= - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.ansible.actions module --------------------------------- - -.. automodule:: custodian.ansible.actions - :members: - :undoc-members: - :show-inheritance: - -custodian.ansible.interpreter module ------------------------------------- - -.. automodule:: custodian.ansible.interpreter - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.ansible - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.cli.rst.txt b/docs/html/_sources/custodian.cli.rst.txt deleted file mode 100644 index c83b5d9c..00000000 --- a/docs/html/_sources/custodian.cli.rst.txt +++ /dev/null @@ -1,54 +0,0 @@ -custodian.cli package -===================== - -Submodules ----------- - -custodian.cli.converge\_geometry module ---------------------------------------- - -.. automodule:: custodian.cli.converge_geometry - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.converge\_kpoints module --------------------------------------- - -.. automodule:: custodian.cli.converge_kpoints - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.cstdn module --------------------------- - -.. automodule:: custodian.cli.cstdn - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.run\_nwchem module --------------------------------- - -.. automodule:: custodian.cli.run_nwchem - :members: - :undoc-members: - :show-inheritance: - -custodian.cli.run\_vasp module ------------------------------- - -.. automodule:: custodian.cli.run_vasp - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.cli - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.feff.rst.txt b/docs/html/_sources/custodian.feff.rst.txt deleted file mode 100644 index 753541f9..00000000 --- a/docs/html/_sources/custodian.feff.rst.txt +++ /dev/null @@ -1,44 +0,0 @@ -custodian.feff package -====================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.feff.handlers module ------------------------------- - -.. automodule:: custodian.feff.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.feff.interpreter module ---------------------------------- - -.. automodule:: custodian.feff.interpreter - :members: - :undoc-members: - :show-inheritance: - -custodian.feff.jobs module --------------------------- - -.. automodule:: custodian.feff.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.feff - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.nwchem.rst.txt b/docs/html/_sources/custodian.nwchem.rst.txt deleted file mode 100644 index be9c01a4..00000000 --- a/docs/html/_sources/custodian.nwchem.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.nwchem package -======================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.nwchem.handlers module --------------------------------- - -.. automodule:: custodian.nwchem.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.nwchem.jobs module ----------------------------- - -.. automodule:: custodian.nwchem.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.nwchem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.qchem.rst.txt b/docs/html/_sources/custodian.qchem.rst.txt deleted file mode 100644 index 6fc3df09..00000000 --- a/docs/html/_sources/custodian.qchem.rst.txt +++ /dev/null @@ -1,36 +0,0 @@ -custodian.qchem package -======================= - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.qchem.handlers module -------------------------------- - -.. automodule:: custodian.qchem.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.qchem.jobs module ---------------------------- - -.. automodule:: custodian.qchem.jobs - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.qchem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.rst.txt b/docs/html/_sources/custodian.rst.txt deleted file mode 100644 index 97747550..00000000 --- a/docs/html/_sources/custodian.rst.txt +++ /dev/null @@ -1,42 +0,0 @@ -custodian package -================= - -Subpackages ------------ - -.. toctree:: - - custodian.ansible - custodian.cli - custodian.feff - custodian.nwchem - custodian.qchem - custodian.vasp - -Submodules ----------- - -custodian.custodian module --------------------------- - -.. automodule:: custodian.custodian - :members: - :undoc-members: - :show-inheritance: - -custodian.utils module ----------------------- - -.. automodule:: custodian.utils - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/custodian.vasp.rst.txt b/docs/html/_sources/custodian.vasp.rst.txt deleted file mode 100644 index 2d8dbc9b..00000000 --- a/docs/html/_sources/custodian.vasp.rst.txt +++ /dev/null @@ -1,52 +0,0 @@ -custodian.vasp package -====================== - -Subpackages ------------ - -.. toctree:: - - -Submodules ----------- - -custodian.vasp.handlers module ------------------------------- - -.. automodule:: custodian.vasp.handlers - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.interpreter module ---------------------------------- - -.. automodule:: custodian.vasp.interpreter - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.jobs module --------------------------- - -.. automodule:: custodian.vasp.jobs - :members: - :undoc-members: - :show-inheritance: - -custodian.vasp.validators module --------------------------------- - -.. automodule:: custodian.vasp.validators - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: custodian.vasp - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/index.rst.txt b/docs/html/_sources/index.rst.txt deleted file mode 100644 index eaa523f6..00000000 --- a/docs/html/_sources/index.rst.txt +++ /dev/null @@ -1,368 +0,0 @@ -Custodian -========= - -Custodian is a simple, robust and flexible just-in-time (JIT) job management -framework written in Python. Using custodian, you can create wrappers that -perform error checking, job management and error recovery. It has a simple -plugin framework that allows you to develop specific job management workflows -for different applications. - -Error recovery is an important aspect of many *high-throughput* projects that -generate data on a large scale. When you are running on the order of hundreds -of thousands of jobs, even an error rate of 1% would mean thousands of errored -jobs that would be impossible to deal with on a case-by-case basis. - -The specific use case for custodian is for long running jobs, with potentially -random errors. For example, there may be a script that takes several days to -run on a server, with a 1% chance of some IO error causing the job to fail. -Using custodian, one can develop a mechanism to gracefully recover from the -error, and restart the job with modified parameters if necessary. - -The current version of Custodian also comes with two sub-packages for error -handling for Vienna Ab Initio Simulation Package (VASP), NwChem and QChem -calculations. - -Change log -========== - -v2019.2.10 ----------- -* Improved slow convergence handling. (@shyamd) - -v2019.2.7 ---------- -* Improved error logging. -* Improved handling of frozen jobs and potim errors. -* Improved Exceptino handling. (Guido Petretto) - - -:doc:`Older versions ` - -Getting custodian -================= - -Stable version --------------- - -The version at the Python Package Index (PyPI) is always the latest stable -release that will be hopefully, be relatively bug-free. The easiest way to -install custodian on any system is to use easy_install or pip, as follows:: - - easy_install custodian - -or:: - - pip install custodian - -Some plugins (e.g., vasp management) require additional setup (please see -`pymatgen's documentation`_). - -Developmental version ---------------------- - -The bleeding edge developmental version is at the custodian's `Github repo -`_. The developmental -version is likely to be more buggy, but may contain new features. The -Github version include test files as well for complete unit testing. After -cloning the source, you can type:: - - python setup.py install - -or to install the package in developmental mode:: - - python setup.py develop - -Requirements -============ - -Custodian requires Python 2.7+. There are no other required dependencies. - -Optional dependencies ---------------------- - -Optional libraries that are required if you need certain features: - -1. Python Materials Genomics (`pymatgen`_) 2.8.10+: To use the plugin for - VASP, NwChem and Qchem. Please install using:: - - pip install pymatgen - - For more information, please consult `pymatgen's documentation`_. -2. nose - For complete unittesting. - -Usage -===== - -The main class in the workflow is known as Custodian, which manages a series -of jobs with a list of error handlers. The general workflow for Custodian is -presented in the figure below. - -.. figure:: _static/Custodian.png - :width: 500px - :align: center - :alt: Custodian workflow - :figclass: align-center - - Overview of the Custodian workflow. - -The Custodian class takes in two general inputs - a **list of Jobs** and -a **list of ErrorHandlers**. **Jobs** should be subclasses of the -:class:`custodian.custodian.Job` abstract base class and **ErrorHandlers** -should be subclasses of the :class:`custodian.custodian.ErrorHandler` abstract -base class. To use custodian, you need to implement concrete implementations -of these abstract base classes. - -Simple example --------------- - -An very simple example implementation is given in the custodian_examples.py -script in the scripts directory. We will now go through the example in detail -here. - -The ExampleJob has the following code. - -.. code-block:: python - - class ExampleJob(Job): - - def __init__(self, jobid, params=None): - if params is None: - params = {"initial": 0, "total": 0} - self.jobid = jobid - self.params = params - - def setup(self): - self.params["initial"] = 0 - self.params["total"] = 0 - - def run(self): - sequence = [random.uniform(0, 1) for i in range(100)] - self.params["total"] = self.params["initial"] + sum(sequence) - - def postprocess(self): - pass - - @property - def name(self): - return "ExampleJob{}".format(self.jobid) - - -The ExampleJob simply sums a random sequence of 100 numbers between 0 and -1, adds it to an initial value and puts the value in 'total' variable. The -ExampleJob subclasses the Job abstract base class, and implements the necessary -API comprising of just three key methods: **setup(), run(), -and postprocess()**. - -Let us now define an ErrorHandler that will check if the total value is >= 50, -and if it is not, it will increment the initial value by 1 and rerun the -ExampleJob again. - -.. code-block:: python - - - class ExampleHandler(ErrorHandler): - - def __init__(self, params): - self.params = params - - def check(self): - return self.params["total"] < 50 - - def correct(self): - self.params["initial"] += 1 - return {"errors": "total < 50", "actions": "increment by 1"} - -As you can see above, the ExampleHandler subclasses the ErrorHandler abstract -base class, and implements the necessary API comprising of just two key -methods: **check() and correct()**. - -The transfer of information between the Job and ErrorHandler is done using -the params argument in this example, which is not ideal but is sufficiently -for demonstrating the Custodian API. In real world usage, -a more common transfer of information may involve the Job writing the output -to a file, and the ErrorHandler checking the contents of those files to -detect error situations. - -To run the job, one simply needs to supply a list of ExampleJobs and -ErrorHandlers to a Custodian. - -.. code-block:: python - - njobs = 100 - params = {"initial": 0, "total": 0} - c = Custodian([ExampleHandler(params)], - [ExampleJob(i, params) for i in xrange(njobs)], - max_errors=njobs) - c.run() - -If you run custodian_example.py in the scripts directory, you will noticed that -a **custodian.json** file was generated, which summarizes the jobs that have -been run and any corrections performed. - -Practical example: Electronic structure calculations ----------------------------------------------------- - -A practical example where the Custodian framework is particularly useful is -in the area of electronic structure calculations. Electronic structure -calculations tend to be long running and often terminates due to errors, -random or otherwise. Such errors become a major issue in projects that -performs such calculations in high throughput, such as the `Materials -Project`_. - -The Custodian package comes with a fairly comprehensive plugin to deal -with jobs (:mod:`custodian.vasp.jobs`) and errors -(:mod:`custodian.vasp.handlers`) in electronic structure calculations based -on the Vienna Ab Initio Simulation Package (VASP). To do this, -Custodian uses the Python Materials Genomics (`pymatgen`_) package to -perform analysis and io from VASP input and output files. - -A simple example of a script using Custodian to run a two-relaxation VASP job -is as follows: - -.. code-block:: python - - from custodian.custodian import Custodian - from custodian.vasp.handlers import VaspErrorHandler, \ - UnconvergedErrorHandler, PoscarErrorHandler, DentetErrorHandler - from custodian.vasp.jobs import VaspJob - - handlers = [VaspErrorHandler(), UnconvergedErrorHandler(), - PoscarErrorHandler(), DentetErrorHandler()] - jobs = VaspJob.double_relaxation_run(args.command.split()) - c = Custodian(handlers, jobs, max_errors=10) - c.run() - -The above will gracefully deal with many VASP errors encountered during -relaxation. For example, it will correct ISMEAR to 0 if there are -insufficient KPOINTS to use ISMEAR = -5. - -Using custodian, you can even setup potentially indefinite jobs, -e.g. kpoints convergence jobs with a target energy convergence. Please see the -converge_kpoints script in the scripts for an example. - -.. versionadded:: 0.4.3 - - A new package for dealing with NwChem calculations has been added. - NwChem is an open-source code for performing computational chemistry - calculations. - -cstdn - A yaml-spec controlled job -================================== - -Custodian now comes with a cstdn script, which allows you to do fine-grained -control of a job using a yaml spec file. Below is an annotated example of how -you can specify a double VASP relaxation followed by a static calculation. -Minor modifications would allow very customizable calculations, though this is -obviously not meant for highly complex workflows. For those, usage of `FireWorks -`_ is highly recommended. - -Sample yaml spec:: - - # Specifies a list of jobs to run. - # Each job is specified by a `jb: ` with parameters specified - # via the params dict. - - jobs: - - jb: custodian.vasp.jobs.VaspJob - params: - final: False - suffix: .relax1 - - jb: custodian.vasp.jobs.VaspJob - params: - final: False - suffix: .relax2 - settings_override: - - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}} - - jb: custodian.vasp.jobs.VaspJob - params: - final: True - suffix: .static3 - settings_override: - - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}} - - {"dict": "INCAR", "action": {"_set": {"NSW": 0}}} - - - # This key specifies parameters common to all jobs. - # Keys starting with $ are expanded to the environmental values. - # The example below means the parameter vasp_cmd is set to the value with - # $PBS_NODEFILE expanded. - - jobs_common_params: - $vasp_cmd: ["mpirun", "-machinefile", "$PBS_NODEFILE", "-np", "24", "vasp"] - - - # Specifies a list of error handlers in the same format as jobs. Similarly, - # parameters passed to the handler __init__ can be configured the same - # way as for jobs. - handlers: - - hdlr: custodian.vasp.handlers.VaspErrorHandler - - hdlr: custodian.vasp.handlers.AliasingErrorHandler - - hdlr: custodian.vasp.handlers.MeshSymmetryErrorHandler - - # Specifies a list of error handlers in the same format as jobs. - validators: - - vldr: custodian.vasp.validators.VasprunXMLValidator - - #This sets all custodian running parameters. - custodian_params: - max_errors: 10 - scratch_dir: /tmp - gzipped_output: True - checkpoint: True - -You can then run the job using the following command:: - - cstdn run - -API/Reference Docs -================== - -The API docs are generated using Sphinx auto-doc and outlines the purpose of all -modules and classes, and the expected argument and returned objects for most -methods. They are available at the link below. - -:doc:`custodian API docs ` - -How to cite custodian -===================== - -If you use custodian in your research, especially the VASP component, please -consider citing the following work:: - - Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier, - Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent Chevrier, Kristin A. - Persson, Gerbrand Ceder. *Python Materials Genomics (pymatgen) : A Robust, - Open-Source Python Library for Materials Analysis.* Computational - Materials Science, 2013, 68, 314–319. `doi:10.1016/j.commatsci.2012.10.028 - `_ - -License -======= - -Custodian is released under the MIT License. The terms of the license are as -follows:: - - The MIT License (MIT) - Copyright (c) 2011-2012 MIT & LBNL - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software") - , to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - -.. _`pymatgen's documentation`: http://pymatgen.org -.. _`Materials Project`: https://www.materialsproject.org -.. _`pymatgen`: https://pypi.python.org/pypi/pymatgen diff --git a/docs/html/_sources/modules.rst.txt b/docs/html/_sources/modules.rst.txt deleted file mode 100644 index c241b4a4..00000000 --- a/docs/html/_sources/modules.rst.txt +++ /dev/null @@ -1,7 +0,0 @@ -custodian -========= - -.. toctree:: - :maxdepth: 6 - - custodian diff --git a/docs/html/_static/Custodian.png b/docs/html/_static/Custodian.png deleted file mode 100644 index 20e8e690..00000000 Binary files a/docs/html/_static/Custodian.png and /dev/null differ diff --git a/docs/html/_static/basic.css b/docs/html/_static/basic.css deleted file mode 100644 index c41d718e..00000000 --- a/docs/html/_static/basic.css +++ /dev/null @@ -1,763 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - -div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; -} - - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; - margin-left: auto; - margin-right: auto; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable ul { - margin-top: 0; - margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body { - min-width: 450px; - max-width: 800px; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -a.brackets:before, -span.brackets > a:before{ - content: "["; -} - -a.brackets:after, -span.brackets > a:after { - content: "]"; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -img.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-default { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -th > p:first-child, -td > p:first-child { - margin-top: 0px; -} - -th > p:last-child, -td > p:last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist td { - vertical-align: top; -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -li > p:first-child { - margin-top: 0px; -} - -li > p:last-child { - margin-bottom: 0px; -} - -dl.footnote > dt, -dl.citation > dt { - float: left; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -dl.field-list { - display: flex; - flex-wrap: wrap; -} - -dl.field-list > dt { - flex-basis: 20%; - font-weight: bold; - word-break: break-word; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - flex-basis: 70%; - padding-left: 1em; - margin-left: 0em; - margin-bottom: 0em; -} - -dl { - margin-bottom: 15px; -} - -dd > p:first-child { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, span.highlighted { - background-color: #fbe54e; -} - -rect.highlighted { - fill: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -.classifier:before { - font-style: normal; - margin: 0.5em; - content: ":"; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -span.eqno a.headerlink { - position: relative; - left: 0px; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/html/_static/doctools.js b/docs/html/_static/doctools.js deleted file mode 100644 index b33f87fc..00000000 --- a/docs/html/_static/doctools.js +++ /dev/null @@ -1,314 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { - this.initOnKeyListeners(); - } - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated === 'undefined') - return string; - return (typeof translated === 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated === 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) === 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this === '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/docs/html/_static/documentation_options.js b/docs/html/_static/documentation_options.js deleted file mode 100644 index 92680bf2..00000000 --- a/docs/html/_static/documentation_options.js +++ /dev/null @@ -1,10 +0,0 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '2019.8.23', - LANGUAGE: 'None', - COLLAPSE_INDEX: false, - FILE_SUFFIX: '.html', - HAS_SOURCE: true, - SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false -}; \ No newline at end of file diff --git a/docs/html/_static/favicon.ico b/docs/html/_static/favicon.ico deleted file mode 100644 index d086b444..00000000 Binary files a/docs/html/_static/favicon.ico and /dev/null differ diff --git a/docs/html/_static/file.png b/docs/html/_static/file.png deleted file mode 100644 index a858a410..00000000 Binary files a/docs/html/_static/file.png and /dev/null differ diff --git a/docs/html/_static/flasky.css b/docs/html/_static/flasky.css deleted file mode 100644 index f764eb5e..00000000 --- a/docs/html/_static/flasky.css +++ /dev/null @@ -1,445 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. Modifications by Kenneth Reitz. - * :license: Flask Design License, see LICENSE for details. - */ - - - - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro'; - font-size: 17px; - background-color: white; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - width: 940px; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 220px; -} - -div.sphinxsidebar { - width: 220px; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - width: 940px; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -div.related { - display: none; -} - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebar { - font-size: 14px; - line-height: 1.5; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0; - margin: -10px 0 0 -20px; - text-align: center; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: 'Georgia', serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #ddd; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition tt.xref, div.admonition a tt { - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; - background: #fdfdfd; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td.label { - width: 0px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #eee; - padding: 7px 30px; - margin: 15px -30px; - line-height: 1.3em; -} - -dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid white; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt { - background: #EEE; -} - - -@media screen and (max-width: 600px) { - - div.sphinxsidebar { - display: none; - } - - div.document { - width: 100%; - - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - .document { - width: auto; - } - - .footer { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - .github { - display: none; - } - -} - -/* misc. */ - -.revsys-inline { - display: none!important; -} \ No newline at end of file diff --git a/docs/html/_static/jquery-3.2.1.js b/docs/html/_static/jquery-3.2.1.js deleted file mode 100644 index d2d8ca47..00000000 --- a/docs/html/_static/jquery-3.2.1.js +++ /dev/null @@ -1,10253 +0,0 @@ -/*! - * jQuery JavaScript Library v3.2.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2017-03-20T18:59Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - - - - function DOMEval( code, doc ) { - doc = doc || document; - - var script = doc.createElement( "script" ); - - script.text = code; - doc.head.appendChild( script ).parentNode.removeChild( script ); - } -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.2.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - - if ( copyIsArray ) { - copyIsArray = false; - clone = src && Array.isArray( src ) ? src : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - - /* eslint-disable no-unused-vars */ - // See https://github.com/eslint/eslint/issues/6125 - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - globalEval: function( code ) { - DOMEval( code ); - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE <=9 - 11, Edge 12 - 13 - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.3 - * https://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-08-08 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - disabledAncestor = addCombinator( - function( elem ) { - return elem.disabled === true && ("form" in elem || "label" in elem); - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - disabledAncestor( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID filter and find - if ( support.getById ) { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - !compilerCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - // Use previously-cached element index if available - if ( useCache ) { - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context === document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - if ( !context && elem.ownerDocument !== document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( el ) { - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( el ) { - return el.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -}; -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Simple selector that can be filtered directly, removing non-Elements - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - // Complex selector, compare the two sets, removing non-Elements - qualifier = jQuery.filter( qualifier, elements ); - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; - } ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( nodeName( elem, "iframe" ) ) { - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( jQuery.isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( jQuery.isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - jQuery.isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ jQuery.camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ jQuery.camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( jQuery.camelCase ); - } else { - key = jQuery.camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - jQuery.contains( elem.ownerDocument, elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - -var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, - scale = 1, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - do { - - // If previous iteration zeroed out, double until we get *something*. - // Use string for doubling so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - initialInUnit = initialInUnit / scale; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // Break the loop if scale is unchanged or perfect, or if we've just had enough. - } while ( - scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations - ); - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); - -var rscriptType = ( /^$|\/(?:java|ecma)script/i ); - - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // Support: IE <=9 only - option: [ 1, "" ], - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
    " ], - col: [ 2, "", "
    " ], - tr: [ 2, "", "
    " ], - td: [ 3, "", "
    " ], - - _default: [ 0, "", "" ] -}; - -// Support: IE <=9 only -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -} )(); -var documentElement = document.documentElement; - - - -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 only -// See #13393 for more info -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = {}; - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: jQuery.isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } -}, jQuery.event.addProp ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - - // Support: IE <=10 - 11, Edge 12 - 13 - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( ">tbody", elem )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rmargin = ( /^margin/ ); - -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - div.style.cssText = - "box-sizing:border-box;" + - "position:relative;display:block;" + - "margin:auto;border:1px;padding:1px;" + - "top:1%;width:50%"; - div.innerHTML = ""; - documentElement.appendChild( container ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = divStyle.marginLeft === "2px"; - boxSizingReliableVal = divStyle.width === "4px"; - - // Support: Android 4.0 - 4.3 only - // Some styles come back with percentage values, even though they shouldn't - div.style.marginRight = "50%"; - pixelMarginRightVal = divStyle.marginRight === "4px"; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + - "padding:0;margin-top:1px;position:absolute"; - container.appendChild( div ); - - jQuery.extend( support, { - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelMarginRight: function() { - computeStyleTests(); - return pixelMarginRightVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }, - - cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style; - -// Return a css property mapped to a potentially vendor prefixed property -function vendorPropName( name ) { - - // Shortcut for names that are not vendor prefixed - if ( name in emptyStyle ) { - return name; - } - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a property mapped along what jQuery.cssProps suggests or to -// a vendor prefixed property. -function finalPropName( name ) { - var ret = jQuery.cssProps[ name ]; - if ( !ret ) { - ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; - } - return ret; -} - -function setPositiveNumber( elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i, - val = 0; - - // If we already have the right measurement, avoid augmentation - if ( extra === ( isBorderBox ? "border" : "content" ) ) { - i = 4; - - // Otherwise initialize for horizontal or vertical properties - } else { - i = name === "width" ? 1 : 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // At this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - - // At this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // At this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with computed style - var valueIsBorderBox, - styles = getStyles( elem ), - val = curCSS( elem, name, styles ), - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test( val ) ) { - return val; - } - - // Check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && - ( support.boxSizingReliable() || val === elem.style[ name ] ); - - // Fall back to offsetWidth/Height when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - if ( val === "auto" ) { - val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; - } - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - - // Use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - "float": "cssFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - if ( type === "number" ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = jQuery.camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( i, name ) { - jQuery.cssHooks[ name ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, name, extra ); - } ) : - getWidthOrHeight( elem, name, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = extra && getStyles( elem ), - subtract = extra && augmentWidthOrHeight( - elem, - name, - extra, - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - styles - ); - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ name ] = value; - value = jQuery.css( elem, name ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( !rmargin.test( prefix ) ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && - ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || - jQuery.cssHooks[ tween.prop ] ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = jQuery.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 13 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = jQuery.camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( jQuery.isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - jQuery.proxy( result.stop, result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( jQuery.isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( jQuery.isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - jQuery.isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( jQuery.isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = jQuery.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( jQuery.isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - if ( typeof value === "string" && value ) { - classes = value.match( rnothtmlwhite ) || []; - - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( type === "string" ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = value.match( rnothtmlwhite ) || []; - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, isFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup contextmenu" ).split( " " ), - function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; -} ); - -jQuery.fn.extend( { - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -} ); - - - - -support.focusin = "onfocusin" in window; - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = jQuery.now(); - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && jQuery.type( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = jQuery.isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( jQuery.isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; - } - } - match = responseHeaders[ key.toLowerCase() ]; - } - return match == null ? null : match; - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 13 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available, append data to url - if ( s.data ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( jQuery.isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - - -jQuery._evalUrl = function( url ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - "throws": true - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( jQuery.isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain requests - if ( s.crossDomain ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    krTheme Sphinx Style

    -

    This repository contains sphinx styles Kenneth Reitz uses in most of -his projects. It is a drivative of Mitsuhiko’s themes for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide:

    -
      -
    1. put this folder as _themes into your docs folder. Alternatively -you can also use git submodules to check out the contents there.

    2. -
    3. add this to your conf.py:

      -
      sys.path.append(os.path.abspath('_themes'))
      -html_theme_path = ['_themes']
      -html_theme = 'kr'
      -
      -
      -
    4. -
    -

    The following themes exist:

    -
    -
    kr

    the standard flask documentation theme for large projects

    -
    -
    kr_small

    small one-page theme. Intended to be used by very small addon libraries.

    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/changelog.html b/docs/html/changelog.html deleted file mode 100644 index 189415cf..00000000 --- a/docs/html/changelog.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - - - - Change Log — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    Change Log

    -
    -

    v2017.12.23

    -
      -
    • cstdn command line tool is now official with docs.

    • -
    • Fine-grained control of VaspErrorHandler is now possible using -errors_subset_to_catch.

    • -
    • Switched to date-based versioning for custodian like pymatgen.

    • -
    -
    -
    -

    v1.1.1

    -
      -
    • DriftErrorHandler (Shyam)

    • -
    -
    -
    -

    v1.1.0

    -
      -
    • Improved error handling for Qchem calculations.

    • -
    -
    -
    -

    v1.0.4

    -
      -
    • Improved handling of non-zero return codes.

    • -
    -
    -
    -

    v1.0.2

    -
      -
    • Interrupted run feature. (Shyam Dwaraknath)

    • -
    -
    -
    -

    v1.0.1

    -
      -
    • Pymatgen 4.0.0 compatible release.

    • -
    -
    -
    -

    v1.0.0

    -
      -
    • Custodian now comes with a “cstdn” script that enables the arbitrary creation -of simple job sequences using a yaml file, and the running of calculations -based on these yaml specifications.

    • -
    -
    -
    -

    v0.8.8

    -
      -
    1. Fix setup.py.

    2. -
    -
    -
    -

    v0.8.5

    -
      -
    1. Refactoring to support pymatgen 3.1.4.

    2. -
    -
    -
    -

    v0.8.2

    -
      -
    1. Made auto_npar optional for double relaxation VASP run.

    2. -
    -
    -
    -

    v0.8.1

    -
      -
    1. Misc bug fixes (minor).

    2. -
    -
    -
    -

    v0.8.0

    -
      -
    1. Major refactoring of Custodian to introdce Validators, -which are effectively post-Job checking mechanisms that do not perform -error correction.

    2. -
    3. Backwards incompatibility BadVasprunXMLHandler is now a validator, -which must be separately imported to be used.

    4. -
    -

    3. Miscellaneous cleanup of Py3k fixes. -v0.7.6 -—— -1. Custodian is now Python 3 compatible and uses the latest versions of

    -
    -

    pymatgen and monty.

    -
    -
    -
    -

    v0.7.5

    -
      -
    1. Major Custodian now exits with RuntimeError when max_errors or -unrecoverable_error is encountered.

    2. -
    3. Added BadVasprunXMLHandler.

    4. -
    -
    -
    -

    v0.7.4

    -
      -
    1. auto_npar option in VaspJob now properly handles Hessian calculations.

    2. -
    3. WalltimeHandler now supports termination at electronic step (David -Waroquiers).

    4. -
    5. Improved handling of BRMIX fixes.

    6. -
    -
    -
    -

    v0.7.3

    -
      -
    1. Improved backwards compatibility for WallTimeHandler.

    2. -
    3. Improvements to VaspErrorHandler. No longer catches spurious BRMIX error -messages when NELECT is specified in INCAR, and pricel and rot_mat errors -are now fixed with symmetry precision and gamma centered KPOINTS instead.

    4. -
    5. Improved Qchem error handler (Xiaohui Qu).

    6. -
    -
    -
    -

    v0.7.2

    -
      -
    1. Improved WalltimeHandler (PBSWalltimeHandler is a subset and is now -deprecated).

    2. -
    3. New monty required version (>= 0.2.2).

    4. -
    -
    -
    -

    v0.7.1

    -
      -
    1. Much improved qchem error handling (Xiaohui Qu).

    2. -
    3. New Monty required version (>= 0.2.0).

    4. -
    -
    -
    -

    v0.7.0

    -
      -
    1. **Backwards incompatible with v0.6.3. Refactoring to move commonly used -Python utility functions to Monty package, which is now a depedency -for custodian.

    2. -
    3. Custodian now requires pymatgen >= 2.9.0 for VASP, Qchem and Nwchem jobs -and handlers.

    4. -
    5. converge_kpoints script now has increment mode.

    6. -
    7. ErrorHandlers now have a new API, where the class variables “is_monitor” -and “is_terminating” are provided to indicate if a particular handler -runs in the background during a Job and whether a handler should -terminate the job. Some errors may not be critical or may need to wait -for some other event to terminate a job. For example, -a particular error may require a flag to be set to request a job to -terminate gracefully once it finishes its current task. The handler to -set the flag should not terminate the job.

    8. -
    -
    -
    -

    0.6.3

    -
      -
    1. Added buffer time option in PBSWalltimeHandler.

    2. -
    3. Improved Qchem jobs and handlers (Xiaohui Qu).

    4. -
    5. Vastly improved API docs.

    6. -
    -
    -
    -

    0.6.2

    -
      -
    1. Bug fix release to support sub dirs in run folder when using scratch.

    2. -
    3. Improve handling of walltime in PBSWalltimeHander.

    4. -
    -
    -
    -

    0.6.1

    -
      -
    1. Bug fix release to address minor issue with checkpointing.

    2. -
    3. Checkpointing is now turned off by default.

    4. -
    -
    -
    -

    0.6.0

    -
      -
    1. Checkpointing implemented for Custodian. Custodian can now checkpoint all -files in the current working directory after every successful job. If the -job is resubmitted, it will restore files and start from the last -checkpoint. Particularly useful for multi-job runs.

    2. -
    3. Added PBSWalltimeHandler to handle wall times for PBS Vasp Jobs.

    4. -
    5. Qchem error handlers and jobs.

    6. -
    -
    -
    -

    0.5.0

    -
      -
    1. Added scratch_dir option to Custodian class as well as run_vasp and -run_nwchem scripts. Many supercomputing clusters have a scratch space -which have significantly faster IO. This option provides a transparent way -to specify the jobs to be performed in the scratch. Especially useful for -jobs which have significant file IO.

    2. -
    -
    -
    -

    0.4.5

    -
      -
    1. Fix gzip of output.

    2. -
    -
    -
    -

    0.4.3

    -
      -
    1. Added handling for ZBRENT error for VASP.

    2. -
    3. Minor refactoring to consolidate backup and gzip directory methods.

    4. -
    -
    -
    -

    0.4.2

    -
      -
    1. Rudimentary support for Nwchem error handling (by Shyue Ping Ong).

    2. -
    3. Improved VASP error handling (by Steve Dacek and Will Richards).

    4. -
    -
    -
    -

    0.4.1

    -
      -
    1. Added hanlding of PRICEL error in VASP.

    2. -
    3. Speed and robustness improvements.

    4. -
    5. BRIONS error now handled by changing ISYM.

    6. -
    -
    -
    -

    0.4.0

    -
      -
    1. Many VASP handlers are now consolidated into a single VaspErrorHandler.

    2. -
    3. Many more fixes for VASP runs, including the “TOO FEW BANDS”, -“TRIPLE PRODUCT”, “DENTET” and “BRIONS” errors.

    4. -
    5. VaspJob now includes the auto_npar and auto_gamma options, which -automatically optimizes the NPAR setting to be sqrt(number of cores) as -per the VASP recommendation for DFT runs and tries to search for a -gamma-only compiled version of VASP for gamma 1x1x1 runs.

    6. -
    -
    -
    -

    0.3.5

    -
      -
    1. Bug fix for incorrect shift error handler in VASP.

    2. -
    3. More robust fix for unconverged VASP runs (switching from ALGO fast to -normal).

    4. -
    5. Expanded documentation.

    6. -
    -
    -
    -

    0.3.4

    -
      -
    1. Added support for handlers that perform monitor a job as it is progressing -and terminates it if necessary. Useful for correcting errors that come up -by do not cause immediate job failures.

    2. -
    -
    -
    -

    0.3.2

    -
      -
    1. Important bug fix for VaspJob and converge_kpoints script.

    2. -
    -
    -
    -

    0.3.0

    -
      -
    1. Major update to custodian API. Custodian now perform more comprehensive -logging in a file called custodian.json, which logs all jobs and -corrections performed.

    2. -
    -
    -
    -

    Version 0.2.6

    -
      -
    1. Bug fix for run_vasp script for static runs.

    2. -
    -
    -
    -

    Version 0.2.5

    -
      -
    1. run_vasp script that now provides flexible specification of vasp runs.

    2. -
    3. Vastly improved error handling for VASP runs.

    4. -
    5. Improved logging system for custodian.

    6. -
    7. Improved API for custodian return types during run.

    8. -
    9. First stable release.

    10. -
    -
    -
    -

    Version 0.2.4

    -
      -
    1. Bug fixes for aflow style runs assimilation.

    2. -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.ansible.html b/docs/html/custodian.ansible.html deleted file mode 100644 index e405f348..00000000 --- a/docs/html/custodian.ansible.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - - - custodian.ansible package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.ansible package

    -
    -

    Subpackages

    -
    -
    -
    -
    -

    Submodules

    -
    -
    -

    custodian.ansible.actions module

    -
    -
    -class DictActions[source]
    -

    Bases: object

    -

    Class to implement the supported mongo-like modifications on a dict. -Supported keywords include the following Mongo-based keywords, with the -usual meanings (refer to Mongo documentation for information):

    -
    -

    _inc -_set -_unset -_push -_push_all -_add_to_set (but _each is not supported) -_pop -_pull -_pull_all -_rename

    -
    -

    However, note that “_set” does not support modification of nested dicts -using the mongo {“a.b”:1} notation. This is because mongo does not allow -keys with “.” to be inserted. Instead, nested dict modification is -supported using a special “->” keyword, e.g. {“a->b”: 1}

    -
    -
    -static add_to_set(input_dict, settings)[source]
    -
    - -
    -
    -static inc(input_dict, settings)[source]
    -
    - -
    -
    -static pop(input_dict, settings)[source]
    -
    - -
    -
    -static pull(input_dict, settings)[source]
    -
    - -
    -
    -static pull_all(input_dict, settings)[source]
    -
    - -
    -
    -static push(input_dict, settings)[source]
    -
    - -
    -
    -static push_all(input_dict, settings)[source]
    -
    - -
    -
    -static rename(input_dict, settings)[source]
    -
    - -
    -
    -static set(input_dict, settings)[source]
    -
    - -
    -
    -static unset(input_dict, settings)[source]
    -
    - -
    - -
    -
    -class FileActions[source]
    -

    Bases: object

    -

    Class of supported file actions. For FileActions, the modder class takes in -a filename as a string. The filename should preferably be a full path to -avoid ambiguity.

    -
    -
    -static file_copy(filename, settings)[source]
    -

    Copies a file. {‘_file_copy’: {‘dest’: ‘new_file_name’}}

    -
    -
    Parameters
    -
      -
    • filename (str) – Filename.

    • -
    • settings (dict) – Must be {“dest”: path of new file}

    • -
    -
    -
    -
    - -
    -
    -static file_create(filename, settings)[source]
    -

    Creates a file.

    -
    -
    Parameters
    -
      -
    • filename (str) – Filename.

    • -
    • settings (dict) – Must be {“content”: actual_content}

    • -
    -
    -
    -
    - -
    -
    -static file_delete(filename, settings)[source]
    -

    Deletes a file. {‘_file_delete’: {‘mode’: “actual”}}

    -
    -
    Parameters
    -
      -
    • filename (str) – Filename.

    • -
    • settings (dict) – Must be {“mode”: actual/simulated}. Simulated -mode only prints the action without performing it.

    • -
    -
    -
    -
    - -
    -
    -static file_modify(filename, settings)[source]
    -

    Modifies file access

    -
    -
    Parameters
    -
      -
    • filename (str) – Filename.

    • -
    • settings (dict) – Can be “mode” or “owners”

    • -
    -
    -
    -
    - -
    -
    -static file_move(filename, settings)[source]
    -

    Moves a file. {‘_file_move’: {‘dest’: ‘new_file_name’}}

    -
    -
    Parameters
    -
      -
    • filename (str) – Filename.

    • -
    • settings (dict) – Must be {“dest”: path of new file}

    • -
    -
    -
    -
    - -
    - -
    -
    -get_nested_dict(input_dict, key)[source]
    -
    - -
    -
    -

    custodian.ansible.interpreter module

    -
    -
    -class Modder(actions=None, strict=True)[source]
    -

    Bases: object

    -

    Class to modify a dict/file/any object using a mongo-like language. -Keywords are mostly adopted from mongo’s syntax, but instead of $, an -underscore precedes action keywords. This is so that the modification can -be inserted into a mongo db easily.

    -

    Allowable actions are supplied as a list of classes as an argument. Refer -to the action classes on what the actions do. Action classes are in -pymatpro.ansible.actions.

    -

    Examples: ->>> modder = Modder() ->>> d = {“Hello”: “World”} ->>> mod = {‘_set’: {‘Hello’:’Universe’, ‘Bye’: ‘World’}} ->>> modder.modify(mod, d) ->>> d[‘Bye’] -‘World’ ->>> d[‘Hello’] -‘Universe’

    -

    Initializes a Modder from a list of supported actions.

    -
    -
    Parameters
    -
      -
    • actions ([Action]) – A sequence of supported actions. See -custodian.ansible.actions. Default is None, -which means only DictActions are supported.

    • -
    • strict (bool) – Indicating whether to use strict mode. In non-strict -mode, unsupported actions are simply ignored without any -errors raised. In strict mode, if an unsupported action is -supplied, a ValueError is raised. Defaults to True.

    • -
    -
    -
    -
    -
    -modify(modification, obj)[source]
    -

    Note that modify makes actual in-place modifications. It does not -return a copy.

    -
    -
    Parameters
    -
      -
    • modification (dict) – Modification must be {action_keyword : -settings}. E.g., {‘_set’: {‘Hello’:’Universe’, ‘Bye’: ‘World’}}

    • -
    • obj (dict/str/object) – Object to modify depending on actions. For -example, for DictActions, obj will be a dict to be modified. -For FileActions, obj will be a string with a full pathname to a -file.

    • -
    -
    -
    -
    - -
    -
    -modify_object(modification, obj)[source]
    -

    Modify an object that supports pymatgen’s as_dict() and from_dict API.

    -
    -
    Parameters
    -
      -
    • modification (dict) – Modification must be {action_keyword : -settings}. E.g., {‘_set’: {‘Hello’:’Universe’, ‘Bye’: ‘World’}}

    • -
    • obj (object) – Object to modify

    • -
    -
    -
    -
    - -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.cli.html b/docs/html/custodian.cli.html deleted file mode 100644 index adf3c0d0..00000000 --- a/docs/html/custodian.cli.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - custodian.cli package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.cli package

    -
    -

    Submodules

    -
    -
    -

    custodian.cli.converge_geometry module

    -

    This is a script to converge the geometry of a system

    -
    -
    -do_run(args)[source]
    -
    - -
    -
    -get_runs(args)[source]
    -
    - -
    -
    -

    custodian.cli.converge_kpoints module

    -

    This is a master vasp running script to perform variuos combinations of VASP -runs.

    -
    -
    -do_run(args)[source]
    -
    - -
    -
    -get_runs(vasp_command, target=0.001, max_steps=10, mode='linear')[source]
    -
    - -
    -
    -main()[source]
    -
    - -
    -
    -

    custodian.cli.cstdn module

    -
    -
    -main()[source]
    -
    - -
    -
    -print_example(args)[source]
    -
    - -
    -
    -run(args)[source]
    -
    - -
    -
    -

    custodian.cli.run_nwchem module

    -

    Basic script to run nwchem job.

    -
    -
    -do_run(args)[source]
    -
    - -
    -
    -main()[source]
    -
    - -
    -
    -

    custodian.cli.run_vasp module

    -

    This is a master vasp running script to perform various combinations of VASP -runs.

    -
    -
    -do_run(args)[source]
    -
    - -
    -
    -get_jobs(args)[source]
    -
    - -
    -
    -load_class(mod, name)[source]
    -
    - -
    -
    -main()[source]
    -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.feff.html b/docs/html/custodian.feff.html deleted file mode 100644 index 95900a3a..00000000 --- a/docs/html/custodian.feff.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - custodian.feff package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.feff package

    -
    -

    Subpackages

    -
    -
    -
    -
    -

    Submodules

    -
    -
    -

    custodian.feff.handlers module

    -
    -
    -class UnconvergedErrorHandler(output_filename='log1.dat')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Correct the unconverged error of FEFF’s SCF calculation.

    -

    Initializes the handler with the output file to check

    -
    -
    Parameters
    -

    output_filename (str) – Filename for the log1.dat file. log1.dat file -contains the SCF calculation convergence information. Change this only -if it is different from the default (unlikely).

    -
    -
    -
    -
    -check()[source]
    -

    If the FEFF run does not converge, the check will return -“TRUE”

    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -

    custodian.feff.interpreter module

    -
    -
    -class FeffModder(actions=None, strict=True, feffinp=None)[source]
    -

    Bases: custodian.ansible.interpreter.Modder

    -

    Initializes a Modder for FeffInput sets

    -
    -
    Parameters
    -
      -
    • actions ([Action]) – A sequence of supported actions. See

    • -
    • actions – A sequence of supported actions. See -custodian.ansible.actions. Default is None, -which means DictActions and FileActions are supported.

    • -
    • strict (bool) – Indicating whether to use strict mode. In non-strict -mode, unsupported actions are simply ignored without any -errors raised. In strict mode, if an unsupported action is -supplied, a ValueError is raised. Defaults to True.

    • -
    • feffinp (FEFFInput) – A FeffInput object from the current directory. -Initialized automatically if not passed (but passing it will -avoid having to reparse the directory).

    • -
    -
    -
    -
    -
    -apply_actions(actions)[source]
    -

    Applies a list of actions to the FEFF Input Set and rewrites modified -files.

    -
    -
    Parameters
    -

    [dict] (actions) – A list of actions of the form {‘file’: filename, -‘action’: moddermodification} or {‘dict’: feffinput_key, -‘action’: moddermodification}

    -
    -
    -
    - -
    - -
    -
    -

    custodian.feff.jobs module

    -
    -
    -class FeffJob(feff_cmd, output_file='feff.out', stderr_file='std_feff_err.txt', backup=True, gzipped=False, gzipped_prefix='feff_out')[source]
    -

    Bases: custodian.custodian.Job

    -

    A basic FEFF job, run whatever is in the directory.

    -

    This constructor is used for a standard FEFF initialization

    -
    -
    Parameters
    -
      -
    • feff_cmd (str) – the name of the full executable for running FEFF

    • -
    • output_file (str) – Name of file to direct standard out to. -Defaults to “feff.out”.

    • -
    • stderr_file (str) – Name of file direct standard error to. -Defaults to “std_feff_err.txt”.

    • -
    • backup (bool) – Indicating whether to backup the initial input files. -If True, the feff.inp will be copied with a “.orig” appended. -Defaults to True.

    • -
    • gzipped (bool) – Whether to gzip the final output. Defaults to False.

    • -
    • gzipped_prefix (str) – prefix to the feff output files archive. Defaults -to feff_out, which means a series of feff_out.1.tar.gz, feff_out.2.tar.gz, … -will be generated.

    • -
    -
    -
    -
    -
    -postprocess()[source]
    -

    Renaming or gzipping all the output as needed

    -
    - -
    -
    -run()[source]
    -

    Performs the actual FEFF run -:returns: (subprocess.Popen) Used for monitoring.

    -
    - -
    -
    -setup()[source]
    -

    Performs initial setup for FeffJob, do backing up. -Returns:

    -
    - -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.html b/docs/html/custodian.html deleted file mode 100644 index 556c0eb5..00000000 --- a/docs/html/custodian.html +++ /dev/null @@ -1,682 +0,0 @@ - - - - - - - custodian package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian package

    - -
    -

    Submodules

    -
    -
    -

    custodian.custodian module

    -
    -
    -class Custodian(handlers, jobs, validators=None, max_errors_per_job=None, max_errors=1, polling_time_step=10, monitor_freq=30, skip_over_errors=False, scratch_dir=None, gzipped_output=False, checkpoint=False, terminate_func=None, terminate_on_nonzero_returncode=True)[source]
    -

    Bases: object

    -

    The Custodian class is the manager for a list of jobs given a list of -error handlers. The way it works is as follows:

    -
      -
    1. Let’s say you have defined a list of jobs as [job1, job2, job3, …] and -you have defined a list of possible error handlers as [err1, err2, …]

    2. -
    3. Custodian will run the jobs in the order of job1, job2, … During each -job, custodian will monitor for errors using the handlers that have -is_monitor == True. If an error is detected, corrective measures are -taken and the particular job is rerun.

    4. -
    5. At the end of each individual job, Custodian will run through the list -error handlers that have is_monitor == False. If an error is detected, -corrective measures are taken and the particular job is rerun.

    6. -
    -

    Initializes a Custodian from a list of jobs and error handler.s

    -
    -
    Parameters
    -
      -
    • handlers ([ErrorHandler]) – Error handlers. In order of priority of -fixing.

    • -
    • jobs ([Job]) – Sequence of Jobs to be run. Note that this can be -any sequence or even a generator yielding jobs.

    • -
    • validators ([Validator]) – Validators to ensure job success

    • -
    • max_errors_per_job (int) – Maximum number of errors per job allowed -before exiting. Defaults to None, which means it is set to be -equal to max_errors..

    • -
    • max_errors (int) – Maximum number of total errors allowed before -exiting. Defaults to 1.

    • -
    • polling_time_step (int) – The length of time in seconds between -steps in which a job is checked for completion. Defaults to -10 secs.

    • -
    • monitor_freq (int) – The number of polling steps before monitoring -occurs. For example, if you have a polling_time_step of 10 -seconds and a monitor_freq of 30, this means that Custodian -uses the monitors to check for errors every 30 x 10 = 300 -seconds, i.e., 5 minutes.

    • -
    • skip_over_errors (bool) – If set to True, custodian will skip over -error handlers that failed (raised an Exception of some sort). -Otherwise, custodian will simply exit on unrecoverable errors. -The former will lead to potentially more robust performance, -but may make it difficult to improve handlers. The latter -will allow one to catch potentially bad error handler -implementations. Defaults to False.

    • -
    • scratch_dir (str) – If this is set, any files in the current -directory are copied to a temporary directory in a scratch -space first before any jobs are performed, and moved back to -the current directory upon completion of all jobs. This is -useful in some setups where a scratch partition has much -faster IO. To use this, set scratch_dir=root of directory you -want to use for runs. There is no need to provide unique -directory names; we will use python’s tempfile creation -mechanisms. A symbolic link is created during the course of -the run in the working directory called “scratch_link” as -users may want to sometimes check the output during the -course of a run. If this is None (the default), the run is -performed in the current working directory.

    • -
    • gzipped_output (bool) – Whether to gzip the final output to save -space. Defaults to False.

    • -
    • checkpoint (bool) – Whether to checkpoint after each successful Job. -Checkpoints are stored as custodian.chk.#.tar.gz files. Defaults -to False.

    • -
    • terminate_func (callable) – A function to be called to terminate a -running job. If None, the default is to call Popen.terminate.

    • -
    • terminate_on_nonzero_returncode (bool) – If True, a non-zero return -code on any Job will result in a termination. Defaults to True.

    • -
    -
    -
    -
    -
    -LOG_FILE = 'custodian.json'
    -
    - -
    -
    -classmethod from_spec(spec)[source]
    -

    Load a Custodian instance where the jobs are specified from a -structure and a spec dict. This allows simple -custom job sequences to be constructed quickly via a YAML file.

    -
    -
    Parameters
    -

    spec (dict) –

    A dict specifying job. A sample of the dict in -YAML format for the usual MP workflow is given as follows

    -

    ``` -jobs: -- jb: custodian.vasp.jobs.VaspJob

    -
    -
    -
    params:

    final: False -suffix: .relax1

    -
    -
    -
    -
      -
    • jb: custodian.vasp.jobs.VaspJob -params:

      -
      -

      final: True -suffix: .relax2 -settings_override: {“file”: “CONTCAR”, “action”: {“_file_copy”: {“dest”: “POSCAR”}}

      -
      -
    • -
    -
    -
    jobs_common_params:

    vasp_cmd: /opt/vasp

    -
    -
    -

    handlers: -- hdlr: custodian.vasp.handlers.VaspErrorHandler -- hdlr: custodian.vasp.handlers.AliasingErrorHandler -- hdlr: custodian.vasp.handlers.MeshSymmetryHandler -validators: -- vldr: custodian.vasp.validators.VasprunXMLValidator -custodian_params:

    -
    -

    scratch_dir: /tmp

    -
    -

    ```

    -

    The jobs key is a list of jobs. Each job is -specified via “job”: <explicit path>, and all parameters are -specified via params which is a dict.

    -

    common_params specify a common set of parameters that are -passed to all jobs, e.g., vasp_cmd.

    -

    -
    -
    Returns
    -

    Custodian instance.

    -
    -
    -
    - -
    -
    -run()[source]
    -

    Runs all jobs.

    -
    -
    Returns
    -

    All errors encountered as a list of list. -[[error_dicts for job 1], [error_dicts for job 2], ….]

    -
    -
    Raises
    -
    -
    -
    -
    - -
    -
    -run_interrupted()[source]
    -

    Runs custodian in a interuppted mode, which sets up and -validates jobs but doesn’t run the executable

    -
    -
    Returns
    -

    number of remaining jobs

    -
    -
    Raises
    -
    -
    -
    -
    - -
    - -
    -
    -exception CustodianError(message, raises=False)[source]
    -

    Bases: RuntimeError

    -

    Exception class for Custodian errors.

    -

    Initializes the error with a message.

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    -
    -
    -
    - -
    -
    -class ErrorHandler[source]
    -

    Bases: monty.json.MSONable

    -

    Abstract base class defining the interface for an ErrorHandler.

    -
    -
    -abstract check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -abstract correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -

    This class property indicates whether the error handler is a monitor, -i.e., a handler that monitors a job as it is running. If a -monitor-type handler notices an error, the job will be sent a -termination signal, the error is then corrected, -and then the job is restarted. This is useful for catching errors -that occur early in the run but do not cause immediate failure.

    -
    - -
    -
    -is_terminating = True
    -

    Whether this handler terminates a job upon error detection. By -default, this is True, which means that the current Job will be -terminated upon error detection, corrections applied, -and restarted. In some instances, some errors may not need the job to be -terminated or may need to wait for some other event to terminate a job. -For example, a particular error may require a flag to be set to request -a job to terminate gracefully once it finishes its current task. The -handler to set the flag should be classified as is_terminating = False to -not terminate the job.

    -
    - -
    -
    -max_num_corrections = None
    -
    - -
    -
    -property n_applied_corrections
    -

    The number of times the handler has given a correction and this -has been applied.

    -
    -
    Returns
    -

    the number of corrections applied.

    -
    -
    Return type
    -

    (int)

    -
    -
    -
    - -
    -
    -raise_on_max = False
    -

    Whether corrections from this specific handler should be applied only a -fixed maximum number of times on a single job (i.e. the counter is reset -at the beginning of each job). If the maximum number is reached the code -will either raise a MaxCorrectionsPerHandlerError (raise_on_max==True) or stops -considering the correction (raise_on_max==False). If max_num_corrections -is None this option is not considered. These options can be overridden -as class attributes of the subclass or as customizable options setting -an instance attribute from __init__.

    -
    - -
    -
    -raises_runtime_error = True
    -

    Whether this handler causes custodian to raise a runtime error if it cannot -handle the error (i.e. if correct returns a dict with “actions”:None, or -“actions”:[])

    -
    - -
    - -
    -
    -class Job[source]
    -

    Bases: monty.json.MSONable

    -

    Abstract base class defining the interface for a Job.

    -
    -
    -property name
    -

    A nice string name for the job.

    -
    - -
    -
    -abstract postprocess()[source]
    -

    This method is called at the end of a job, after error detection. -This allows post-processing, such as cleanup, analysis of results, -etc.

    -
    - -
    -
    -abstract run()[source]
    -

    This method perform the actual work for the job. If parallel error -checking (monitoring) is desired, this must return a Popen process.

    -
    - -
    -
    -abstract setup()[source]
    -

    This method is run before the start of a job. Allows for some -pre-processing.

    -
    - -
    -
    -terminate()[source]
    -
    - -
    - -
    -
    -exception MaxCorrectionsError(message, raises, max_errors)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when the maximum allowed number of errors is reached

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    • max_errors (int) – the number of errors reached

    • -
    -
    -
    -
    - -
    -
    -exception MaxCorrectionsPerHandlerError(message, raises, max_errors_per_handler, handler)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when the maximum allowed number of errors per handler is reached

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    • max_errors_per_handler (int) – the number of errors per job reached

    • -
    • handler (Handler) – the handler that caused the exception

    • -
    -
    -
    -
    - -
    -
    -exception MaxCorrectionsPerJobError(message, raises, max_errors_per_job, job)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when the maximum allowed number of errors per job is reached

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    • max_errors_per_job (int) – the number of errors per job reached

    • -
    • job (Job) – the job that was stopped

    • -
    -
    -
    -
    - -
    -
    -exception NonRecoverableError(message, raises, handler)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when a handler found an error but could not fix it

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    • handler (Handler) – Handler that caused the exception.

    • -
    -
    -
    -
    - -
    -
    -exception ReturnCodeError(message, raises=False)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when the process gave non zero return code

    -

    Initializes the error with a message.

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    -
    -
    -
    - -
    -
    -exception ValidationError(message, raises, validator)[source]
    -

    Bases: custodian.custodian.CustodianError

    -

    Error raised when a validator does not pass the check

    -
    -
    Parameters
    -
      -
    • message (str) – Message passed to Exception

    • -
    • raises (bool) – Whether this should be raised outside custodian

    • -
    • validator (Validator) – Validator that caused the exception.

    • -
    -
    -
    -
    - -
    -
    -class Validator[source]
    -

    Bases: monty.json.MSONable

    -

    Abstract base class defining the interface for a Validator. A Validator -differs from an ErrorHandler in that it does not correct a run and is run -only at the end of a Job. If errors are detected by a Validator, a run is -immediately terminated.

    -
    -
    -abstract check()[source]
    -

    This method is called at the end of a job.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    - -
    -
    -

    custodian.utils module

    -
    -
    -backup(filenames, prefix='error')[source]
    -

    Backup files to a tar.gz file. Used, for example, in backing up the -files of an errored run before performing corrections.

    -
    -
    Parameters
    -
      -
    • filenames ([str]) – List of files to backup. Supports wildcards, e.g., -..

    • -
    • prefix (str) – prefix to the files. Defaults to error, which means a -series of error.1.tar.gz, error.2.tar.gz, … will be generated.

    • -
    -
    -
    -
    - -
    -
    -get_execution_host_info()[source]
    -

    Tries to return a tuple describing the execution host. -Doesn’t work for all queueing systems

    -
    -
    Returns
    -

    (HOSTNAME, CLUSTER_NAME)

    -
    -
    -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.nwchem.html b/docs/html/custodian.nwchem.html deleted file mode 100644 index a7be0816..00000000 --- a/docs/html/custodian.nwchem.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - custodian.nwchem package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.nwchem package

    -
    -

    Subpackages

    -
    -
    -
    -
    -

    Submodules

    -
    -
    -

    custodian.nwchem.handlers module

    -
    -
    -class NwchemErrorHandler(output_filename='mol.nwout')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Error handler for Nwchem Jobs. Currently tested only for B3LYP DFT jobs -generated by pymatgen.

    -

    Initializes with an output file name.

    -
    -
    Parameters
    -

    output_filename (str) – This is the file where the stdout for nwchem -is being redirected. The error messages that are checked are -present in the stdout. Defaults to “mol.nwout”, which is the -default redirect used by custodian.nwchem.jobs -.NwchemJob.

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    - -
    -
    -

    custodian.nwchem.jobs module

    -
    -
    -class NwchemJob(nwchem_cmd, input_file='mol.nw', output_file='mol.nwout', gzipped=False, backup=True, settings_override=None)[source]
    -

    Bases: custodian.custodian.Job

    -

    A basic Nwchem job.

    -

    Initializes a basic NwChem job.

    -
    -
    Parameters
    -
      -
    • nwchem_cmd ([str]) – Command to run Nwchem as a list of args. For -example, [“nwchem”].

    • -
    • input_file (str) – Input file to run. Defaults to “mol.nw”.

    • -
    • output_file (str) – Name of file to direct standard out to. -Defaults to “mol.nwout”.

    • -
    • backup (bool) – Whether to backup the initial input files. If True, -the input files will be copied with a “.orig” appended. -Defaults to True.

    • -
    • gzipped (bool) – Deprecated. Please use the Custodian class’s -gzipped_output option instead.

    • -
    • settings_override ([dict]) – An ansible style list of dict to override changes. -#TODO: Not implemented yet.

    • -
    -
    -
    -
    -
    -postprocess()[source]
    -

    Renaming or gzipping as needed.

    -
    - -
    -
    -run()[source]
    -

    Performs actual nwchem run.

    -
    - -
    -
    -setup()[source]
    -

    Performs backup if necessary.

    -
    - -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.qchem.html b/docs/html/custodian.qchem.html deleted file mode 100644 index 2695b4fc..00000000 --- a/docs/html/custodian.qchem.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - custodian.qchem package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.qchem package

    -
    -

    Subpackages

    -
    -
    -
    -
    -

    Submodules

    -
    -
    -

    custodian.qchem.handlers module

    -
    -
    -class QChemErrorHandler(input_file='mol.qin', output_file='mol.qout', scf_max_cycles=200, geom_max_cycles=200)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Master QChemErrorHandler class that handles a number of common errors -that occur during QChem runs.

    -

    Initializes the error handler from a set of input and output files.

    -
    -
    Parameters
    -
      -
    • input_file (str) – Name of the QChem input file.

    • -
    • output_file (str) – Name of the QChem output file.

    • -
    • scf_max_cycles (int) – The max iterations to set to fix SCF failure.

    • -
    • geom_max_cycles (int) – The max iterations to set to fix geometry -optimization failure.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -class QChemSCFErrorHandler(input_file='mol.qin', output_file='mol.qout', rca_gdm_thresh=0.001, scf_max_cycles=200)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    QChem ErrorHandler class that addresses SCF non-convergence.

    -

    Initializes the error handler from a set of input and output files.

    -
    -
    Parameters
    -
      -
    • input_file (str) – Name of the QChem input file.

    • -
    • output_file (str) – Name of the QChem output file.

    • -
    • rca_gdm_thresh (float) – The threshold for the prior scf algorithm. -If last deltaE is larger than the threshold try RCA_DIIS -first, else, try DIIS_GDM first.

    • -
    • scf_max_cycles (int) – The max iterations to set to fix SCF failure.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -

    custodian.qchem.jobs module

    -
    -
    -class QCJob(qchem_command, max_cores, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', suffix='', scratch_dir='/dev/shm/qcscratch/', save_scratch=False, save_name='default_save_name', backup=True)[source]
    -

    Bases: custodian.custodian.Job

    -

    A basic QChem Job.

    -
    -
    Parameters
    -
      -
    • qchem_command (str) – Command to run QChem.

    • -
    • max_cores (int) – Maximum number of cores to parallelize over.

    • -
    • multimode (str) – Parallelization scheme, either openmp or mpi.

    • -
    • input_file (str) – Name of the QChem input file.

    • -
    • output_file (str) – Name of the QChem output file.

    • -
    • qclog_file (str) – Name of the file to redirect the standard output -to. None means not to record the standard output.

    • -
    • suffix (str) – String to append to the file in postprocess.

    • -
    • scratch_dir (str) – QCSCRATCH directory. Defaults to “/dev/shm/qcscratch/”.

    • -
    • save_scratch (bool) – Whether to save scratch directory contents. -Defaults to False.

    • -
    • save_name (str) – Name of the saved scratch directory. Defaults to -to “default_save_name”.

    • -
    • backup (bool) – Whether to backup the initial input file. If True, the -input will be copied with a “.orig” appended. Defaults to True.

    • -
    -
    -
    -
    -
    -property current_command
    -
    - -
    -
    -classmethod opt_with_frequency_flattener(qchem_command, multimode='openmp', input_file='mol.qin', output_file='mol.qout', qclog_file='mol.qclog', max_iterations=10, max_molecule_perturb_scale=0.3, check_connectivity=True, **QCJob_kwargs)[source]
    -

    Optimize a structure and calculate vibrational frequencies to check if the -structure is in a true minima. If a frequency is negative, iteratively -perturbe the geometry, optimize, and recalculate frequencies until all are -positive, aka a true minima has been found.

    -
    -
    Parameters
    -
      -
    • qchem_command (str) – Command to run QChem.

    • -
    • multimode (str) – Parallelization scheme, either openmp or mpi.

    • -
    • input_file (str) – Name of the QChem input file.

    • -
    • output_file (str) – Name of the QChem output file.

    • -
    • max_iterations (int) – Number of perturbation -> optimization -> frequency -iterations to perform. Defaults to 10.

    • -
    • max_molecule_perturb_scale (float) – The maximum scaled perturbation that -can be applied to the molecule. Defaults to 0.3.

    • -
    • check_connectivity (bool) – Whether to check differences in connectivity -introduced by structural perturbation. Defaults to True.

    • -
    • **QCJob_kwargs – Passthrough kwargs to QCJob. See -custodian.qchem.jobs.QCJob.

    • -
    -
    -
    -
    - -
    -
    -postprocess()[source]
    -

    This method is called at the end of a job, after error detection. -This allows post-processing, such as cleanup, analysis of results, -etc.

    -
    - -
    -
    -run()[source]
    -

    Perform the actual QChem run.

    -
    -
    Returns
    -

    (subprocess.Popen) Used for monitoring.

    -
    -
    -
    - -
    -
    -setup()[source]
    -

    This method is run before the start of a job. Allows for some -pre-processing.

    -
    - -
    - -
    -
    -perturb_coordinates(old_coords, negative_freq_vecs, molecule_perturb_scale, reversed_direction)[source]
    -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/custodian.vasp.html b/docs/html/custodian.vasp.html deleted file mode 100644 index 6dd1ff3e..00000000 --- a/docs/html/custodian.vasp.html +++ /dev/null @@ -1,1449 +0,0 @@ - - - - - - - custodian.vasp package — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    custodian.vasp package

    -
    -

    Subpackages

    -
    -
    -
    -
    -

    Submodules

    -
    -
    -

    custodian.vasp.handlers module

    -
    -
    -class AliasingErrorHandler(output_filename='vasp.out')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Master VaspErrorHandler class that handles a number of common errors -that occur during VASP runs.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -

    output_filename (str) – This is the file where the stdout for vasp -is being redirected. The error messages that are checked are -present in the stdout. Defaults to “vasp.out”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -error_msgs = {'aliasing': ['WARNING: small aliasing (wrap around) errors must be expected'], 'aliasing_incar': ['Your FFT grids (NGX,NGY,NGZ) are not sufficient for an accurate']}
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class CheckpointHandler(interval=3600)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    This is not an error handler per se, but rather a checkpointer. What this -does is that every X seconds, a STOPCAR and CHKPT will be written. This -forces VASP to stop at the end of the next ionic step. The files are then -copied into a subdir, and then the job is restarted. To use this proper, -max_errors in Custodian must be set to a very high value, and you -probably wouldn’t want to use any standard VASP error handlers. The -checkpoint will be stored in subdirs chk_#. This should be used in -combiantion with the StoppedRunHandler.

    -

    Initializes the handler with an interval.

    -
    -
    Parameters
    -
      -
    • interval (int) – Interval at which to checkpoint in seconds.

    • -
    • to 3600 (Defaults) –

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    -
    -is_terminating = False
    -
    - -
    - -
    -
    -class DriftErrorHandler(max_drift=None, to_average=3, enaug_multiply=2)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Corrects for total drift exceeding the force convergence criteria.

    -

    Initializes the handler with max drift -:param max_drift: This defines the max drift. Leaving this at the default of None gets the max_drift from EDFIFFG -:type max_drift: float

    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    - -
    -
    -class FrozenJobErrorHandler(output_filename='vasp.out', timeout=21600)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Detects an error when the output file has not been updated -in timeout seconds. Changes ALGO to Normal from Fast

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -
      -
    • output_filename (str) – This is the file where the stdout for vasp -is being redirected. The error messages that are checked are -present in the stdout. Defaults to “vasp.out”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    • -
    • timeout (int) – The time in seconds between checks where if there -is no activity on the output file, the run is considered -frozen. Defaults to 3600 seconds, i.e., 1 hour.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class LrfCommutatorHandler(output_filename='std_err.txt')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Corrects LRF_COMMUTATOR errors by setting LPEAD=True if not already set. -Note that switching LPEAD=T can slightly change results versus the -default due to numerical evaluation of derivatives.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -

    output_filename (str) – This is the file where the stderr for vasp -is being redirected. The error messages that are checked are -present in the stderr. Defaults to “std_err.txt”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -error_msgs = {'lrf_comm': ['LRF_COMMUTATOR internal error']}
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class MaxForceErrorHandler(output_filename='vasprun.xml', max_force_threshold=0.25)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Checks that the desired force convergence has been achieved. Otherwise -restarts the run with smaller EDIFF. (This is necessary since energy -and force convergence criteria cannot be set simultaneously)

    -
    -
    Parameters
    -
      -
    • input_filename (str) – name of the vasp INCAR file

    • -
    • output_filename (str) – name to look for the vasprun

    • -
    • max_force_threshold (float) – Threshold for max force for -restarting the run. (typically should be set to the value -that the creator looks for)

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -class MeshSymmetryErrorHandler(output_filename='vasp.out', output_vasprun='vasprun.xml')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Corrects the mesh symmetry error in VASP. This error is sometimes -non-fatal. So this error handler only checks at the end of the run, -and if the run has converged, no error is recorded.

    -

    Initializes the handler with the output files to check.

    -
    -
    Parameters
    -
      -
    • output_filename (str) – This is the file where the stdout for vasp -is being redirected. The error messages that are checked are -present in the stdout. Defaults to “vasp.out”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    • -
    • output_vasprun (str) – Filename for the vasprun.xml file. Change -this only if it is different from the default (unlikely).

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -class NonConvergingErrorHandler(output_filename='OSZICAR', nionic_steps=10)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Check if a run is hitting the maximum number of electronic steps at the -last nionic_steps ionic steps (default=10). If so, change ALGO from Fast to -Normal or kill the job.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -
      -
    • output_filename (str) – This is the OSZICAR file. Change -this only if it is different from the default (unlikely).

    • -
    • nionic_steps (int) – The threshold number of ionic steps that -needs to hit the maximum number of electronic steps for the -run to be considered non-converging.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class PositiveEnergyErrorHandler(output_filename='OSZICAR')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Check if a run has positive absolute energy. -If so, change ALGO from Fast to Normal or kill the job.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -

    output_filename (str) – This is the OSZICAR file. Change -this only if it is different from the default (unlikely).

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class PotimErrorHandler(input_filename='POSCAR', output_filename='OSZICAR', dE_threshold=1)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Check if a run has excessively large positive energy changes. -This is typically caused by too large a POTIM. Runs typically -end up crashing with some other error (e.g. BRMIX) as the geometry -gets progressively worse.

    -

    Initializes the handler with the input and output files to check.

    -
    -
    Parameters
    -
      -
    • input_filename (str) – This is the POSCAR file that the run -started from. Defaults to “POSCAR”. Change -this only if it is different from the default (unlikely).

    • -
    • output_filename (str) – This is the OSZICAR file. Change -this only if it is different from the default (unlikely).

    • -
    • dE_threshold (float) – The threshold energy change. Defaults to 1eV.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class StdErrHandler(output_filename='std_err.txt')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Master StdErr class that handles a number of common errors -that occur during VASP runs with error messages only in -the standard error.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -

    output_filename (str) – This is the file where the stderr for vasp -is being redirected. The error messages that are checked are -present in the stderr. Defaults to “std_err.txt”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -error_msgs = {'kpoints_trans': ['internal error in GENERATE_KPOINTS_TRANS: number of G-vector changed in star'], 'out_of_memory': ['Allocation would exceed memory limit']}
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class StoppedRunHandler[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    This is not an error handler per se, but rather a checkpointer. What this -does is that every X seconds, a STOPCAR will be written. This forces VASP to -stop at the end of the next ionic step. The files are then copied into a -subdir, and then the job is restarted. To use this proper, max_errors in -Custodian must be set to a very high value, and you probably wouldn’t -want to use any standard VASP error handlers. The checkpoint will be -stored in subdirs chk_#. This should be used in combination with the -StoppedRunHandler.

    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    -
    -is_terminating = False
    -
    - -
    - -
    -
    -class UnconvergedErrorHandler(output_filename='vasprun.xml')[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Check if a run is converged.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -

    output_vasprun (str) – Filename for the vasprun.xml file. Change -this only if it is different from the default (unlikely).

    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = False
    -
    - -
    - -
    -
    -class VaspErrorHandler(output_filename='vasp.out', natoms_large_cell=100, errors_subset_to_catch=None)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Master VaspErrorHandler class that handles a number of common errors -that occur during VASP runs.

    -

    Initializes the handler with the output file to check.

    -
    -
    Parameters
    -
      -
    • output_filename (str) – This is the file where the stdout for vasp -is being redirected. The error messages that are checked are -present in the stdout. Defaults to “vasp.out”, which is the -default redirect used by custodian.vasp.jobs.VaspJob.

    • -
    • natoms_large_cell (int) – Number of atoms threshold to treat cell -as large. Affects the correction of certain errors. Defaults to -100.

    • -
    • errors_subset_to_detect (list) –

      A subset of errors to catch. The -default is None, which means all supported errors are detected. -Use this to only catch only a subset of supported errors. -E.g., [“eddrrm”, “zheev”] will only catch the eddrmm and zheev -errors, and not others. If you wish to only excluded one or -two of the errors, you can create this list by the following -lines:

      -

      ``` -subset = list(VaspErrorHandler.error_msgs.keys()) -subset.pop(“eddrrm”)

      -

      handler = VaspErrorHandler(errors_subset_to_catch=subset) -```

      -

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -error_msgs = {'amin': ['One of the lattice vectors is very long (>50 A), but AMIN'], 'brions': ['BRIONS problems: POTIM should be increased'], 'brmix': ['BRMIX: very serious problems'], 'dentet': ['DENTET'], 'edddav': ['Error EDDDAV: Call to ZHEGV failed'], 'eddrmm': ['WARNING in EDDRMM: call to ZHEGV failed'], 'elf_kpar': ['ELF: KPAR>1 not implemented'], 'elf_ncl': ['WARNING: ELF not implemented for non collinear case'], 'grad_not_orth': ['EDWAV: internal error, the gradient is not orthogonal'], 'incorrect_shift': ['Could not get correct shifts'], 'inv_rot_mat': ['inverse of rotation matrix was not found (increase SYMPREC)'], 'nicht_konv': ['ERROR: SBESSELITER : nicht konvergent'], 'point_group': ['Error: point group operation missing'], 'posmap': ['POSMAP internal error: symmetry equivalent atom not found'], 'pricel': ['internal error in subroutine PRICEL'], 'pssyevx': ['ERROR in subspace rotation PSSYEVX'], 'real_optlay': ['REAL_OPTLAY: internal error', 'REAL_OPT: internal ERROR'], 'rhosyg': ['RHOSYG internal error'], 'rot_matrix': ['Found some non-integer element in rotation matrix'], 'rspher': ['ERROR RSPHER'], 'subspacematrix': ['WARNING: Sub-Space-Matrix is not hermitian in DAV'], 'tet': ['Tetrahedron method fails for NKPT<4', 'Fatal error detecting k-mesh', 'Fatal error: unable to match k-point', 'Routine TETIRR needs special values', 'Tetrahedron method fails (number of k-points < 4)'], 'tetirr': ['Routine TETIRR needs special values'], 'too_few_bands': ['TOO FEW BANDS'], 'triple_product': ['ERROR: the triple product of the basis vectors'], 'zbrent': ['ZBRENT: fatal internal in', 'ZBRENT: fatal error in bracketing'], 'zheev': ['ERROR EDDIAG: Call to routine ZHEEV failed!'], 'zpotrf': ['LAPACK: Routine ZPOTRF failed']}
    -
    - -
    -
    -is_monitor = True
    -
    - -
    - -
    -
    -class WalltimeHandler(wall_time=None, buffer_time=300, electronic_step_stop=False)[source]
    -

    Bases: custodian.custodian.ErrorHandler

    -

    Check if a run is nearing the walltime. If so, write a STOPCAR with -LSTOP or LABORT = .True.. You can specify the walltime either in the init ( -which is unfortunately necessary for SGE and SLURM systems. If you happen -to be running on a PBS system and the PBS_WALLTIME variable is in the run -environment, the wall time will be automatically determined if not set.

    -

    Initializes the handler with a buffer time.

    -
    -
    Parameters
    -
      -
    • wall_time (int) – Total walltime in seconds. If this is None and -the job is running on a PBS system, the handler will attempt to -determine the walltime from the PBS_WALLTIME environment -variable. If the wall time cannot be determined or is not -set, this handler will have no effect.

    • -
    • buffer_time (int) – The min amount of buffer time in secs at the -end that the STOPCAR will be written. The STOPCAR is written -when the time remaining is < the higher of 3 x the average -time for each ionic step and the buffer time. Defaults to -300 secs, which is the default polling time of Custodian. -This is typically sufficient for the current ionic step to -complete. But if other operations are being performed after -the run has stopped, the buffer time may need to be increased -accordingly.

    • -
    • electronic_step_stop (bool) – Whether to check for electronic steps -instead of ionic steps (e.g. for static runs on large systems or -static HSE runs, …). Be careful that results such as density -or wavefunctions might not be converged at the electronic level. -Should be used with LWAVE = .True. to be useful. If this is -True, the STOPCAR is written with LABORT = .TRUE. instead of -LSTOP = .TRUE.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called during the job (for monitors) or at the end of -the job to check for errors.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    -
    -correct()[source]
    -

    This method is called at the end of a job when an error is detected. -It should perform any corrective measures relating to the detected -error.

    -
    -
    Returns
    -

    (dict) JSON serializable dict that describes the errors and -actions taken. E.g. -{“errors”: list_of_errors, “actions”: list_of_actions_taken}. -If this is an unfixable error, actions should be set to None.

    -
    -
    -
    - -
    -
    -is_monitor = True
    -
    - -
    -
    -is_terminating = False
    -
    - -
    -
    -raises_runtime_error = False
    -
    - -
    - -
    -
    -

    custodian.vasp.interpreter module

    -
    -
    -class VaspModder(actions=None, strict=True, vi=None)[source]
    -

    Bases: custodian.ansible.interpreter.Modder

    -

    Initializes a Modder for VaspInput sets

    -
    -
    Parameters
    -
      -
    • actions ([Action]) – A sequence of supported actions. See -custodian.ansible.actions. Default is None, -which means DictActions and FileActions are supported.

    • -
    • strict (bool) – Indicating whether to use strict mode. In non-strict -mode, unsupported actions are simply ignored without any -errors raised. In strict mode, if an unsupported action is -supplied, a ValueError is raised. Defaults to True.

    • -
    • vi (VaspInput) – A VaspInput object from the current directory. -Initialized automatically if not passed (but passing it will -avoid having to reparse the directory).

    • -
    -
    -
    -
    -
    -apply_actions(actions)[source]
    -

    Applies a list of actions to the Vasp Input Set and rewrites modified -files. -:param actions [dict]: A list of actions of the form {‘file’: filename,

    -
    -

    ‘action’: moddermodification} or {‘dict’: vaspinput_key, -‘action’: moddermodification}

    -
    -
    - -
    - -
    -
    -

    custodian.vasp.jobs module

    -
    -
    -class GenerateVaspInputJob(input_set, contcar_only=True, **kwargs)[source]
    -

    Bases: custodian.custodian.Job

    -

    Generates a VASP input based on an existing directory. This is typically -used to modify the VASP input files before the next VaspJob.

    -
    -
    Parameters
    -
      -
    • input_set (str) – Full path to the input set. E.g., -“pymatgen.io.vasp.sets.MPNonSCFSet”.

    • -
    • contcar_only (bool) – If True (default), only CONTCAR structures -are used as input to the input set.

    • -
    -
    -
    -
    -
    -postprocess()[source]
    -

    This method is called at the end of a job, after error detection. -This allows post-processing, such as cleanup, analysis of results, -etc.

    -
    - -
    -
    -run()[source]
    -

    This method perform the actual work for the job. If parallel error -checking (monitoring) is desired, this must return a Popen process.

    -
    - -
    -
    -setup()[source]
    -

    This method is run before the start of a job. Allows for some -pre-processing.

    -
    - -
    - -
    -
    -class VaspJob(vasp_cmd, output_file='vasp.out', stderr_file='std_err.txt', suffix='', final=True, backup=True, auto_npar=False, auto_gamma=True, settings_override=None, gamma_vasp_cmd=None, copy_magmom=False, auto_continue=False)[source]
    -

    Bases: custodian.custodian.Job

    -

    A basic vasp job. Just runs whatever is in the directory. But conceivably -can be a complex processing of inputs etc. with initialization.

    -

    This constructor is necessarily complex due to the need for -flexibility. For standard kinds of runs, it’s often better to use one -of the static constructors. The defaults are usually fine too.

    -
    -
    Parameters
    -
      -
    • vasp_cmd (str) – Command to run vasp as a list of args. For example, -if you are using mpirun, it can be something like -[“mpirun”, “pvasp.5.2.11”]

    • -
    • output_file (str) – Name of file to direct standard out to. -Defaults to “vasp.out”.

    • -
    • stderr_file (str) – Name of file to direct standard error to. -Defaults to “std_err.txt”.

    • -
    • suffix (str) – A suffix to be appended to the final output. E.g., -to rename all VASP output from say vasp.out to -vasp.out.relax1, provide “.relax1” as the suffix.

    • -
    • final (bool) – Indicating whether this is the final vasp job in a -series. Defaults to True.

    • -
    • backup (bool) – Whether to backup the initial input files. If True, -the INCAR, KPOINTS, POSCAR and POTCAR will be copied with a -“.orig” appended. Defaults to True.

    • -
    • auto_npar (bool) – Whether to automatically tune NPAR to be sqrt( -number of cores) as recommended by VASP for DFT calculations. -Generally, this results in significant speedups. Defaults to -True. Set to False for HF, GW and RPA calculations.

    • -
    • auto_gamma (bool) – Whether to automatically check if run is a -Gamma 1x1x1 run, and whether a Gamma optimized version of -VASP exists with “.gamma” appended to the name of the VASP -executable (typical setup in many systems). If so, run the -gamma optimized version of VASP instead of regular VASP. You -can also specify the gamma vasp command using the -gamma_vasp_cmd argument if the command is named differently.

    • -
    • settings_override ([dict]) –

      An ansible style list of dict to -override changes. For example, to set ISTART=1 for subsequent -runs and to copy the CONTCAR to the POSCAR, you will provide:

      -
      [{"dict": "INCAR", "action": {"_set": {"ISTART": 1}}},
      - {"file": "CONTCAR",
      -  "action": {"_file_copy": {"dest": "POSCAR"}}}]
      -
      -
      -

    • -
    • gamma_vasp_cmd (str) – Command for gamma vasp version when -auto_gamma is True. Should follow the list style of -subprocess. Defaults to None, which means “.gamma” is added -to the last argument of the standard vasp_cmd.

    • -
    • copy_magmom (bool) – Whether to copy the final magmom from the -OUTCAR to the next INCAR. Useful for multi-relaxation runs -where the CHGCAR and WAVECAR are sometimes deleted (due to -changes in fft grid, etc.). Only applies to non-final runs.

    • -
    • auto_continue (bool) – Whether to automatically continue a run -if a STOPCAR is present. This is very useful if using the -wall-time handler which will write a read-only STOPCAR to -prevent VASP from deleting it once it finishes

    • -
    -
    -
    -
    -
    -classmethod constrained_opt_run(vasp_cmd, lattice_direction, initial_strain, atom_relax=True, max_steps=20, algo='bfgs', **vasp_job_kwargs)[source]
    -

    Returns a generator of jobs for a constrained optimization run. Typical -use case is when you want to approximate a biaxial strain situation, -e.g., you apply a defined strain to a and b directions of the lattice, -but allows the c-direction to relax.

    -

    Some guidelines on the use of this method: -i. It is recommended you do not use the Auto kpoint generation. The

    -
    -

    grid generated via Auto may fluctuate with changes in lattice -param, resulting in numerical noise.

    -
    -
      -
    1. Make sure your EDIFF/EDIFFG is properly set in your INCAR. The -optimization relies on these values to determine convergence.

    2. -
    -
    -
    Parameters
    -
      -
    • vasp_cmd (str) – Command to run vasp as a list of args. For example, -if you are using mpirun, it can be something like -[“mpirun”, “pvasp.5.2.11”]

    • -
    • lattice_direction (str) – Which direction to relax. Valid values are -“a”, “b” or “c”.

    • -
    • initial_strain (float) – An initial strain to be applied to the -lattice_direction. This can usually be estimated as the -negative of the strain applied in the other two directions. -E.g., if you apply a tensile strain of 0.05 to the a and b -directions, you can use -0.05 as a reasonable first guess for -initial strain.

    • -
    • atom_relax (bool) – Whether to relax atomic positions.

    • -
    • max_steps (int) – The maximum number of runs. Defaults to 20 ( -highly unlikely that this limit is ever reached).

    • -
    • algo (str) – Algorithm to use to find minimum. Default is “bfgs”, -which is fast, but can be sensitive to numerical noise -in energy calculations. The alternative is “bisection”, -which is more robust but can be a bit slow. The code does fall -back on the bisection when bfgs gives a non-sensical result, -e.g., negative lattice params.

    • -
    • **vasp_job_kwargs – Passthrough kwargs to VaspJob. See -custodian.vasp.jobs.VaspJob.

    • -
    -
    -
    Returns
    -

    Generator of jobs. At the end of the run, an “EOS.txt” is written -which provides a quick look at the E vs lattice parameter.

    -
    -
    -
    - -
    -
    -classmethod double_relaxation_run(vasp_cmd, auto_npar=True, ediffg=-0.05, half_kpts_first_relax=False, auto_continue=False)[source]
    -

    Returns a list of two jobs corresponding to an AFLOW style double -relaxation run.

    -
    -
    Parameters
    -
      -
    • vasp_cmd (str) – Command to run vasp as a list of args. For example, -if you are using mpirun, it can be something like -[“mpirun”, “pvasp.5.2.11”]

    • -
    • auto_npar (bool) – Whether to automatically tune NPAR to be sqrt( -number of cores) as recommended by VASP for DFT calculations. -Generally, this results in significant speedups. Defaults to -True. Set to False for HF, GW and RPA calculations.

    • -
    • ediffg (float) – Force convergence criteria for subsequent runs ( -ignored for the initial run.)

    • -
    • half_kpts_first_relax (bool) – Whether to halve the kpoint grid -for the first relaxation. Speeds up difficult convergence -considerably. Defaults to False.

    • -
    -
    -
    Returns
    -

    List of two jobs corresponding to an AFLOW style run.

    -
    -
    -
    - -
    -
    -classmethod full_opt_run(vasp_cmd, vol_change_tol=0.02, max_steps=10, ediffg=-0.05, half_kpts_first_relax=False, **vasp_job_kwargs)[source]
    -

    Returns a generator of jobs for a full optimization run. Basically, -this runs an infinite series of geometry optimization jobs until the -% vol change in a particular optimization is less than vol_change_tol.

    -
    -
    Parameters
    -
      -
    • vasp_cmd (str) – Command to run vasp as a list of args. For example, -if you are using mpirun, it can be something like -[“mpirun”, “pvasp.5.2.11”]

    • -
    • vol_change_tol (float) – The tolerance at which to stop a run. -Defaults to 0.05, i.e., 5%.

    • -
    • max_steps (int) – The maximum number of runs. Defaults to 10 ( -highly unlikely that this limit is ever reached).

    • -
    • ediffg (float) – Force convergence criteria for subsequent runs ( -ignored for the initial run.)

    • -
    • half_kpts_first_relax (bool) – Whether to halve the kpoint grid -for the first relaxation. Speeds up difficult convergence -considerably. Defaults to False.

    • -
    • **vasp_job_kwargs – Passthrough kwargs to VaspJob. See -custodian.vasp.jobs.VaspJob.

    • -
    -
    -
    Returns
    -

    Generator of jobs.

    -
    -
    -
    - -
    -
    -classmethod metagga_opt_run(vasp_cmd, auto_npar=True, ediffg=-0.05, half_kpts_first_relax=False, auto_continue=False)[source]
    -

    Returns a list of thres jobs to perform an optimization for any -metaGGA functional. There is an initial calculation of the -GGA wavefunction which is fed into the initial metaGGA optimization -to precondition the electronic structure optimizer. The metaGGA -optimization is performed using the double relaxation scheme

    -
    - -
    -
    -postprocess()[source]
    -

    Postprocessing includes renaming and gzipping where necessary. -Also copies the magmom to the incar if necessary

    -
    - -
    -
    -run()[source]
    -

    Perform the actual VASP run.

    -
    -
    Returns
    -

    (subprocess.Popen) Used for monitoring.

    -
    -
    -
    - -
    -
    -setup()[source]
    -

    Performs initial setup for VaspJob, including overriding any settings -and backing up.

    -
    - -
    -
    -terminate()[source]
    -
    - -
    - -
    -
    -class VaspNEBJob(vasp_cmd, output_file='neb_vasp.out', stderr_file='neb_std_err.txt', suffix='', final=True, backup=True, auto_npar=True, half_kpts=False, auto_gamma=True, auto_continue=False, gamma_vasp_cmd=None, settings_override=None)[source]
    -

    Bases: custodian.custodian.Job

    -

    A NEB vasp job, especially for CI-NEB running at PBS clusters. -The class is added for the purpose of handling a different folder -arrangement in NEB calculation.

    -

    This constructor is a simplified version of VaspJob, which satisfies -the need for flexibility. For standard kinds of runs, it’s often -better to use one of the static constructors. The defaults are -usually fine too.

    -
    -
    Parameters
    -
      -
    • vasp_cmd (str) – Command to run vasp as a list of args. For example, -if you are using mpirun, it can be something like -[“mpirun”, “pvasp.5.2.11”]

    • -
    • output_file (str) – Name of file to direct standard out to. -Defaults to “vasp.out”.

    • -
    • stderr_file (str) – Name of file to direct standard error to. -Defaults to “std_err.txt”.

    • -
    • suffix (str) – A suffix to be appended to the final output. E.g., -to rename all VASP output from say vasp.out to -vasp.out.relax1, provide “.relax1” as the suffix.

    • -
    • final (bool) – Indicating whether this is the final vasp job in a -series. Defaults to True.

    • -
    • backup (bool) – Whether to backup the initial input files. If True, -the INCAR, KPOINTS, POSCAR and POTCAR will be copied with a -“.orig” appended. Defaults to True.

    • -
    • auto_npar (bool) – Whether to automatically tune NPAR to be sqrt( -number of cores) as recommended by VASP for DFT calculations. -Generally, this results in significant speedups. Defaults to -True. Set to False for HF, GW and RPA calculations.

    • -
    • half_kpts (bool) – Whether to halve the kpoint grid for NEB. -Speeds up convergence considerably. Defaults to False.

    • -
    • auto_gamma (bool) – Whether to automatically check if run is a -Gamma 1x1x1 run, and whether a Gamma optimized version of -VASP exists with “.gamma” appended to the name of the VASP -executable (typical setup in many systems). If so, run the -gamma optimized version of VASP instead of regular VASP. You -can also specify the gamma vasp command using the -gamma_vasp_cmd argument if the command is named differently.

    • -
    • auto_continue (bool) – Whether to automatically continue a run -if a STOPCAR is present. This is very useful if using the -wall-time handler which will write a read-only STOPCAR to -prevent VASP from deleting it once it finishes.

    • -
    • gamma_vasp_cmd (str) – Command for gamma vasp version when -auto_gamma is True. Should follow the list style of -subprocess. Defaults to None, which means “.gamma” is added -to the last argument of the standard vasp_cmd.

    • -
    • settings_override ([dict]) –

      An ansible style list of dict to -override changes. For example, to set ISTART=1 for subsequent -runs and to copy the CONTCAR to the POSCAR, you will provide:

      -
      [{"dict": "INCAR", "action": {"_set": {"ISTART": 1}}},
      - {"file": "CONTCAR",
      -  "action": {"_file_copy": {"dest": "POSCAR"}}}]
      -
      -
      -

    • -
    -
    -
    -
    -
    -postprocess()[source]
    -

    Postprocessing includes renaming and gzipping where necessary.

    -
    - -
    -
    -run()[source]
    -

    Perform the actual VASP run.

    -
    -
    Returns
    -

    (subprocess.Popen) Used for monitoring.

    -
    -
    -
    - -
    -
    -setup()[source]
    -

    Performs initial setup for VaspNEBJob, including overriding any settings -and backing up.

    -
    - -
    - -
    -
    -

    custodian.vasp.validators module

    -
    -
    -class VaspAECCARValidator[source]
    -

    Bases: custodian.custodian.Validator

    -

    Check if the data in the AECCAR is corrupted

    -
    -
    -check()[source]
    -

    This method is called at the end of a job.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    - -
    -
    -class VaspFilesValidator[source]
    -

    Bases: custodian.custodian.Validator

    -
    -
    Check for existence of some of the files that VASP

    normally create upon running.

    -
    -
    -
    -
    -check()[source]
    -

    This method is called at the end of a job.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    - -
    -
    -class VaspNpTMDValidator[source]
    -

    Bases: custodian.custodian.Validator

    -

    Check NpT-AIMD settings is loaded by VASP compiled with -Dtbdyn. -Currently, VASP only have Langevin thermostat (MDALGO = 3) for NpT ensemble.

    -
    -
    -check()[source]
    -

    This method is called at the end of a job.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    - -
    -
    -class VasprunXMLValidator(output_file='vasp.out', stderr_file='std_err.txt')[source]
    -

    Bases: custodian.custodian.Validator

    -

    Checks that a valid vasprun.xml was generated

    -
    -
    Parameters
    -
      -
    • output_file (str) – Name of file VASP standard output is directed to. -Defaults to “vasp.out”.

    • -
    • stderr_file (str) – Name of file VASP standard error is direct to. -Defaults to “std_err.txt”.

    • -
    -
    -
    -
    -
    -check()[source]
    -

    This method is called at the end of a job.

    -
    -
    Returns
    -

    (bool) Indicating if errors are detected.

    -
    -
    -
    - -
    - -
    -
    -check_broken_chgcar(chgcar)[source]
    -
    - -
    -
    -

    Module contents

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/genindex.html b/docs/html/genindex.html deleted file mode 100644 index 205a265d..00000000 --- a/docs/html/genindex.html +++ /dev/null @@ -1,743 +0,0 @@ - - - - - - - - Index — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - -

    Index

    - -
    - A - | B - | C - | D - | E - | F - | G - | I - | J - | L - | M - | N - | O - | P - | Q - | R - | S - | T - | U - | V - | W - -
    -

    A

    - - - -
    - -

    B

    - - -
    - -

    C

    - - - -
    - -

    D

    - - - -
    - -

    E

    - - - -
    - -

    F

    - - - -
    - -

    G

    - - - -
    - -

    I

    - - - -
    - -

    J

    - - -
    - -

    L

    - - - -
    - -

    M

    - - - -
    - -

    N

    - - - -
    - -

    O

    - - -
    - -

    P

    - - - -
    - -

    Q

    - - - -
    - -

    R

    - - - -
    - -

    S

    - - - -
    - -

    T

    - - -
    - -

    U

    - - - -
    - -

    V

    - - - -
    - -

    W

    - - -
    - - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/index.html b/docs/html/index.html deleted file mode 100644 index 8ebe681c..00000000 --- a/docs/html/index.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - - - - Custodian — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -

    Custodian

    -

    Custodian is a simple, robust and flexible just-in-time (JIT) job management -framework written in Python. Using custodian, you can create wrappers that -perform error checking, job management and error recovery. It has a simple -plugin framework that allows you to develop specific job management workflows -for different applications.

    -

    Error recovery is an important aspect of many high-throughput projects that -generate data on a large scale. When you are running on the order of hundreds -of thousands of jobs, even an error rate of 1% would mean thousands of errored -jobs that would be impossible to deal with on a case-by-case basis.

    -

    The specific use case for custodian is for long running jobs, with potentially -random errors. For example, there may be a script that takes several days to -run on a server, with a 1% chance of some IO error causing the job to fail. -Using custodian, one can develop a mechanism to gracefully recover from the -error, and restart the job with modified parameters if necessary.

    -

    The current version of Custodian also comes with two sub-packages for error -handling for Vienna Ab Initio Simulation Package (VASP), NwChem and QChem -calculations.

    -
    -
    -

    Change log

    -
    -

    v2019.2.10

    -
      -
    • Improved slow convergence handling. (@shyamd)

    • -
    -
    -
    -

    v2019.2.7

    -
      -
    • Improved error logging.

    • -
    • Improved handling of frozen jobs and potim errors.

    • -
    • Improved Exceptino handling. (Guido Petretto)

    • -
    -

    Older versions

    -
    -
    -
    -

    Getting custodian

    -
    -

    Stable version

    -

    The version at the Python Package Index (PyPI) is always the latest stable -release that will be hopefully, be relatively bug-free. The easiest way to -install custodian on any system is to use easy_install or pip, as follows:

    -
    easy_install custodian
    -
    -
    -

    or:

    -
    pip install custodian
    -
    -
    -

    Some plugins (e.g., vasp management) require additional setup (please see -pymatgen’s documentation).

    -
    -
    -

    Developmental version

    -

    The bleeding edge developmental version is at the custodian’s Github repo. The developmental -version is likely to be more buggy, but may contain new features. The -Github version include test files as well for complete unit testing. After -cloning the source, you can type:

    -
    python setup.py install
    -
    -
    -

    or to install the package in developmental mode:

    -
    python setup.py develop
    -
    -
    -
    -
    -
    -

    Requirements

    -

    Custodian requires Python 2.7+. There are no other required dependencies.

    -
    -

    Optional dependencies

    -

    Optional libraries that are required if you need certain features:

    -
      -
    1. Python Materials Genomics (pymatgen) 2.8.10+: To use the plugin for -VASP, NwChem and Qchem. Please install using:

      -
      pip install pymatgen
      -
      -
      -

      For more information, please consult pymatgen’s documentation.

      -
    2. -
    3. nose - For complete unittesting.

    4. -
    -
    -
    -
    -

    Usage

    -

    The main class in the workflow is known as Custodian, which manages a series -of jobs with a list of error handlers. The general workflow for Custodian is -presented in the figure below.

    -
    -Custodian workflow -

    Overview of the Custodian workflow.

    -
    -

    The Custodian class takes in two general inputs - a list of Jobs and -a list of ErrorHandlers. Jobs should be subclasses of the -custodian.custodian.Job abstract base class and ErrorHandlers -should be subclasses of the custodian.custodian.ErrorHandler abstract -base class. To use custodian, you need to implement concrete implementations -of these abstract base classes.

    -
    -

    Simple example

    -

    An very simple example implementation is given in the custodian_examples.py -script in the scripts directory. We will now go through the example in detail -here.

    -

    The ExampleJob has the following code.

    -
    class ExampleJob(Job):
    -
    -    def __init__(self, jobid, params=None):
    -        if params is None:
    -            params = {"initial": 0, "total": 0}
    -        self.jobid = jobid
    -        self.params = params
    -
    -    def setup(self):
    -        self.params["initial"] = 0
    -        self.params["total"] = 0
    -
    -    def run(self):
    -        sequence = [random.uniform(0, 1) for i in range(100)]
    -        self.params["total"] = self.params["initial"] + sum(sequence)
    -
    -    def postprocess(self):
    -        pass
    -
    -    @property
    -    def name(self):
    -        return "ExampleJob{}".format(self.jobid)
    -
    -
    -

    The ExampleJob simply sums a random sequence of 100 numbers between 0 and -1, adds it to an initial value and puts the value in ‘total’ variable. The -ExampleJob subclasses the Job abstract base class, and implements the necessary -API comprising of just three key methods: setup(), run(), -and postprocess().

    -

    Let us now define an ErrorHandler that will check if the total value is >= 50, -and if it is not, it will increment the initial value by 1 and rerun the -ExampleJob again.

    -
    class ExampleHandler(ErrorHandler):
    -
    -    def __init__(self, params):
    -        self.params = params
    -
    -    def check(self):
    -        return self.params["total"] < 50
    -
    -    def correct(self):
    -        self.params["initial"] += 1
    -        return {"errors": "total < 50", "actions": "increment by 1"}
    -
    -
    -

    As you can see above, the ExampleHandler subclasses the ErrorHandler abstract -base class, and implements the necessary API comprising of just two key -methods: check() and correct().

    -

    The transfer of information between the Job and ErrorHandler is done using -the params argument in this example, which is not ideal but is sufficiently -for demonstrating the Custodian API. In real world usage, -a more common transfer of information may involve the Job writing the output -to a file, and the ErrorHandler checking the contents of those files to -detect error situations.

    -

    To run the job, one simply needs to supply a list of ExampleJobs and -ErrorHandlers to a Custodian.

    -
    njobs = 100
    -params = {"initial": 0, "total": 0}
    -c = Custodian([ExampleHandler(params)],
    -              [ExampleJob(i, params) for i in xrange(njobs)],
    -              max_errors=njobs)
    -c.run()
    -
    -
    -

    If you run custodian_example.py in the scripts directory, you will noticed that -a custodian.json file was generated, which summarizes the jobs that have -been run and any corrections performed.

    -
    -
    -

    Practical example: Electronic structure calculations

    -

    A practical example where the Custodian framework is particularly useful is -in the area of electronic structure calculations. Electronic structure -calculations tend to be long running and often terminates due to errors, -random or otherwise. Such errors become a major issue in projects that -performs such calculations in high throughput, such as the Materials -Project.

    -

    The Custodian package comes with a fairly comprehensive plugin to deal -with jobs (custodian.vasp.jobs) and errors -(custodian.vasp.handlers) in electronic structure calculations based -on the Vienna Ab Initio Simulation Package (VASP). To do this, -Custodian uses the Python Materials Genomics (pymatgen) package to -perform analysis and io from VASP input and output files.

    -

    A simple example of a script using Custodian to run a two-relaxation VASP job -is as follows:

    -
    from custodian.custodian import Custodian
    -from custodian.vasp.handlers import VaspErrorHandler, \
    -    UnconvergedErrorHandler, PoscarErrorHandler, DentetErrorHandler
    -from custodian.vasp.jobs import VaspJob
    -
    -handlers = [VaspErrorHandler(), UnconvergedErrorHandler(),
    -            PoscarErrorHandler(), DentetErrorHandler()]
    -jobs = VaspJob.double_relaxation_run(args.command.split())
    -c = Custodian(handlers, jobs, max_errors=10)
    -c.run()
    -
    -
    -

    The above will gracefully deal with many VASP errors encountered during -relaxation. For example, it will correct ISMEAR to 0 if there are -insufficient KPOINTS to use ISMEAR = -5.

    -

    Using custodian, you can even setup potentially indefinite jobs, -e.g. kpoints convergence jobs with a target energy convergence. Please see the -converge_kpoints script in the scripts for an example.

    -
    -

    New in version 0.4.3: A new package for dealing with NwChem calculations has been added. -NwChem is an open-source code for performing computational chemistry -calculations.

    -
    -
    -
    -
    -

    cstdn - A yaml-spec controlled job

    -

    Custodian now comes with a cstdn script, which allows you to do fine-grained -control of a job using a yaml spec file. Below is an annotated example of how -you can specify a double VASP relaxation followed by a static calculation. -Minor modifications would allow very customizable calculations, though this is -obviously not meant for highly complex workflows. For those, usage of FireWorks is highly recommended.

    -

    Sample yaml spec:

    -
    # Specifies a list of jobs to run.
    -# Each job is specified by a `jb: <full class path>` with parameters specified
    -# via the params dict.
    -
    -jobs:
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: False
    -    suffix: .relax1
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: False
    -    suffix: .relax2
    -    settings_override:
    -    - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}
    -- jb: custodian.vasp.jobs.VaspJob
    -  params:
    -    final: True
    -    suffix: .static3
    -    settings_override:
    -    - {"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}
    -    - {"dict": "INCAR", "action": {"_set": {"NSW": 0}}}
    -
    -
    -# This key specifies parameters common to all jobs.
    -# Keys starting with $ are expanded to the environmental values.
    -# The example below means the parameter vasp_cmd is set to the value with
    -# $PBS_NODEFILE expanded.
    -
    -jobs_common_params:
    -  $vasp_cmd: ["mpirun", "-machinefile", "$PBS_NODEFILE", "-np", "24", "vasp"]
    -
    -
    -# Specifies a list of error handlers in the same format as jobs. Similarly,
    -# parameters passed to the handler __init__ can be configured the same
    -# way as for jobs.
    -handlers:
    -- hdlr: custodian.vasp.handlers.VaspErrorHandler
    -- hdlr: custodian.vasp.handlers.AliasingErrorHandler
    -- hdlr: custodian.vasp.handlers.MeshSymmetryErrorHandler
    -
    -# Specifies a list of error handlers in the same format as jobs.
    -validators:
    -- vldr: custodian.vasp.validators.VasprunXMLValidator
    -
    -#This sets all custodian running parameters.
    -custodian_params:
    -  max_errors: 10
    -  scratch_dir: /tmp
    -  gzipped_output: True
    -  checkpoint: True
    -
    -
    -

    You can then run the job using the following command:

    -
    cstdn run <path to yaml file>
    -
    -
    -
    -
    -

    API/Reference Docs

    -

    The API docs are generated using Sphinx auto-doc and outlines the purpose of all -modules and classes, and the expected argument and returned objects for most -methods. They are available at the link below.

    -

    custodian API docs

    -
    -
    -

    How to cite custodian

    -

    If you use custodian in your research, especially the VASP component, please -consider citing the following work:

    -
    Shyue Ping Ong, William Davidson Richards, Anubhav Jain, Geoffroy Hautier,
    -Michael Kocher, Shreyas Cholia, Dan Gunter, Vincent Chevrier, Kristin A.
    -Persson, Gerbrand Ceder. *Python Materials Genomics (pymatgen) : A Robust,
    -Open-Source Python Library for Materials Analysis.* Computational
    -Materials Science, 2013, 68, 314–319. `doi:10.1016/j.commatsci.2012.10.028
    -<http://dx.doi.org/10.1016/j.commatsci.2012.10.028>`_
    -
    -
    -
    -
    -

    License

    -

    Custodian is released under the MIT License. The terms of the license are as -follows:

    -
    The MIT License (MIT)
    -Copyright (c) 2011-2012 MIT & LBNL
    -
    -Permission is hereby granted, free of charge, to any person obtaining a
    -copy of this software and associated documentation files (the "Software")
    -, to deal in the Software without restriction, including without limitation
    -the rights to use, copy, modify, merge, publish, distribute, sublicense,
    -and/or sell copies of the Software, and to permit persons to whom the
    -Software is furnished to do so, subject to the following conditions:
    -
    -The above copyright notice and this permission notice shall be included in
    -all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    -DEALINGS IN THE SOFTWARE.
    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/modules.html b/docs/html/modules.html deleted file mode 100644 index a097decf..00000000 --- a/docs/html/modules.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - custodian — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/html/objects.inv b/docs/html/objects.inv deleted file mode 100644 index 3c16333b..00000000 Binary files a/docs/html/objects.inv and /dev/null differ diff --git a/docs/html/py-modindex.html b/docs/html/py-modindex.html deleted file mode 100644 index 52494ff8..00000000 --- a/docs/html/py-modindex.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Python Module Index — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - - -

    Python Module Index

    - -
    - c -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    - c
    - custodian -
        - custodian.ansible -
        - custodian.ansible.actions -
        - custodian.ansible.interpreter -
        - custodian.cli -
        - custodian.cli.converge_geometry -
        - custodian.cli.converge_kpoints -
        - custodian.cli.cstdn -
        - custodian.cli.run_nwchem -
        - custodian.cli.run_vasp -
        - custodian.custodian -
        - custodian.feff -
        - custodian.feff.handlers -
        - custodian.feff.interpreter -
        - custodian.feff.jobs -
        - custodian.nwchem -
        - custodian.nwchem.handlers -
        - custodian.nwchem.jobs -
        - custodian.qchem -
        - custodian.qchem.handlers -
        - custodian.qchem.jobs -
        - custodian.utils -
        - custodian.vasp -
        - custodian.vasp.handlers -
        - custodian.vasp.interpreter -
        - custodian.vasp.jobs -
        - custodian.vasp.validators -
    - - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/search.html b/docs/html/search.html deleted file mode 100644 index f4a642ac..00000000 --- a/docs/html/search.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - Search — custodian 2019.8.23 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -

    Search

    -
    - -

    - Please activate JavaScript to enable the search - functionality. -

    -
    -

    - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

    -
    - - - -
    - -
    - -
    - -
    -
    -
    - -
    -
    - - - - - - \ No newline at end of file diff --git a/docs/html/searchindex.js b/docs/html/searchindex.js deleted file mode 100644 index 0356c941..00000000 --- a/docs/html/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({docnames:["_themes/README","changelog","custodian","custodian.ansible","custodian.cli","custodian.feff","custodian.nwchem","custodian.qchem","custodian.vasp","index","modules"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["_themes/README.rst","changelog.rst","custodian.rst","custodian.ansible.rst","custodian.cli.rst","custodian.feff.rst","custodian.nwchem.rst","custodian.qchem.rst","custodian.vasp.rst","index.rst","modules.rst"],objects:{"":{custodian:[2,0,0,"-"]},"custodian.ansible":{actions:[3,0,0,"-"],interpreter:[3,0,0,"-"]},"custodian.ansible.actions":{DictActions:[3,1,1,""],FileActions:[3,1,1,""],get_nested_dict:[3,3,1,""]},"custodian.ansible.actions.DictActions":{add_to_set:[3,2,1,""],inc:[3,2,1,""],pop:[3,2,1,""],pull:[3,2,1,""],pull_all:[3,2,1,""],push:[3,2,1,""],push_all:[3,2,1,""],rename:[3,2,1,""],set:[3,2,1,""],unset:[3,2,1,""]},"custodian.ansible.actions.FileActions":{file_copy:[3,2,1,""],file_create:[3,2,1,""],file_delete:[3,2,1,""],file_modify:[3,2,1,""],file_move:[3,2,1,""]},"custodian.ansible.interpreter":{Modder:[3,1,1,""]},"custodian.ansible.interpreter.Modder":{modify:[3,2,1,""],modify_object:[3,2,1,""]},"custodian.cli":{converge_geometry:[4,0,0,"-"],converge_kpoints:[4,0,0,"-"],cstdn:[4,0,0,"-"],run_nwchem:[4,0,0,"-"],run_vasp:[4,0,0,"-"]},"custodian.cli.converge_geometry":{do_run:[4,3,1,""],get_runs:[4,3,1,""]},"custodian.cli.converge_kpoints":{do_run:[4,3,1,""],get_runs:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.cstdn":{main:[4,3,1,""],print_example:[4,3,1,""],run:[4,3,1,""]},"custodian.cli.run_nwchem":{do_run:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.run_vasp":{do_run:[4,3,1,""],get_jobs:[4,3,1,""],load_class:[4,3,1,""],main:[4,3,1,""]},"custodian.custodian":{Custodian:[2,1,1,""],CustodianError:[2,5,1,""],ErrorHandler:[2,1,1,""],Job:[2,1,1,""],MaxCorrectionsError:[2,5,1,""],MaxCorrectionsPerHandlerError:[2,5,1,""],MaxCorrectionsPerJobError:[2,5,1,""],NonRecoverableError:[2,5,1,""],ReturnCodeError:[2,5,1,""],ValidationError:[2,5,1,""],Validator:[2,1,1,""]},"custodian.custodian.Custodian":{LOG_FILE:[2,4,1,""],from_spec:[2,2,1,""],run:[2,2,1,""],run_interrupted:[2,2,1,""]},"custodian.custodian.ErrorHandler":{check:[2,2,1,""],correct:[2,2,1,""],is_monitor:[2,4,1,""],is_terminating:[2,4,1,""],max_num_corrections:[2,4,1,""],n_applied_corrections:[2,2,1,""],raise_on_max:[2,4,1,""],raises_runtime_error:[2,4,1,""]},"custodian.custodian.Job":{name:[2,2,1,""],postprocess:[2,2,1,""],run:[2,2,1,""],setup:[2,2,1,""],terminate:[2,2,1,""]},"custodian.custodian.Validator":{check:[2,2,1,""]},"custodian.feff":{handlers:[5,0,0,"-"],interpreter:[5,0,0,"-"],jobs:[5,0,0,"-"]},"custodian.feff.handlers":{UnconvergedErrorHandler:[5,1,1,""]},"custodian.feff.handlers.UnconvergedErrorHandler":{check:[5,2,1,""],correct:[5,2,1,""],is_monitor:[5,4,1,""]},"custodian.feff.interpreter":{FeffModder:[5,1,1,""]},"custodian.feff.interpreter.FeffModder":{apply_actions:[5,2,1,""]},"custodian.feff.jobs":{FeffJob:[5,1,1,""]},"custodian.feff.jobs.FeffJob":{postprocess:[5,2,1,""],run:[5,2,1,""],setup:[5,2,1,""]},"custodian.nwchem":{handlers:[6,0,0,"-"],jobs:[6,0,0,"-"]},"custodian.nwchem.handlers":{NwchemErrorHandler:[6,1,1,""]},"custodian.nwchem.handlers.NwchemErrorHandler":{check:[6,2,1,""],correct:[6,2,1,""]},"custodian.nwchem.jobs":{NwchemJob:[6,1,1,""]},"custodian.nwchem.jobs.NwchemJob":{postprocess:[6,2,1,""],run:[6,2,1,""],setup:[6,2,1,""]},"custodian.qchem":{handlers:[7,0,0,"-"],jobs:[7,0,0,"-"]},"custodian.qchem.handlers":{QChemErrorHandler:[7,1,1,""],QChemSCFErrorHandler:[7,1,1,""]},"custodian.qchem.handlers.QChemErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.handlers.QChemSCFErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.jobs":{QCJob:[7,1,1,""],perturb_coordinates:[7,3,1,""]},"custodian.qchem.jobs.QCJob":{current_command:[7,2,1,""],opt_with_frequency_flattener:[7,2,1,""],postprocess:[7,2,1,""],run:[7,2,1,""],setup:[7,2,1,""]},"custodian.utils":{backup:[2,3,1,""],get_execution_host_info:[2,3,1,""]},"custodian.vasp":{handlers:[8,0,0,"-"],interpreter:[8,0,0,"-"],jobs:[8,0,0,"-"],validators:[8,0,0,"-"]},"custodian.vasp.handlers":{AliasingErrorHandler:[8,1,1,""],CheckpointHandler:[8,1,1,""],DriftErrorHandler:[8,1,1,""],FrozenJobErrorHandler:[8,1,1,""],LrfCommutatorHandler:[8,1,1,""],MaxForceErrorHandler:[8,1,1,""],MeshSymmetryErrorHandler:[8,1,1,""],NonConvergingErrorHandler:[8,1,1,""],PositiveEnergyErrorHandler:[8,1,1,""],PotimErrorHandler:[8,1,1,""],StdErrHandler:[8,1,1,""],StoppedRunHandler:[8,1,1,""],UnconvergedErrorHandler:[8,1,1,""],VaspErrorHandler:[8,1,1,""],WalltimeHandler:[8,1,1,""]},"custodian.vasp.handlers.AliasingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.CheckpointHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.DriftErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""]},"custodian.vasp.handlers.FrozenJobErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.LrfCommutatorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MaxForceErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MeshSymmetryErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.NonConvergingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PositiveEnergyErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PotimErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StdErrHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StoppedRunHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.UnconvergedErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.VaspErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.WalltimeHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""],raises_runtime_error:[8,4,1,""]},"custodian.vasp.interpreter":{VaspModder:[8,1,1,""]},"custodian.vasp.interpreter.VaspModder":{apply_actions:[8,2,1,""]},"custodian.vasp.jobs":{GenerateVaspInputJob:[8,1,1,""],VaspJob:[8,1,1,""],VaspNEBJob:[8,1,1,""]},"custodian.vasp.jobs.GenerateVaspInputJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.jobs.VaspJob":{constrained_opt_run:[8,2,1,""],double_relaxation_run:[8,2,1,""],full_opt_run:[8,2,1,""],metagga_opt_run:[8,2,1,""],postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""],terminate:[8,2,1,""]},"custodian.vasp.jobs.VaspNEBJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.validators":{VaspAECCARValidator:[8,1,1,""],VaspFilesValidator:[8,1,1,""],VaspNpTMDValidator:[8,1,1,""],VasprunXMLValidator:[8,1,1,""],check_broken_chgcar:[8,3,1,""]},"custodian.vasp.validators.VaspAECCARValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspFilesValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspNpTMDValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VasprunXMLValidator":{check:[8,2,1,""]},custodian:{ansible:[3,0,0,"-"],cli:[4,0,0,"-"],custodian:[2,0,0,"-"],feff:[5,0,0,"-"],nwchem:[6,0,0,"-"],qchem:[7,0,0,"-"],utils:[2,0,0,"-"],vasp:[8,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"],"4":["py","attribute","Python attribute"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function","4":"py:attribute","5":"py:exception"},terms:{"1ev":8,"1x1x1":[1,8],"abstract":[2,9],"case":[8,9],"catch":[1,2,8],"class":[1,2,3,5,6,7,8,9],"default":[1,2,3,5,6,7,8],"final":[2,5,8,9],"float":[7,8],"function":[1,2,8],"import":[1,9],"int":[2,7,8],"long":[8,9],"new":[1,3,9],"return":[1,2,3,5,6,7,8,9],"static":[1,3,8,9],"switch":[1,8],"true":[2,3,5,6,7,8,9],"try":7,AND:9,Added:1,BUT:9,But:8,EOS:8,FOR:9,For:[1,2,3,6,8,9],NOT:9,Not:6,One:8,PBS:[1,8],Such:9,THE:9,The:[0,1,2,3,6,7,8,9],There:[2,8,9],These:2,USE:9,Use:8,Used:[2,5,7,8],Useful:[1,8],Using:9,WITH:9,Will:1,__init__:[2,9],_add_to_set:3,_each:3,_file_copi:[2,3,8,9],_file_delet:3,_file_mov:3,_inc:3,_pop:3,_pull:3,_pull_al:3,_push:3,_push_al:3,_renam:3,_set:[3,8,9],_theme:0,_unset:3,abov:9,absolut:8,abspath:0,access:3,accordingli:8,accur:8,achiev:8,action:[2,5,6,7,8,9,10],action_keyword:3,activ:8,actual:[2,3,5,6,7,8],actual_cont:3,add:[0,9],add_to_set:3,added:[8,9],addit:9,addon:0,address:[1,7],adopt:3,aeccar:8,affect:8,aflow:[1,8],after:[1,2,7,8,9],again:9,aimd:8,aka:7,algo:[1,8],algorithm:[7,8],alias:8,aliasing_incar:8,aliasingerrorhandl:[2,8,9],all:[1,2,5,7,8,9],alloc:8,allow:[2,3,7,8,9],alreadi:8,also:[0,8,9],altern:[0,8],alwai:9,ambigu:3,amin:8,amount:8,analysi:[2,7,8,9],ani:[2,3,5,6,7,8,9],annot:9,ansibl:[2,5,6,8,10],anubhav:9,api:[1,3],append:[0,5,6,7,8],appli:[2,5,7,8],applic:9,apply_act:[5,8],approxim:8,arbitrari:1,archiv:5,area:9,arg:[4,6,8,9],argument:[3,8,9],aris:9,around:8,arrang:8,as_dict:3,aspect:9,assimil:1,associ:9,atom:8,atom_relax:8,attempt:8,attribut:2,author:9,auto:[8,9],auto_continu:8,auto_gamma:[1,8],auto_npar:[1,8],automat:[1,5,8],avail:9,averag:8,avoid:[3,5,8],b3lyp:6,back:[2,5,8],background:1,backup:[1,2,5,6,7,8],backward:1,bad:2,badvasprunxmlhandl:1,band:[1,8],base:[1,2,3,5,6,7,8,9],basi:[8,9],basic:[4,5,6,7,8],becaus:3,becom:9,been:[2,7,8,9],befor:[2,7,8],begin:2,being:[6,8],below:9,better:8,between:[2,8,9],bfg:8,biaxial:8,bisect:8,bit:8,bleed:9,bool:[2,3,5,6,7,8],bracket:8,brion:[1,8],brmix:[1,8],buffer:[1,8],buffer_tim:8,bug:[1,9],buggi:9,bye:3,calcul:[1,5,7,8],call:[1,2,5,6,7,8],callabl:2,can:[0,1,2,3,7,8,9],cannot:[2,8],care:8,caus:[1,2,8,9],ceder:9,cell:8,center:1,certain:[8,9],chanc:9,chang:[5,6,8],charg:9,check:[0,1,2,5,6,7,8,9],check_broken_chgcar:8,check_connect:7,checkpoint:[1,2,8,9],checkpointhandl:8,chemistri:9,chevrier:9,chgcar:8,chk:2,chk_:8,chkpt:8,cholia:9,claim:9,classifi:2,classmethod:[2,7,8],cleanup:[1,2,7,8],cli:[2,10],clone:9,cluster:[1,8],cluster_nam:2,code:[1,2,8,9],collinear:8,combiant:8,combin:[4,8],come:[1,9],command:[1,6,7,8,9],commatsci:9,common:[2,7,8,9],common_param:2,commonli:1,compat:1,compil:[1,8],complet:[2,8,9],complex:[8,9],compon:9,comprehens:[1,9],compris:9,comput:9,conceiv:8,concret:9,condit:9,conf:0,configur:9,connect:[7,9],consid:[2,8,9],consider:8,consolid:1,constrain:8,constrained_opt_run:8,construct:2,constructor:[5,8],consult:9,contain:[0,5,9],contcar:[2,8,9],contcar_onli:8,content:[0,9,10],continu:8,contract:9,control:1,converg:[4,5,7,8,9],converge_geometri:[2,10],converge_kpoint:[1,2,9,10],copi:[2,3,5,6,7,8,9],copy_magmom:8,copyright:9,core:[1,7,8],correct:[1,2,5,6,7,8,9],correspond:8,corrupt:8,could:[2,8],counter:2,cours:2,crash:8,creat:[2,3,8,9],creation:[1,2],creator:8,criteria:8,critic:1,cstdn:[1,2,10],current:[1,2,5,6,8,9],current_command:7,custodian:1,custodian_exampl:9,custodian_param:[2,9],custodianerror:2,custom:2,customiz:[2,9],dacek:1,dai:9,damag:9,dan:9,dat:5,data:[8,9],date:1,dav:8,david:1,davidson:9,de_threshold:8,deal:9,def:9,default_save_nam:7,defin:[2,8,9],delet:[3,8],delta:7,demonstr:9,densiti:8,dentet:[1,8],denteterrorhandl:9,deped:1,depend:3,deprec:[1,6],deriv:8,describ:[2,5,6,7,8],desir:[2,8],dest:[2,3,8,9],detail:9,detect:[2,5,6,7,8,9],determin:8,dev:7,develop:9,dft:[1,6,8],dict:[2,3,5,6,7,8,9],dictact:[3,5,8],differ:[2,5,7,8,9],difficult:[2,8],diis_gdm:7,dir:1,direct:[5,6,8],directori:[1,2,5,7,8,9],distribut:9,do_run:4,doc:[0,1],document:[0,1,3,9],doe:[2,3,5,8],doesn:2,doi:9,done:9,doubl:[1,8,9],double_relaxation_run:[8,9],drift:8,drifterrorhandl:[1,8],driv:0,dtbdyn:8,due:[8,9],dure:[1,2,6,7,8,9],dwaraknath:1,each:[2,8,9],earli:2,easiest:9,easili:3,easy_instal:9,edddav:8,eddiag:8,eddrmm:8,eddrrm:8,edfiffg:8,edg:9,ediff:8,ediffg:8,edwav:8,effect:[1,8],either:[2,7,8],electron:[1,8],electronic_step_stop:8,element:8,elf:8,elf_kpar:8,elf_ncl:8,els:7,enabl:1,enaug_multipli:8,encount:[1,2,9],end:[2,5,6,7,8],energi:[8,9],ensembl:8,ensur:2,environ:8,environment:9,equal:2,equival:8,err1:2,err2:2,error:[1,2,3,5,6,7,8,9],error_dict:2,error_msg:8,errorhandl:[1,2,5,6,7,8,9],errors_subset_to_catch:[1,8],errors_subset_to_detect:8,especi:[1,8,9],estim:8,etc:[2,7,8],evalu:8,even:[2,9],event:[1,2,9],ever:8,everi:[1,2,8],exampl:[1,2,3,6,8],examplehandl:9,examplejob:9,exce:8,exceed:8,except:2,exceptino:9,excess:8,exclud:8,execut:[2,5,8],exist:[0,8],exit:[1,2],expand:[1,9],expect:[8,9],explicit:2,express:9,fail:[2,8,9],failur:[1,2,7],fairli:9,fall:8,fals:[2,5,6,7,8,9],fast:[1,8],faster:[1,2],fatal:8,featur:[1,9],fed:8,feff:[2,10],feff_cmd:5,feff_out:5,feffinp:5,feffinput:5,feffinput_kei:5,feffjob:5,feffmodd:5,few:[1,8],fft:8,figur:9,file:[1,2,3,5,6,7,8,9],file_copi:3,file_cr:3,file_delet:3,file_modifi:3,file_mov:3,fileact:[3,5,8],filenam:[2,3,5,8],find:8,fine:[1,8,9],finish:[1,2,8],firework:9,first:[1,2,7,8],fit:9,fix:[1,2,7],flag:[1,2],flask:0,flexibl:[1,8,9],fluctuat:8,folder:[0,1,8],follow:[0,2,3,8,9],forc:8,form:[5,8],format:[2,9],former:2,found:[2,7,8],framework:9,free:9,frequenc:7,from:[1,2,3,5,7,8,9],from_dict:3,from_spec:2,frozen:[8,9],frozenjoberrorhandl:8,full:[3,5,8,9],full_opt_run:8,furnish:9,gamma:[1,8],gamma_vasp_cmd:8,gave:2,gener:[2,5,6,8,9],generate_kpoints_tran:8,generatevaspinputjob:8,genom:9,geoffroi:9,geom_max_cycl:7,geometri:[4,7,8],gerbrand:9,get:8,get_execution_host_info:2,get_job:4,get_nested_dict:3,get_run:4,gga:8,git:0,github:9,give:8,given:[2,9],gracefulli:[1,2,9],grad_not_orth:8,gradient:8,grain:[1,9],grant:9,grid:8,group:8,guess:8,guid:0,guidelin:8,guido:9,gunter:9,gzip:[1,2,5,6,8],gzipped_output:[2,6,9],gzipped_prefix:5,half_kpt:8,half_kpts_first_relax:8,halv:8,handl:[1,2,7,8,9],handler:[1,2,9,10],hanld:1,happen:8,has:[1,2,7,8,9],hautier:9,have:[1,2,5,8,9],hdlr:[2,9],hello:3,here:9,herebi:9,hermitian:8,hessian:1,high:[8,9],higher:8,highli:[8,9],his:0,hit:8,holder:9,hopefulli:9,host:2,hostnam:2,hour:8,howev:3,hse:8,html_theme:0,html_theme_path:0,http:9,hundr:9,ideal:9,ignor:[3,5,8],immedi:[1,2],implement:[1,2,3,6,8,9],impli:9,imposs:9,improv:[1,2,9],inc:3,incar:[1,8,9],includ:[1,3,8,9],incompat:1,incorrect:1,incorrect_shift:8,increas:8,increment:[1,9],indefinit:9,index:9,indic:[1,2,3,5,6,7,8],individu:2,infinit:8,inform:[3,5,9],init:8,initi:[2,3,5,6,7,8,9],initial_strain:8,initio:9,inp:5,input:[5,6,7,8,9],input_dict:3,input_fil:[6,7],input_filenam:8,input_set:8,insert:3,instal:9,instanc:2,instead:[1,3,6,8],insuffici:9,integ:8,intend:0,interfac:2,intern:8,interpret:[2,10],interrupt:1,interuppt:2,interv:8,introdc:1,introduc:7,inv_rot_mat:8,invers:8,involv:9,ionic:8,is_monitor:[1,2,5,7,8],is_termin:[1,2,8],ismear:9,issu:[1,9],istart:8,isym:1,iter:7,its:[1,2],jain:9,jit:9,job1:2,job2:2,job3:2,job:[1,2,4,10],jobid:9,jobs_common_param:[2,9],json:[1,2,5,6,7,8,9],just:[8,9],kei:[2,3,8,9],kenneth:0,keyword:3,kill:8,kind:[8,9],known:9,kocher:9,konverg:8,kpar:8,kpoint:[1,8,9],kpoints_tran:8,kr_small:0,kristin:9,kwarg:[7,8],labort:8,langevin:8,languag:3,lapack:8,larg:[0,8,9],larger:7,last:[1,7,8],latest:[1,9],latter:2,lattic:8,lattice_direct:8,lbnl:9,lead:2,leav:8,length:2,less:8,let:[2,9],level:8,liabil:9,liabl:9,librari:[0,9],like:[1,3,8,9],limit:[8,9],line:[1,8],linear:4,link:[2,9],list:[2,3,5,6,8,9],list_of_actions_taken:[2,5,6,7,8],list_of_error:[2,5,6,7,8],load:[2,8],load_class:4,log1:5,log_fil:2,longer:1,look:8,lpead:8,lrf_comm:8,lrf_commut:8,lrfcommutatorhandl:8,lstop:8,lwave:8,machinefil:9,made:1,magmom:8,mai:[1,2,8,9],main:[4,9],major:[1,9],make:[2,3,8],manag:[2,9],mani:[1,8,9],master:[4,7,8],match:8,materi:9,matrix:8,max:[7,8],max_cor:7,max_drift:8,max_error:[1,2,8,9],max_errors_per_handl:2,max_errors_per_job:2,max_force_threshold:8,max_iter:7,max_molecule_perturb_scal:7,max_num_correct:2,max_step:[4,8],maxcorrectionserror:2,maxcorrectionsperhandlererror:2,maxcorrectionsperjoberror:2,maxforceerrorhandl:8,maximum:[2,7,8],mdalgo:8,mean:[2,3,5,7,8,9],meant:9,measur:[2,5,6,7,8],mechan:[1,2,9],memori:8,merchant:9,merg:9,mesh:8,meshsymmetryerrorhandl:[8,9],meshsymmetryhandl:2,messag:[1,2,6,8],metagga:8,metagga_opt_run:8,method:[1,2,5,6,7,8,9],michael:9,might:8,min:8,minima:7,minimum:8,minor:[1,9],minut:2,misc:1,miscellan:1,miss:8,mit:9,mitsuhiko:0,mod:[3,4],modder:[3,5,8],moddermodif:[5,8],mode:[1,2,3,4,5,8,9],modif:[3,9],modifi:[3,5,8,9],modify_object:3,modul:[9,10],mol:[6,7],molecul:7,molecule_perturb_scal:7,mongo:3,monitor:[1,2,5,6,7,8],monitor_freq:2,monti:[1,2],more:[1,2,8,9],most:[0,9],mostli:3,move:[1,2,3],mpi:7,mpirun:[8,9],mpnonscfset:8,msonabl:2,much:[1,2],multi:[1,8],multimod:7,must:[1,2,3,8],n_applied_correct:2,name:[2,4,5,6,7,8,9],natoms_large_cel:8,nearing:8,neb:8,neb_std_err:8,neb_vasp:8,necessari:[1,6,8,9],necessarili:8,need:[1,2,5,6,8,9],neg:[7,8],negative_freq_vec:7,nelect:1,nest:3,new_file_nam:3,next:8,ngx:8,ngy:8,ngz:8,nice:2,nicht:8,nicht_konv:8,nionic_step:8,njob:9,nkpt:8,nois:8,non:[1,2,3,5,7,8],nonconvergingerrorhandl:8,none:[2,3,5,6,7,8,9],noninfring:9,nonrecoverableerror:2,normal:[1,8],nose:9,notat:3,note:[2,3,8],notic:[2,9],now:[1,9],npar:[1,8],npt:8,nsw:9,number:[1,2,7,8,9],numer:8,nwchem:[1,2,4,9,10],nwchem_cmd:6,nwchemerrorhandl:6,nwchemjob:6,nwout:6,obj:3,object:[2,3,5,8,9],obtain:9,obvious:9,occur:[2,7,8],off:1,offici:1,often:[8,9],old_coord:7,older:9,onc:[1,2,8],one:[0,2,8,9],ong:[1,9],onli:[1,2,3,5,6,8],open:9,openmp:7,oper:8,opt:2,opt_with_frequency_flatten:7,optim:[1,7,8],option:[1,2,6],order:[2,9],org:9,orig:[5,6,7,8],orthogon:8,oszicar:8,other:[1,2,8,9],otherwis:[2,8,9],out:[0,5,6,8,9],out_of_memori:8,outcar:8,outlin:9,output:[1,2,5,6,7,8,9],output_fil:[5,6,7,8],output_filenam:[5,6,8],output_vasprun:8,outsid:2,over:[2,7],overrid:[6,8],overridden:2,overview:9,owner:3,packag:[1,9,10],page:0,parallel:[2,7,8],param:[2,8,9],paramet:[2,3,5,6,7,8,9],particular:[1,2,8,9],particularli:[1,9],partit:2,pass:[2,5,8,9],passthrough:[7,8],path:[0,2,3,8,9],pathnam:3,pbs_nodefil:9,pbs_walltim:8,pbswalltimehand:1,pbswalltimehandl:1,per:[1,2,8],perform:[1,2,3,4,5,6,7,8,9],permiss:9,permit:9,person:9,persson:9,perturb:7,perturb_coordin:7,petretto:9,ping:[1,9],pip:9,place:3,pleas:[6,9],plugin:9,point:8,point_group:8,poll:[2,8],polling_time_step:2,pop:[3,8],popen:[2,5,7,8],portion:9,poscar:[2,8,9],poscarerrorhandl:9,posit:[7,8],positiveenergyerrorhandl:8,posmap:8,possibl:[1,2],post:[1,2,7,8],postprocess:[2,5,6,7,8,9],potcar:8,potenti:[2,9],potim:[8,9],potimerrorhandl:8,pre:[2,7,8],preced:3,precis:1,precondit:8,prefer:3,prefix:[2,5],present:[6,8,9],prevent:8,pricel:[1,8],print:3,print_exampl:4,prior:7,prioriti:2,probabl:8,problem:8,process:[2,7,8],product:[1,8],progress:[1,8],project:[0,9],proper:8,properli:[1,8],properti:[2,7,9],provid:[1,2,8,9],pssyevx:8,publish:9,pull:3,pull_al:3,purpos:[8,9],push:3,push_al:3,put:[0,9],pvasp:8,py3k:1,pymatgen:[1,3,6,8,9],pymatpro:3,pypi:9,python:[1,2,9],qchem:[1,2,9,10],qchem_command:7,qchemerrorhandl:7,qchemscferrorhandl:7,qcjob:7,qcjob_kwarg:7,qclog:7,qclog_fil:7,qcscratch:7,qin:7,qout:7,queue:2,quick:8,quickli:2,rais:[2,3,5,8],raise_on_max:2,raises_runtime_error:[2,8],random:9,rang:9,rate:9,rather:8,rca_dii:7,rca_gdm_thresh:7,reach:[2,8],read:8,real:9,real_opt:8,real_optlai:8,reason:8,recalcul:7,recommend:[1,8,9],record:[7,8],recov:9,recoveri:9,redirect:[6,7,8],refactor:1,refer:3,regular:8,reitz:0,rel:9,relat:[0,2,5,6,7,8],relax1:[2,8,9],relax2:[2,9],relax:[1,8,9],releas:[1,9],reli:8,remain:[2,8],renam:[3,5,6,8],repars:[5,8],repo:9,repositori:0,request:[1,2],requir:[1,2],rerun:[2,9],research:9,reset:2,restart:[2,8,9],restor:1,restrict:9,resubmit:1,result:[2,7,8],returncodeerror:2,reversed_direct:7,rewrit:[5,8],rhosyg:8,richard:[1,9],right:9,robust:[1,2,8,9],root:2,rot_mat:1,rot_matrix:8,rotat:8,routin:8,rpa:8,rspher:8,rudimentari:1,run:[1,2,4,5,6,7,8,9],run_interrupt:2,run_nwchem:[1,2,10],run_vasp:[1,2,10],runtim:2,runtimeerror:[1,2],sai:[2,8],same:9,sampl:[2,9],satisfi:8,save:[2,7],save_nam:7,save_scratch:7,sbesselit:8,scale:[7,9],scf:[5,7],scf_max_cycl:7,scheme:[7,8],scienc:9,scratch:[1,2,7],scratch_dir:[1,2,7,9],scratch_link:2,script:[1,4,9],search:1,sec:[2,8],second:[2,8],see:[3,5,7,8,9],self:9,sell:9,sensic:8,sensit:8,sent:2,separ:1,sequenc:[1,2,3,5,8,9],seri:[2,5,8,9],serializ:[2,5,6,7,8],seriou:8,server:9,set:[1,2,3,5,6,7,8,9],settings_overrid:[2,6,8,9],setup:[1,2,5,6,7,8,9],sever:9,sge:8,shall:9,shift:[1,8],shm:7,should:[1,2,3,5,6,7,8,9],shreya:9,shyam:1,shyamd:9,shyue:[1,9],signal:2,signific:[1,8],significantli:1,similarli:9,simpl:[1,2],simpli:[2,3,5,8,9],simplifi:8,simul:[3,9],simultan:8,sinc:8,singl:[1,2],situat:[8,9],skip:2,skip_over_error:2,slightli:8,slow:[8,9],slurm:8,small:[0,8],smaller:8,softwar:9,some:[1,2,7,8,9],someth:8,sometim:[2,8],sort:2,sourc:[2,3,4,5,6,7,8,9],space:[1,2,8],spec:2,special:[3,8],specif:[1,2,9],specifi:[1,2,8,9],speed:[1,8],speedup:8,sphinx:9,split:9,spuriou:1,sqrt:[1,8],stabl:1,standard:[0,5,6,7,8],star:8,start:[1,2,7,8,9],static3:9,std_err:8,std_feff_err:5,stderr:8,stderr_fil:[5,8],stderrhandl:8,stdout:[6,8],step:[1,2,8],steve:1,stop:[2,8],stopcar:8,stoppedrunhandl:8,store:[2,8],str:[2,3,5,6,7,8],strain:8,strict:[3,5,8],string:[2,3,7],structur:[2,7,8],style:[1,6,8],sub:[1,8,9],subclass:[2,9],subdir:8,subject:9,sublicens:9,submodul:[0,10],subpackag:10,subprocess:[5,7,8],subroutin:8,subsequ:8,subset:[1,8],subspac:8,subspacematrix:8,substanti:9,success:[1,2],suffici:[8,9],suffix:[2,7,8,9],sum:9,summar:9,supercomput:1,suppli:[3,5,8,9],support:[1,2,3,5,8],sure:8,symbol:2,symmetri:[1,8],symprec:8,syntax:3,sys:0,system:[1,2,4,8,9],take:[3,9],taken:[2,5,6,7,8],tar:[2,5],target:[4,9],task:[1,2],tempfil:2,temporari:2,tend:9,tensil:8,term:9,termin:[1,2,8,9],terminate_func:2,terminate_on_nonzero_returncod:2,test:[6,9],tet:8,tetirr:8,tetrahedron:8,than:[7,8],thei:9,theme:0,thermostat:8,thi:[0,1,2,3,4,5,6,7,8,9],those:9,though:9,thousand:9,thre:8,three:9,threshold:[7,8],through:[2,9],throughput:9,time:[1,2,8,9],timeout:8,tmp:[2,9],to_averag:8,todo:6,toler:8,too:[1,8],too_few_band:8,tool:1,tort:9,total:[2,8,9],transfer:9,transpar:1,treat:8,tri:[1,2],tripl:[1,8],triple_product:8,tune:8,tupl:2,turn:1,two:[8,9],txt:[5,8],type:[1,2,8,9],typic:8,unabl:8,unconverg:[1,5],unconvergederrorhandl:[5,8,9],under:9,underscor:3,unfix:[2,5,6,7,8],unfortun:8,uniform:9,uniqu:2,unit:9,unittest:9,univers:3,unlik:[5,8],unrecover:2,unrecoverable_error:1,unset:3,unsupport:[3,5,8],until:[7,8],updat:[1,8],upon:[2,8],use:[0,2,3,5,6,8,9],used:[0,1,5,6,8],useful:[1,2,8,9],user:2,uses:[0,1,2,9],using:[1,2,3,8,9],usual:[2,3,8],util:[1,10],valid:[1,2,9,10],validationerror:2,valu:[8,9],valueerror:[3,5,8],variabl:[1,8,9],variou:4,variuo:4,vasp:[1,2,4,9,10],vasp_cmd:[2,8,9],vasp_command:4,vasp_job_kwarg:8,vaspaeccarvalid:8,vasperrorhandl:[1,2,8,9],vaspfilesvalid:8,vaspinput:8,vaspinput_kei:8,vaspjob:[1,2,8,9],vaspmodd:8,vaspnebjob:8,vaspnptmdvalid:8,vasprun:8,vasprunxmlvalid:[2,8,9],vastli:1,vector:8,veri:[0,8,9],version:8,versu:8,via:[2,8,9],vibrat:7,vienna:9,vincent:9,vldr:[2,9],vol:8,vol_change_tol:8,wai:[1,2,9],wait:[1,2],wall:[1,8],wall_tim:8,walltim:[1,8],walltimehandl:[1,8],want:[2,8],warn:8,waroqui:1,warranti:9,wavecar:8,wavefunct:8,well:[1,9],what:[3,8],whatev:[5,8],when:[1,2,5,6,7,8,9],where:[1,2,6,8,9],whether:[1,2,3,5,6,7,8,9],which:[1,2,3,5,6,8,9],whom:9,wildcard:2,william:9,wish:8,without:[3,5,8,9],work:[1,2,8,9],workflow:[2,9],world:[3,9],wors:8,would:[8,9],wouldn:8,wrap:8,wrapper:9,write:[8,9],written:[8,9],xiaohui:1,xml:8,xrang:9,yaml:[1,2],yet:6,yield:2,you:[0,2,8,9],your:[0,8,9],zbrent:[1,8],zero:[1,2],zheev:8,zhegv:8,zpotrf:8},titles:["krTheme Sphinx Style","Change Log","custodian package","custodian.ansible package","custodian.cli package","custodian.feff package","custodian.nwchem package","custodian.qchem package","custodian.vasp package","Custodian","custodian"],titleterms:{action:3,ansibl:3,api:9,calcul:9,chang:[1,9],cite:9,cli:4,content:[2,3,4,5,6,7,8],control:9,converge_geometri:4,converge_kpoint:4,cstdn:[4,9],custodian:[2,3,4,5,6,7,8,9,10],depend:9,development:9,doc:9,electron:9,exampl:9,feff:5,get:9,handler:[5,6,7,8],how:9,interpret:[3,5,8],job:[5,6,7,8,9],krtheme:0,licens:9,log:[1,9],modul:[2,3,4,5,6,7,8],nwchem:6,option:9,packag:[2,3,4,5,6,7,8],practic:9,qchem:7,refer:9,requir:9,run_nwchem:4,run_vasp:4,simpl:9,spec:9,sphinx:0,stabl:9,structur:9,style:0,submodul:[2,3,4,5,6,7,8],subpackag:[2,3,5,6,7,8],usag:9,util:2,v2017:1,v2019:9,valid:8,vasp:8,version:[1,9],yaml:9}}) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 8ebe681c..13e9cd60 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ - Custodian — custodian 2019.8.23 documentation + Custodian — custodian 2019.8.24 documentation @@ -37,7 +37,7 @@

    Navigation

  • modules |
  • - +
    @@ -68,18 +68,15 @@

    Custodian

    Change log

    -
    -

    v2019.2.10

    +
    +

    v2019.8.24

      -
    • Improved slow convergence handling. (@shyamd)

    • -
    -
    -
    -

    v2019.2.7

    -
      -
    • Improved error logging.

    • -
    • Improved handling of frozen jobs and potim errors.

    • -
    • Improved Exceptino handling. (Guido Petretto)

    • +
    • Cleanup codestyle, which is now enforced.

    • +
    • Py3k support only, in line with pymatgen.

    • +
    • Update dependencies.

    • +
    • Sentry support (@mkhorton).

    • +
    • Complete qchem overhaul (frequency flattening optimization, refined error +handlers) (@samblau)

    Older versions

    @@ -90,11 +87,7 @@

    Getting custodian

    The version at the Python Package Index (PyPI) is always the latest stable release that will be hopefully, be relatively bug-free. The easiest way to -install custodian on any system is to use easy_install or pip, as follows:

    -
    easy_install custodian
    -
    -
    -

    or:

    +install custodian on any system is to use pip, as follows:

    pip install custodian
     
    @@ -118,19 +111,20 @@

    Developmental version

    Requirements

    -

    Custodian requires Python 2.7+. There are no other required dependencies.

    +

    Custodian requires Python 3.5+. There are no other required dependencies.

    Optional dependencies

    Optional libraries that are required if you need certain features:

      -
    1. Python Materials Genomics (pymatgen) 2.8.10+: To use the plugin for +

    2. Python Materials Genomics (pymatgen) 2019.8.23+: To use the plugin for VASP, NwChem and Qchem. Please install using:

      pip install pymatgen
       

      For more information, please consult pymatgen’s documentation.

    3. -
    4. nose - For complete unittesting.

    5. +
    6. pytest - For complete unittesting.

    7. +
    8. pycodestyle - For checking pep8 compliance.

    @@ -388,8 +382,7 @@

    Table of Contents

    diff --git a/docs/objects.inv b/docs/objects.inv index 3c16333b..5adc3a0a 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/py-modindex.html b/docs/py-modindex.html index 52494ff8..536cc396 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -4,7 +4,7 @@ - Python Module Index — custodian 2019.8.23 documentation + Python Module Index — custodian 2019.8.24 documentation @@ -40,7 +40,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/search.html b/docs/search.html index f4a642ac..4fe8f2bb 100644 --- a/docs/search.html +++ b/docs/search.html @@ -4,7 +4,7 @@ - Search — custodian 2019.8.23 documentation + Search — custodian 2019.8.24 documentation @@ -42,7 +42,7 @@

    Navigation

  • modules |
  • - +
    diff --git a/docs/searchindex.js b/docs/searchindex.js index 0356c941..6de1cfdb 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["_themes/README","changelog","custodian","custodian.ansible","custodian.cli","custodian.feff","custodian.nwchem","custodian.qchem","custodian.vasp","index","modules"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["_themes/README.rst","changelog.rst","custodian.rst","custodian.ansible.rst","custodian.cli.rst","custodian.feff.rst","custodian.nwchem.rst","custodian.qchem.rst","custodian.vasp.rst","index.rst","modules.rst"],objects:{"":{custodian:[2,0,0,"-"]},"custodian.ansible":{actions:[3,0,0,"-"],interpreter:[3,0,0,"-"]},"custodian.ansible.actions":{DictActions:[3,1,1,""],FileActions:[3,1,1,""],get_nested_dict:[3,3,1,""]},"custodian.ansible.actions.DictActions":{add_to_set:[3,2,1,""],inc:[3,2,1,""],pop:[3,2,1,""],pull:[3,2,1,""],pull_all:[3,2,1,""],push:[3,2,1,""],push_all:[3,2,1,""],rename:[3,2,1,""],set:[3,2,1,""],unset:[3,2,1,""]},"custodian.ansible.actions.FileActions":{file_copy:[3,2,1,""],file_create:[3,2,1,""],file_delete:[3,2,1,""],file_modify:[3,2,1,""],file_move:[3,2,1,""]},"custodian.ansible.interpreter":{Modder:[3,1,1,""]},"custodian.ansible.interpreter.Modder":{modify:[3,2,1,""],modify_object:[3,2,1,""]},"custodian.cli":{converge_geometry:[4,0,0,"-"],converge_kpoints:[4,0,0,"-"],cstdn:[4,0,0,"-"],run_nwchem:[4,0,0,"-"],run_vasp:[4,0,0,"-"]},"custodian.cli.converge_geometry":{do_run:[4,3,1,""],get_runs:[4,3,1,""]},"custodian.cli.converge_kpoints":{do_run:[4,3,1,""],get_runs:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.cstdn":{main:[4,3,1,""],print_example:[4,3,1,""],run:[4,3,1,""]},"custodian.cli.run_nwchem":{do_run:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.run_vasp":{do_run:[4,3,1,""],get_jobs:[4,3,1,""],load_class:[4,3,1,""],main:[4,3,1,""]},"custodian.custodian":{Custodian:[2,1,1,""],CustodianError:[2,5,1,""],ErrorHandler:[2,1,1,""],Job:[2,1,1,""],MaxCorrectionsError:[2,5,1,""],MaxCorrectionsPerHandlerError:[2,5,1,""],MaxCorrectionsPerJobError:[2,5,1,""],NonRecoverableError:[2,5,1,""],ReturnCodeError:[2,5,1,""],ValidationError:[2,5,1,""],Validator:[2,1,1,""]},"custodian.custodian.Custodian":{LOG_FILE:[2,4,1,""],from_spec:[2,2,1,""],run:[2,2,1,""],run_interrupted:[2,2,1,""]},"custodian.custodian.ErrorHandler":{check:[2,2,1,""],correct:[2,2,1,""],is_monitor:[2,4,1,""],is_terminating:[2,4,1,""],max_num_corrections:[2,4,1,""],n_applied_corrections:[2,2,1,""],raise_on_max:[2,4,1,""],raises_runtime_error:[2,4,1,""]},"custodian.custodian.Job":{name:[2,2,1,""],postprocess:[2,2,1,""],run:[2,2,1,""],setup:[2,2,1,""],terminate:[2,2,1,""]},"custodian.custodian.Validator":{check:[2,2,1,""]},"custodian.feff":{handlers:[5,0,0,"-"],interpreter:[5,0,0,"-"],jobs:[5,0,0,"-"]},"custodian.feff.handlers":{UnconvergedErrorHandler:[5,1,1,""]},"custodian.feff.handlers.UnconvergedErrorHandler":{check:[5,2,1,""],correct:[5,2,1,""],is_monitor:[5,4,1,""]},"custodian.feff.interpreter":{FeffModder:[5,1,1,""]},"custodian.feff.interpreter.FeffModder":{apply_actions:[5,2,1,""]},"custodian.feff.jobs":{FeffJob:[5,1,1,""]},"custodian.feff.jobs.FeffJob":{postprocess:[5,2,1,""],run:[5,2,1,""],setup:[5,2,1,""]},"custodian.nwchem":{handlers:[6,0,0,"-"],jobs:[6,0,0,"-"]},"custodian.nwchem.handlers":{NwchemErrorHandler:[6,1,1,""]},"custodian.nwchem.handlers.NwchemErrorHandler":{check:[6,2,1,""],correct:[6,2,1,""]},"custodian.nwchem.jobs":{NwchemJob:[6,1,1,""]},"custodian.nwchem.jobs.NwchemJob":{postprocess:[6,2,1,""],run:[6,2,1,""],setup:[6,2,1,""]},"custodian.qchem":{handlers:[7,0,0,"-"],jobs:[7,0,0,"-"]},"custodian.qchem.handlers":{QChemErrorHandler:[7,1,1,""],QChemSCFErrorHandler:[7,1,1,""]},"custodian.qchem.handlers.QChemErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.handlers.QChemSCFErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.jobs":{QCJob:[7,1,1,""],perturb_coordinates:[7,3,1,""]},"custodian.qchem.jobs.QCJob":{current_command:[7,2,1,""],opt_with_frequency_flattener:[7,2,1,""],postprocess:[7,2,1,""],run:[7,2,1,""],setup:[7,2,1,""]},"custodian.utils":{backup:[2,3,1,""],get_execution_host_info:[2,3,1,""]},"custodian.vasp":{handlers:[8,0,0,"-"],interpreter:[8,0,0,"-"],jobs:[8,0,0,"-"],validators:[8,0,0,"-"]},"custodian.vasp.handlers":{AliasingErrorHandler:[8,1,1,""],CheckpointHandler:[8,1,1,""],DriftErrorHandler:[8,1,1,""],FrozenJobErrorHandler:[8,1,1,""],LrfCommutatorHandler:[8,1,1,""],MaxForceErrorHandler:[8,1,1,""],MeshSymmetryErrorHandler:[8,1,1,""],NonConvergingErrorHandler:[8,1,1,""],PositiveEnergyErrorHandler:[8,1,1,""],PotimErrorHandler:[8,1,1,""],StdErrHandler:[8,1,1,""],StoppedRunHandler:[8,1,1,""],UnconvergedErrorHandler:[8,1,1,""],VaspErrorHandler:[8,1,1,""],WalltimeHandler:[8,1,1,""]},"custodian.vasp.handlers.AliasingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.CheckpointHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.DriftErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""]},"custodian.vasp.handlers.FrozenJobErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.LrfCommutatorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MaxForceErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MeshSymmetryErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.NonConvergingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PositiveEnergyErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PotimErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StdErrHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StoppedRunHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.UnconvergedErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.VaspErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.WalltimeHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""],raises_runtime_error:[8,4,1,""]},"custodian.vasp.interpreter":{VaspModder:[8,1,1,""]},"custodian.vasp.interpreter.VaspModder":{apply_actions:[8,2,1,""]},"custodian.vasp.jobs":{GenerateVaspInputJob:[8,1,1,""],VaspJob:[8,1,1,""],VaspNEBJob:[8,1,1,""]},"custodian.vasp.jobs.GenerateVaspInputJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.jobs.VaspJob":{constrained_opt_run:[8,2,1,""],double_relaxation_run:[8,2,1,""],full_opt_run:[8,2,1,""],metagga_opt_run:[8,2,1,""],postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""],terminate:[8,2,1,""]},"custodian.vasp.jobs.VaspNEBJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.validators":{VaspAECCARValidator:[8,1,1,""],VaspFilesValidator:[8,1,1,""],VaspNpTMDValidator:[8,1,1,""],VasprunXMLValidator:[8,1,1,""],check_broken_chgcar:[8,3,1,""]},"custodian.vasp.validators.VaspAECCARValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspFilesValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspNpTMDValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VasprunXMLValidator":{check:[8,2,1,""]},custodian:{ansible:[3,0,0,"-"],cli:[4,0,0,"-"],custodian:[2,0,0,"-"],feff:[5,0,0,"-"],nwchem:[6,0,0,"-"],qchem:[7,0,0,"-"],utils:[2,0,0,"-"],vasp:[8,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"],"4":["py","attribute","Python attribute"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function","4":"py:attribute","5":"py:exception"},terms:{"1ev":8,"1x1x1":[1,8],"abstract":[2,9],"case":[8,9],"catch":[1,2,8],"class":[1,2,3,5,6,7,8,9],"default":[1,2,3,5,6,7,8],"final":[2,5,8,9],"float":[7,8],"function":[1,2,8],"import":[1,9],"int":[2,7,8],"long":[8,9],"new":[1,3,9],"return":[1,2,3,5,6,7,8,9],"static":[1,3,8,9],"switch":[1,8],"true":[2,3,5,6,7,8,9],"try":7,AND:9,Added:1,BUT:9,But:8,EOS:8,FOR:9,For:[1,2,3,6,8,9],NOT:9,Not:6,One:8,PBS:[1,8],Such:9,THE:9,The:[0,1,2,3,6,7,8,9],There:[2,8,9],These:2,USE:9,Use:8,Used:[2,5,7,8],Useful:[1,8],Using:9,WITH:9,Will:1,__init__:[2,9],_add_to_set:3,_each:3,_file_copi:[2,3,8,9],_file_delet:3,_file_mov:3,_inc:3,_pop:3,_pull:3,_pull_al:3,_push:3,_push_al:3,_renam:3,_set:[3,8,9],_theme:0,_unset:3,abov:9,absolut:8,abspath:0,access:3,accordingli:8,accur:8,achiev:8,action:[2,5,6,7,8,9,10],action_keyword:3,activ:8,actual:[2,3,5,6,7,8],actual_cont:3,add:[0,9],add_to_set:3,added:[8,9],addit:9,addon:0,address:[1,7],adopt:3,aeccar:8,affect:8,aflow:[1,8],after:[1,2,7,8,9],again:9,aimd:8,aka:7,algo:[1,8],algorithm:[7,8],alias:8,aliasing_incar:8,aliasingerrorhandl:[2,8,9],all:[1,2,5,7,8,9],alloc:8,allow:[2,3,7,8,9],alreadi:8,also:[0,8,9],altern:[0,8],alwai:9,ambigu:3,amin:8,amount:8,analysi:[2,7,8,9],ani:[2,3,5,6,7,8,9],annot:9,ansibl:[2,5,6,8,10],anubhav:9,api:[1,3],append:[0,5,6,7,8],appli:[2,5,7,8],applic:9,apply_act:[5,8],approxim:8,arbitrari:1,archiv:5,area:9,arg:[4,6,8,9],argument:[3,8,9],aris:9,around:8,arrang:8,as_dict:3,aspect:9,assimil:1,associ:9,atom:8,atom_relax:8,attempt:8,attribut:2,author:9,auto:[8,9],auto_continu:8,auto_gamma:[1,8],auto_npar:[1,8],automat:[1,5,8],avail:9,averag:8,avoid:[3,5,8],b3lyp:6,back:[2,5,8],background:1,backup:[1,2,5,6,7,8],backward:1,bad:2,badvasprunxmlhandl:1,band:[1,8],base:[1,2,3,5,6,7,8,9],basi:[8,9],basic:[4,5,6,7,8],becaus:3,becom:9,been:[2,7,8,9],befor:[2,7,8],begin:2,being:[6,8],below:9,better:8,between:[2,8,9],bfg:8,biaxial:8,bisect:8,bit:8,bleed:9,bool:[2,3,5,6,7,8],bracket:8,brion:[1,8],brmix:[1,8],buffer:[1,8],buffer_tim:8,bug:[1,9],buggi:9,bye:3,calcul:[1,5,7,8],call:[1,2,5,6,7,8],callabl:2,can:[0,1,2,3,7,8,9],cannot:[2,8],care:8,caus:[1,2,8,9],ceder:9,cell:8,center:1,certain:[8,9],chanc:9,chang:[5,6,8],charg:9,check:[0,1,2,5,6,7,8,9],check_broken_chgcar:8,check_connect:7,checkpoint:[1,2,8,9],checkpointhandl:8,chemistri:9,chevrier:9,chgcar:8,chk:2,chk_:8,chkpt:8,cholia:9,claim:9,classifi:2,classmethod:[2,7,8],cleanup:[1,2,7,8],cli:[2,10],clone:9,cluster:[1,8],cluster_nam:2,code:[1,2,8,9],collinear:8,combiant:8,combin:[4,8],come:[1,9],command:[1,6,7,8,9],commatsci:9,common:[2,7,8,9],common_param:2,commonli:1,compat:1,compil:[1,8],complet:[2,8,9],complex:[8,9],compon:9,comprehens:[1,9],compris:9,comput:9,conceiv:8,concret:9,condit:9,conf:0,configur:9,connect:[7,9],consid:[2,8,9],consider:8,consolid:1,constrain:8,constrained_opt_run:8,construct:2,constructor:[5,8],consult:9,contain:[0,5,9],contcar:[2,8,9],contcar_onli:8,content:[0,9,10],continu:8,contract:9,control:1,converg:[4,5,7,8,9],converge_geometri:[2,10],converge_kpoint:[1,2,9,10],copi:[2,3,5,6,7,8,9],copy_magmom:8,copyright:9,core:[1,7,8],correct:[1,2,5,6,7,8,9],correspond:8,corrupt:8,could:[2,8],counter:2,cours:2,crash:8,creat:[2,3,8,9],creation:[1,2],creator:8,criteria:8,critic:1,cstdn:[1,2,10],current:[1,2,5,6,8,9],current_command:7,custodian:1,custodian_exampl:9,custodian_param:[2,9],custodianerror:2,custom:2,customiz:[2,9],dacek:1,dai:9,damag:9,dan:9,dat:5,data:[8,9],date:1,dav:8,david:1,davidson:9,de_threshold:8,deal:9,def:9,default_save_nam:7,defin:[2,8,9],delet:[3,8],delta:7,demonstr:9,densiti:8,dentet:[1,8],denteterrorhandl:9,deped:1,depend:3,deprec:[1,6],deriv:8,describ:[2,5,6,7,8],desir:[2,8],dest:[2,3,8,9],detail:9,detect:[2,5,6,7,8,9],determin:8,dev:7,develop:9,dft:[1,6,8],dict:[2,3,5,6,7,8,9],dictact:[3,5,8],differ:[2,5,7,8,9],difficult:[2,8],diis_gdm:7,dir:1,direct:[5,6,8],directori:[1,2,5,7,8,9],distribut:9,do_run:4,doc:[0,1],document:[0,1,3,9],doe:[2,3,5,8],doesn:2,doi:9,done:9,doubl:[1,8,9],double_relaxation_run:[8,9],drift:8,drifterrorhandl:[1,8],driv:0,dtbdyn:8,due:[8,9],dure:[1,2,6,7,8,9],dwaraknath:1,each:[2,8,9],earli:2,easiest:9,easili:3,easy_instal:9,edddav:8,eddiag:8,eddrmm:8,eddrrm:8,edfiffg:8,edg:9,ediff:8,ediffg:8,edwav:8,effect:[1,8],either:[2,7,8],electron:[1,8],electronic_step_stop:8,element:8,elf:8,elf_kpar:8,elf_ncl:8,els:7,enabl:1,enaug_multipli:8,encount:[1,2,9],end:[2,5,6,7,8],energi:[8,9],ensembl:8,ensur:2,environ:8,environment:9,equal:2,equival:8,err1:2,err2:2,error:[1,2,3,5,6,7,8,9],error_dict:2,error_msg:8,errorhandl:[1,2,5,6,7,8,9],errors_subset_to_catch:[1,8],errors_subset_to_detect:8,especi:[1,8,9],estim:8,etc:[2,7,8],evalu:8,even:[2,9],event:[1,2,9],ever:8,everi:[1,2,8],exampl:[1,2,3,6,8],examplehandl:9,examplejob:9,exce:8,exceed:8,except:2,exceptino:9,excess:8,exclud:8,execut:[2,5,8],exist:[0,8],exit:[1,2],expand:[1,9],expect:[8,9],explicit:2,express:9,fail:[2,8,9],failur:[1,2,7],fairli:9,fall:8,fals:[2,5,6,7,8,9],fast:[1,8],faster:[1,2],fatal:8,featur:[1,9],fed:8,feff:[2,10],feff_cmd:5,feff_out:5,feffinp:5,feffinput:5,feffinput_kei:5,feffjob:5,feffmodd:5,few:[1,8],fft:8,figur:9,file:[1,2,3,5,6,7,8,9],file_copi:3,file_cr:3,file_delet:3,file_modifi:3,file_mov:3,fileact:[3,5,8],filenam:[2,3,5,8],find:8,fine:[1,8,9],finish:[1,2,8],firework:9,first:[1,2,7,8],fit:9,fix:[1,2,7],flag:[1,2],flask:0,flexibl:[1,8,9],fluctuat:8,folder:[0,1,8],follow:[0,2,3,8,9],forc:8,form:[5,8],format:[2,9],former:2,found:[2,7,8],framework:9,free:9,frequenc:7,from:[1,2,3,5,7,8,9],from_dict:3,from_spec:2,frozen:[8,9],frozenjoberrorhandl:8,full:[3,5,8,9],full_opt_run:8,furnish:9,gamma:[1,8],gamma_vasp_cmd:8,gave:2,gener:[2,5,6,8,9],generate_kpoints_tran:8,generatevaspinputjob:8,genom:9,geoffroi:9,geom_max_cycl:7,geometri:[4,7,8],gerbrand:9,get:8,get_execution_host_info:2,get_job:4,get_nested_dict:3,get_run:4,gga:8,git:0,github:9,give:8,given:[2,9],gracefulli:[1,2,9],grad_not_orth:8,gradient:8,grain:[1,9],grant:9,grid:8,group:8,guess:8,guid:0,guidelin:8,guido:9,gunter:9,gzip:[1,2,5,6,8],gzipped_output:[2,6,9],gzipped_prefix:5,half_kpt:8,half_kpts_first_relax:8,halv:8,handl:[1,2,7,8,9],handler:[1,2,9,10],hanld:1,happen:8,has:[1,2,7,8,9],hautier:9,have:[1,2,5,8,9],hdlr:[2,9],hello:3,here:9,herebi:9,hermitian:8,hessian:1,high:[8,9],higher:8,highli:[8,9],his:0,hit:8,holder:9,hopefulli:9,host:2,hostnam:2,hour:8,howev:3,hse:8,html_theme:0,html_theme_path:0,http:9,hundr:9,ideal:9,ignor:[3,5,8],immedi:[1,2],implement:[1,2,3,6,8,9],impli:9,imposs:9,improv:[1,2,9],inc:3,incar:[1,8,9],includ:[1,3,8,9],incompat:1,incorrect:1,incorrect_shift:8,increas:8,increment:[1,9],indefinit:9,index:9,indic:[1,2,3,5,6,7,8],individu:2,infinit:8,inform:[3,5,9],init:8,initi:[2,3,5,6,7,8,9],initial_strain:8,initio:9,inp:5,input:[5,6,7,8,9],input_dict:3,input_fil:[6,7],input_filenam:8,input_set:8,insert:3,instal:9,instanc:2,instead:[1,3,6,8],insuffici:9,integ:8,intend:0,interfac:2,intern:8,interpret:[2,10],interrupt:1,interuppt:2,interv:8,introdc:1,introduc:7,inv_rot_mat:8,invers:8,involv:9,ionic:8,is_monitor:[1,2,5,7,8],is_termin:[1,2,8],ismear:9,issu:[1,9],istart:8,isym:1,iter:7,its:[1,2],jain:9,jit:9,job1:2,job2:2,job3:2,job:[1,2,4,10],jobid:9,jobs_common_param:[2,9],json:[1,2,5,6,7,8,9],just:[8,9],kei:[2,3,8,9],kenneth:0,keyword:3,kill:8,kind:[8,9],known:9,kocher:9,konverg:8,kpar:8,kpoint:[1,8,9],kpoints_tran:8,kr_small:0,kristin:9,kwarg:[7,8],labort:8,langevin:8,languag:3,lapack:8,larg:[0,8,9],larger:7,last:[1,7,8],latest:[1,9],latter:2,lattic:8,lattice_direct:8,lbnl:9,lead:2,leav:8,length:2,less:8,let:[2,9],level:8,liabil:9,liabl:9,librari:[0,9],like:[1,3,8,9],limit:[8,9],line:[1,8],linear:4,link:[2,9],list:[2,3,5,6,8,9],list_of_actions_taken:[2,5,6,7,8],list_of_error:[2,5,6,7,8],load:[2,8],load_class:4,log1:5,log_fil:2,longer:1,look:8,lpead:8,lrf_comm:8,lrf_commut:8,lrfcommutatorhandl:8,lstop:8,lwave:8,machinefil:9,made:1,magmom:8,mai:[1,2,8,9],main:[4,9],major:[1,9],make:[2,3,8],manag:[2,9],mani:[1,8,9],master:[4,7,8],match:8,materi:9,matrix:8,max:[7,8],max_cor:7,max_drift:8,max_error:[1,2,8,9],max_errors_per_handl:2,max_errors_per_job:2,max_force_threshold:8,max_iter:7,max_molecule_perturb_scal:7,max_num_correct:2,max_step:[4,8],maxcorrectionserror:2,maxcorrectionsperhandlererror:2,maxcorrectionsperjoberror:2,maxforceerrorhandl:8,maximum:[2,7,8],mdalgo:8,mean:[2,3,5,7,8,9],meant:9,measur:[2,5,6,7,8],mechan:[1,2,9],memori:8,merchant:9,merg:9,mesh:8,meshsymmetryerrorhandl:[8,9],meshsymmetryhandl:2,messag:[1,2,6,8],metagga:8,metagga_opt_run:8,method:[1,2,5,6,7,8,9],michael:9,might:8,min:8,minima:7,minimum:8,minor:[1,9],minut:2,misc:1,miscellan:1,miss:8,mit:9,mitsuhiko:0,mod:[3,4],modder:[3,5,8],moddermodif:[5,8],mode:[1,2,3,4,5,8,9],modif:[3,9],modifi:[3,5,8,9],modify_object:3,modul:[9,10],mol:[6,7],molecul:7,molecule_perturb_scal:7,mongo:3,monitor:[1,2,5,6,7,8],monitor_freq:2,monti:[1,2],more:[1,2,8,9],most:[0,9],mostli:3,move:[1,2,3],mpi:7,mpirun:[8,9],mpnonscfset:8,msonabl:2,much:[1,2],multi:[1,8],multimod:7,must:[1,2,3,8],n_applied_correct:2,name:[2,4,5,6,7,8,9],natoms_large_cel:8,nearing:8,neb:8,neb_std_err:8,neb_vasp:8,necessari:[1,6,8,9],necessarili:8,need:[1,2,5,6,8,9],neg:[7,8],negative_freq_vec:7,nelect:1,nest:3,new_file_nam:3,next:8,ngx:8,ngy:8,ngz:8,nice:2,nicht:8,nicht_konv:8,nionic_step:8,njob:9,nkpt:8,nois:8,non:[1,2,3,5,7,8],nonconvergingerrorhandl:8,none:[2,3,5,6,7,8,9],noninfring:9,nonrecoverableerror:2,normal:[1,8],nose:9,notat:3,note:[2,3,8],notic:[2,9],now:[1,9],npar:[1,8],npt:8,nsw:9,number:[1,2,7,8,9],numer:8,nwchem:[1,2,4,9,10],nwchem_cmd:6,nwchemerrorhandl:6,nwchemjob:6,nwout:6,obj:3,object:[2,3,5,8,9],obtain:9,obvious:9,occur:[2,7,8],off:1,offici:1,often:[8,9],old_coord:7,older:9,onc:[1,2,8],one:[0,2,8,9],ong:[1,9],onli:[1,2,3,5,6,8],open:9,openmp:7,oper:8,opt:2,opt_with_frequency_flatten:7,optim:[1,7,8],option:[1,2,6],order:[2,9],org:9,orig:[5,6,7,8],orthogon:8,oszicar:8,other:[1,2,8,9],otherwis:[2,8,9],out:[0,5,6,8,9],out_of_memori:8,outcar:8,outlin:9,output:[1,2,5,6,7,8,9],output_fil:[5,6,7,8],output_filenam:[5,6,8],output_vasprun:8,outsid:2,over:[2,7],overrid:[6,8],overridden:2,overview:9,owner:3,packag:[1,9,10],page:0,parallel:[2,7,8],param:[2,8,9],paramet:[2,3,5,6,7,8,9],particular:[1,2,8,9],particularli:[1,9],partit:2,pass:[2,5,8,9],passthrough:[7,8],path:[0,2,3,8,9],pathnam:3,pbs_nodefil:9,pbs_walltim:8,pbswalltimehand:1,pbswalltimehandl:1,per:[1,2,8],perform:[1,2,3,4,5,6,7,8,9],permiss:9,permit:9,person:9,persson:9,perturb:7,perturb_coordin:7,petretto:9,ping:[1,9],pip:9,place:3,pleas:[6,9],plugin:9,point:8,point_group:8,poll:[2,8],polling_time_step:2,pop:[3,8],popen:[2,5,7,8],portion:9,poscar:[2,8,9],poscarerrorhandl:9,posit:[7,8],positiveenergyerrorhandl:8,posmap:8,possibl:[1,2],post:[1,2,7,8],postprocess:[2,5,6,7,8,9],potcar:8,potenti:[2,9],potim:[8,9],potimerrorhandl:8,pre:[2,7,8],preced:3,precis:1,precondit:8,prefer:3,prefix:[2,5],present:[6,8,9],prevent:8,pricel:[1,8],print:3,print_exampl:4,prior:7,prioriti:2,probabl:8,problem:8,process:[2,7,8],product:[1,8],progress:[1,8],project:[0,9],proper:8,properli:[1,8],properti:[2,7,9],provid:[1,2,8,9],pssyevx:8,publish:9,pull:3,pull_al:3,purpos:[8,9],push:3,push_al:3,put:[0,9],pvasp:8,py3k:1,pymatgen:[1,3,6,8,9],pymatpro:3,pypi:9,python:[1,2,9],qchem:[1,2,9,10],qchem_command:7,qchemerrorhandl:7,qchemscferrorhandl:7,qcjob:7,qcjob_kwarg:7,qclog:7,qclog_fil:7,qcscratch:7,qin:7,qout:7,queue:2,quick:8,quickli:2,rais:[2,3,5,8],raise_on_max:2,raises_runtime_error:[2,8],random:9,rang:9,rate:9,rather:8,rca_dii:7,rca_gdm_thresh:7,reach:[2,8],read:8,real:9,real_opt:8,real_optlai:8,reason:8,recalcul:7,recommend:[1,8,9],record:[7,8],recov:9,recoveri:9,redirect:[6,7,8],refactor:1,refer:3,regular:8,reitz:0,rel:9,relat:[0,2,5,6,7,8],relax1:[2,8,9],relax2:[2,9],relax:[1,8,9],releas:[1,9],reli:8,remain:[2,8],renam:[3,5,6,8],repars:[5,8],repo:9,repositori:0,request:[1,2],requir:[1,2],rerun:[2,9],research:9,reset:2,restart:[2,8,9],restor:1,restrict:9,resubmit:1,result:[2,7,8],returncodeerror:2,reversed_direct:7,rewrit:[5,8],rhosyg:8,richard:[1,9],right:9,robust:[1,2,8,9],root:2,rot_mat:1,rot_matrix:8,rotat:8,routin:8,rpa:8,rspher:8,rudimentari:1,run:[1,2,4,5,6,7,8,9],run_interrupt:2,run_nwchem:[1,2,10],run_vasp:[1,2,10],runtim:2,runtimeerror:[1,2],sai:[2,8],same:9,sampl:[2,9],satisfi:8,save:[2,7],save_nam:7,save_scratch:7,sbesselit:8,scale:[7,9],scf:[5,7],scf_max_cycl:7,scheme:[7,8],scienc:9,scratch:[1,2,7],scratch_dir:[1,2,7,9],scratch_link:2,script:[1,4,9],search:1,sec:[2,8],second:[2,8],see:[3,5,7,8,9],self:9,sell:9,sensic:8,sensit:8,sent:2,separ:1,sequenc:[1,2,3,5,8,9],seri:[2,5,8,9],serializ:[2,5,6,7,8],seriou:8,server:9,set:[1,2,3,5,6,7,8,9],settings_overrid:[2,6,8,9],setup:[1,2,5,6,7,8,9],sever:9,sge:8,shall:9,shift:[1,8],shm:7,should:[1,2,3,5,6,7,8,9],shreya:9,shyam:1,shyamd:9,shyue:[1,9],signal:2,signific:[1,8],significantli:1,similarli:9,simpl:[1,2],simpli:[2,3,5,8,9],simplifi:8,simul:[3,9],simultan:8,sinc:8,singl:[1,2],situat:[8,9],skip:2,skip_over_error:2,slightli:8,slow:[8,9],slurm:8,small:[0,8],smaller:8,softwar:9,some:[1,2,7,8,9],someth:8,sometim:[2,8],sort:2,sourc:[2,3,4,5,6,7,8,9],space:[1,2,8],spec:2,special:[3,8],specif:[1,2,9],specifi:[1,2,8,9],speed:[1,8],speedup:8,sphinx:9,split:9,spuriou:1,sqrt:[1,8],stabl:1,standard:[0,5,6,7,8],star:8,start:[1,2,7,8,9],static3:9,std_err:8,std_feff_err:5,stderr:8,stderr_fil:[5,8],stderrhandl:8,stdout:[6,8],step:[1,2,8],steve:1,stop:[2,8],stopcar:8,stoppedrunhandl:8,store:[2,8],str:[2,3,5,6,7,8],strain:8,strict:[3,5,8],string:[2,3,7],structur:[2,7,8],style:[1,6,8],sub:[1,8,9],subclass:[2,9],subdir:8,subject:9,sublicens:9,submodul:[0,10],subpackag:10,subprocess:[5,7,8],subroutin:8,subsequ:8,subset:[1,8],subspac:8,subspacematrix:8,substanti:9,success:[1,2],suffici:[8,9],suffix:[2,7,8,9],sum:9,summar:9,supercomput:1,suppli:[3,5,8,9],support:[1,2,3,5,8],sure:8,symbol:2,symmetri:[1,8],symprec:8,syntax:3,sys:0,system:[1,2,4,8,9],take:[3,9],taken:[2,5,6,7,8],tar:[2,5],target:[4,9],task:[1,2],tempfil:2,temporari:2,tend:9,tensil:8,term:9,termin:[1,2,8,9],terminate_func:2,terminate_on_nonzero_returncod:2,test:[6,9],tet:8,tetirr:8,tetrahedron:8,than:[7,8],thei:9,theme:0,thermostat:8,thi:[0,1,2,3,4,5,6,7,8,9],those:9,though:9,thousand:9,thre:8,three:9,threshold:[7,8],through:[2,9],throughput:9,time:[1,2,8,9],timeout:8,tmp:[2,9],to_averag:8,todo:6,toler:8,too:[1,8],too_few_band:8,tool:1,tort:9,total:[2,8,9],transfer:9,transpar:1,treat:8,tri:[1,2],tripl:[1,8],triple_product:8,tune:8,tupl:2,turn:1,two:[8,9],txt:[5,8],type:[1,2,8,9],typic:8,unabl:8,unconverg:[1,5],unconvergederrorhandl:[5,8,9],under:9,underscor:3,unfix:[2,5,6,7,8],unfortun:8,uniform:9,uniqu:2,unit:9,unittest:9,univers:3,unlik:[5,8],unrecover:2,unrecoverable_error:1,unset:3,unsupport:[3,5,8],until:[7,8],updat:[1,8],upon:[2,8],use:[0,2,3,5,6,8,9],used:[0,1,5,6,8],useful:[1,2,8,9],user:2,uses:[0,1,2,9],using:[1,2,3,8,9],usual:[2,3,8],util:[1,10],valid:[1,2,9,10],validationerror:2,valu:[8,9],valueerror:[3,5,8],variabl:[1,8,9],variou:4,variuo:4,vasp:[1,2,4,9,10],vasp_cmd:[2,8,9],vasp_command:4,vasp_job_kwarg:8,vaspaeccarvalid:8,vasperrorhandl:[1,2,8,9],vaspfilesvalid:8,vaspinput:8,vaspinput_kei:8,vaspjob:[1,2,8,9],vaspmodd:8,vaspnebjob:8,vaspnptmdvalid:8,vasprun:8,vasprunxmlvalid:[2,8,9],vastli:1,vector:8,veri:[0,8,9],version:8,versu:8,via:[2,8,9],vibrat:7,vienna:9,vincent:9,vldr:[2,9],vol:8,vol_change_tol:8,wai:[1,2,9],wait:[1,2],wall:[1,8],wall_tim:8,walltim:[1,8],walltimehandl:[1,8],want:[2,8],warn:8,waroqui:1,warranti:9,wavecar:8,wavefunct:8,well:[1,9],what:[3,8],whatev:[5,8],when:[1,2,5,6,7,8,9],where:[1,2,6,8,9],whether:[1,2,3,5,6,7,8,9],which:[1,2,3,5,6,8,9],whom:9,wildcard:2,william:9,wish:8,without:[3,5,8,9],work:[1,2,8,9],workflow:[2,9],world:[3,9],wors:8,would:[8,9],wouldn:8,wrap:8,wrapper:9,write:[8,9],written:[8,9],xiaohui:1,xml:8,xrang:9,yaml:[1,2],yet:6,yield:2,you:[0,2,8,9],your:[0,8,9],zbrent:[1,8],zero:[1,2],zheev:8,zhegv:8,zpotrf:8},titles:["krTheme Sphinx Style","Change Log","custodian package","custodian.ansible package","custodian.cli package","custodian.feff package","custodian.nwchem package","custodian.qchem package","custodian.vasp package","Custodian","custodian"],titleterms:{action:3,ansibl:3,api:9,calcul:9,chang:[1,9],cite:9,cli:4,content:[2,3,4,5,6,7,8],control:9,converge_geometri:4,converge_kpoint:4,cstdn:[4,9],custodian:[2,3,4,5,6,7,8,9,10],depend:9,development:9,doc:9,electron:9,exampl:9,feff:5,get:9,handler:[5,6,7,8],how:9,interpret:[3,5,8],job:[5,6,7,8,9],krtheme:0,licens:9,log:[1,9],modul:[2,3,4,5,6,7,8],nwchem:6,option:9,packag:[2,3,4,5,6,7,8],practic:9,qchem:7,refer:9,requir:9,run_nwchem:4,run_vasp:4,simpl:9,spec:9,sphinx:0,stabl:9,structur:9,style:0,submodul:[2,3,4,5,6,7,8],subpackag:[2,3,5,6,7,8],usag:9,util:2,v2017:1,v2019:9,valid:8,vasp:8,version:[1,9],yaml:9}}) \ No newline at end of file +Search.setIndex({docnames:["_themes/README","changelog","custodian","custodian.ansible","custodian.cli","custodian.feff","custodian.nwchem","custodian.qchem","custodian.vasp","index","modules"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:56},filenames:["_themes/README.rst","changelog.rst","custodian.rst","custodian.ansible.rst","custodian.cli.rst","custodian.feff.rst","custodian.nwchem.rst","custodian.qchem.rst","custodian.vasp.rst","index.rst","modules.rst"],objects:{"":{custodian:[2,0,0,"-"]},"custodian.ansible":{actions:[3,0,0,"-"],interpreter:[3,0,0,"-"]},"custodian.ansible.actions":{DictActions:[3,1,1,""],FileActions:[3,1,1,""],get_nested_dict:[3,3,1,""]},"custodian.ansible.actions.DictActions":{add_to_set:[3,2,1,""],inc:[3,2,1,""],pop:[3,2,1,""],pull:[3,2,1,""],pull_all:[3,2,1,""],push:[3,2,1,""],push_all:[3,2,1,""],rename:[3,2,1,""],set:[3,2,1,""],unset:[3,2,1,""]},"custodian.ansible.actions.FileActions":{file_copy:[3,2,1,""],file_create:[3,2,1,""],file_delete:[3,2,1,""],file_modify:[3,2,1,""],file_move:[3,2,1,""]},"custodian.ansible.interpreter":{Modder:[3,1,1,""]},"custodian.ansible.interpreter.Modder":{modify:[3,2,1,""],modify_object:[3,2,1,""]},"custodian.cli":{converge_geometry:[4,0,0,"-"],converge_kpoints:[4,0,0,"-"],cstdn:[4,0,0,"-"],run_nwchem:[4,0,0,"-"],run_vasp:[4,0,0,"-"]},"custodian.cli.converge_geometry":{do_run:[4,3,1,""],get_runs:[4,3,1,""]},"custodian.cli.converge_kpoints":{do_run:[4,3,1,""],get_runs:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.cstdn":{main:[4,3,1,""],print_example:[4,3,1,""],run:[4,3,1,""]},"custodian.cli.run_nwchem":{do_run:[4,3,1,""],main:[4,3,1,""]},"custodian.cli.run_vasp":{do_run:[4,3,1,""],get_jobs:[4,3,1,""],load_class:[4,3,1,""],main:[4,3,1,""]},"custodian.custodian":{Custodian:[2,1,1,""],CustodianError:[2,5,1,""],ErrorHandler:[2,1,1,""],Job:[2,1,1,""],MaxCorrectionsError:[2,5,1,""],MaxCorrectionsPerHandlerError:[2,5,1,""],MaxCorrectionsPerJobError:[2,5,1,""],NonRecoverableError:[2,5,1,""],ReturnCodeError:[2,5,1,""],ValidationError:[2,5,1,""],Validator:[2,1,1,""]},"custodian.custodian.Custodian":{LOG_FILE:[2,4,1,""],from_spec:[2,2,1,""],run:[2,2,1,""],run_interrupted:[2,2,1,""]},"custodian.custodian.ErrorHandler":{check:[2,2,1,""],correct:[2,2,1,""],is_monitor:[2,4,1,""],is_terminating:[2,4,1,""],max_num_corrections:[2,4,1,""],n_applied_corrections:[2,2,1,""],raise_on_max:[2,4,1,""],raises_runtime_error:[2,4,1,""]},"custodian.custodian.Job":{name:[2,2,1,""],postprocess:[2,2,1,""],run:[2,2,1,""],setup:[2,2,1,""],terminate:[2,2,1,""]},"custodian.custodian.Validator":{check:[2,2,1,""]},"custodian.feff":{handlers:[5,0,0,"-"],interpreter:[5,0,0,"-"],jobs:[5,0,0,"-"]},"custodian.feff.handlers":{UnconvergedErrorHandler:[5,1,1,""]},"custodian.feff.handlers.UnconvergedErrorHandler":{check:[5,2,1,""],correct:[5,2,1,""],is_monitor:[5,4,1,""]},"custodian.feff.interpreter":{FeffModder:[5,1,1,""]},"custodian.feff.interpreter.FeffModder":{apply_actions:[5,2,1,""]},"custodian.feff.jobs":{FeffJob:[5,1,1,""]},"custodian.feff.jobs.FeffJob":{postprocess:[5,2,1,""],run:[5,2,1,""],setup:[5,2,1,""]},"custodian.nwchem":{handlers:[6,0,0,"-"],jobs:[6,0,0,"-"]},"custodian.nwchem.handlers":{NwchemErrorHandler:[6,1,1,""]},"custodian.nwchem.handlers.NwchemErrorHandler":{check:[6,2,1,""],correct:[6,2,1,""]},"custodian.nwchem.jobs":{NwchemJob:[6,1,1,""]},"custodian.nwchem.jobs.NwchemJob":{postprocess:[6,2,1,""],run:[6,2,1,""],setup:[6,2,1,""]},"custodian.qchem":{handlers:[7,0,0,"-"],jobs:[7,0,0,"-"]},"custodian.qchem.handlers":{QChemErrorHandler:[7,1,1,""],QChemSCFErrorHandler:[7,1,1,""]},"custodian.qchem.handlers.QChemErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.handlers.QChemSCFErrorHandler":{check:[7,2,1,""],correct:[7,2,1,""],is_monitor:[7,4,1,""]},"custodian.qchem.jobs":{QCJob:[7,1,1,""],perturb_coordinates:[7,3,1,""],vector_list_diff:[7,3,1,""]},"custodian.qchem.jobs.QCJob":{current_command:[7,2,1,""],opt_with_frequency_flattener:[7,2,1,""],postprocess:[7,2,1,""],run:[7,2,1,""],setup:[7,2,1,""]},"custodian.utils":{backup:[2,3,1,""],get_execution_host_info:[2,3,1,""]},"custodian.vasp":{handlers:[8,0,0,"-"],interpreter:[8,0,0,"-"],jobs:[8,0,0,"-"],validators:[8,0,0,"-"]},"custodian.vasp.handlers":{AliasingErrorHandler:[8,1,1,""],CheckpointHandler:[8,1,1,""],DriftErrorHandler:[8,1,1,""],FrozenJobErrorHandler:[8,1,1,""],LrfCommutatorHandler:[8,1,1,""],MaxForceErrorHandler:[8,1,1,""],MeshSymmetryErrorHandler:[8,1,1,""],NonConvergingErrorHandler:[8,1,1,""],PositiveEnergyErrorHandler:[8,1,1,""],PotimErrorHandler:[8,1,1,""],StdErrHandler:[8,1,1,""],StoppedRunHandler:[8,1,1,""],UnconvergedErrorHandler:[8,1,1,""],VaspErrorHandler:[8,1,1,""],WalltimeHandler:[8,1,1,""]},"custodian.vasp.handlers.AliasingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.CheckpointHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.DriftErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""]},"custodian.vasp.handlers.FrozenJobErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.LrfCommutatorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MaxForceErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.MeshSymmetryErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.NonConvergingErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PositiveEnergyErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.PotimErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StdErrHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.StoppedRunHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""]},"custodian.vasp.handlers.UnconvergedErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.VaspErrorHandler":{check:[8,2,1,""],correct:[8,2,1,""],error_msgs:[8,4,1,""],is_monitor:[8,4,1,""]},"custodian.vasp.handlers.WalltimeHandler":{check:[8,2,1,""],correct:[8,2,1,""],is_monitor:[8,4,1,""],is_terminating:[8,4,1,""],raises_runtime_error:[8,4,1,""]},"custodian.vasp.interpreter":{VaspModder:[8,1,1,""]},"custodian.vasp.interpreter.VaspModder":{apply_actions:[8,2,1,""]},"custodian.vasp.jobs":{GenerateVaspInputJob:[8,1,1,""],VaspJob:[8,1,1,""],VaspNEBJob:[8,1,1,""]},"custodian.vasp.jobs.GenerateVaspInputJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.jobs.VaspJob":{constrained_opt_run:[8,2,1,""],double_relaxation_run:[8,2,1,""],full_opt_run:[8,2,1,""],metagga_opt_run:[8,2,1,""],postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""],terminate:[8,2,1,""]},"custodian.vasp.jobs.VaspNEBJob":{postprocess:[8,2,1,""],run:[8,2,1,""],setup:[8,2,1,""]},"custodian.vasp.validators":{VaspAECCARValidator:[8,1,1,""],VaspFilesValidator:[8,1,1,""],VaspNpTMDValidator:[8,1,1,""],VasprunXMLValidator:[8,1,1,""],check_broken_chgcar:[8,3,1,""]},"custodian.vasp.validators.VaspAECCARValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspFilesValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VaspNpTMDValidator":{check:[8,2,1,""]},"custodian.vasp.validators.VasprunXMLValidator":{check:[8,2,1,""]},custodian:{ansible:[3,0,0,"-"],cli:[4,0,0,"-"],custodian:[2,0,0,"-"],feff:[5,0,0,"-"],nwchem:[6,0,0,"-"],qchem:[7,0,0,"-"],utils:[2,0,0,"-"],vasp:[8,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","function","Python function"],"4":["py","attribute","Python attribute"],"5":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:function","4":"py:attribute","5":"py:exception"},terms:{"1ev":8,"1x1x1":[1,8],"abstract":[2,9],"case":[8,9],"catch":[1,2,8],"class":[1,2,3,5,6,7,8,9],"default":[1,2,3,5,6,7,8],"final":[2,5,8,9],"float":[7,8],"function":[1,2,8],"import":[1,9],"int":[2,7,8],"long":[8,9],"new":[1,3,9],"return":[1,2,3,5,6,7,8,9],"static":[1,3,8,9],"switch":[1,8],"true":[2,3,5,6,7,8,9],"try":7,AND:9,Added:1,BUT:9,But:8,EOS:8,FOR:9,For:[1,2,3,6,8,9],NOT:9,Not:6,One:8,PBS:[1,8],Such:9,THE:9,The:[0,1,2,3,6,7,8,9],There:[2,8,9],These:2,USE:9,Use:8,Used:[2,5,7,8],Useful:[1,8],Using:9,WITH:9,Will:1,__init__:[2,9],_add_to_set:3,_each:3,_file_copi:[2,3,8,9],_file_delet:3,_file_mov:3,_inc:3,_pop:3,_pull:3,_pull_al:3,_push:3,_push_al:3,_renam:3,_set:[3,8,9],_theme:0,_unset:3,abov:9,absolut:8,abspath:0,access:3,accordingli:8,accur:8,achiev:8,action:[2,5,6,7,8,9,10],action_keyword:3,activ:8,actual:[2,3,5,6,7,8],actual_cont:3,add:[0,9],add_to_set:3,added:[8,9],addit:9,addon:0,address:[1,7],adopt:3,aeccar:8,affect:8,aflow:[1,8],after:[1,2,7,8,9],again:9,aimd:8,aka:7,algo:[1,8],algorithm:[7,8],alias:8,aliasing_incar:8,aliasingerrorhandl:[2,8,9],all:[1,2,5,7,8,9],alloc:8,allow:[2,3,7,8,9],alreadi:8,also:[0,8,9],altern:[0,8],alwai:9,ambigu:3,amin:8,amount:8,analysi:[2,7,8,9],ani:[2,3,5,6,7,8,9],annot:9,ansibl:[2,5,6,8,10],anubhav:9,api:[1,3],append:[0,5,6,7,8],appli:[2,5,7,8],applic:9,apply_act:[5,8],approxim:8,arbitrari:1,archiv:5,area:9,arg:[4,6,8,9],argument:[3,8,9],aris:9,around:8,arrang:8,as_dict:3,aspect:9,assimil:1,associ:9,atom:8,atom_relax:8,attempt:8,attribut:2,author:9,auto:[8,9],auto_continu:8,auto_gamma:[1,8],auto_npar:[1,8],automat:[1,5,8],avail:9,averag:8,avoid:[3,5,8],b3lyp:6,back:[2,5,8],background:1,backup:[1,2,5,6,7,8],backward:1,bad:2,badvasprunxmlhandl:1,band:[1,8],base:[1,2,3,5,6,7,8,9],basi:[8,9],basic:[4,5,6,7,8],becaus:3,becom:9,been:[2,7,8,9],befor:[2,7,8],begin:2,being:[6,8],below:9,better:8,between:[2,8,9],bfg:8,biaxial:8,bisect:8,bit:8,bleed:9,bool:[2,3,5,6,7,8],bracket:8,brion:[1,8],brmix:[1,8],buffer:[1,8],buffer_tim:8,bug:[1,9],buggi:9,bye:3,calcul:[1,5,7,8],call:[1,2,5,6,7,8],callabl:2,can:[0,1,2,3,7,8,9],cannot:[2,8],care:8,caus:[1,2,8,9],ceder:9,cell:8,center:1,certain:[8,9],chanc:9,chang:[5,6,8],charg:9,check:[0,1,2,5,6,7,8,9],check_broken_chgcar:8,check_connect:7,checkpoint:[1,2,8,9],checkpointhandl:8,chemistri:9,chevrier:9,chgcar:8,chk:2,chk_:8,chkpt:8,cholia:9,claim:9,classifi:2,classmethod:[2,7,8],cleanup:[1,2,7,8,9],cli:[2,10],clone:9,cluster:[1,8],cluster_nam:2,code:[1,2,8,9],codestyl:9,collinear:8,combiant:8,combin:[4,8],come:[1,9],command:[1,6,7,8,9],commatsci:9,common:[2,7,8,9],common_param:2,commonli:1,compat:1,compil:[1,8],complet:[2,8,9],complex:[8,9],complianc:9,compon:9,comprehens:[1,9],compris:9,comput:9,conceiv:8,concret:9,condit:9,conf:0,configur:9,connect:[7,9],consid:[2,8,9],consider:8,consolid:1,constrain:8,constrained_opt_run:8,construct:2,constructor:[5,8],consult:9,contain:[0,5,9],contcar:[2,8,9],contcar_onli:8,content:[0,9,10],continu:8,contract:9,control:1,converg:[1,4,5,7,8,9],converge_geometri:[2,10],converge_kpoint:[1,2,9,10],copi:[2,3,5,6,7,8,9],copy_magmom:8,copyright:9,core:[1,7,8],correct:[1,2,5,6,7,8,9],correspond:8,corrupt:8,could:[2,8],counter:2,cours:2,crash:8,creat:[2,3,8,9],creation:[1,2],creator:8,criteria:8,critic:1,cstdn:[1,2,10],current:[1,2,5,6,7,8,9],current_command:7,custodian:1,custodian_exampl:9,custodian_param:[2,9],custodianerror:2,custom:2,customiz:[2,9],dacek:1,dai:9,damag:9,dan:9,dat:5,data:[8,9],date:1,dav:8,david:1,davidson:9,de_threshold:8,deal:9,def:9,default_save_nam:[],defin:[2,8,9],delet:[3,8],delta:7,demonstr:9,densiti:8,dentet:[1,8],denteterrorhandl:9,deped:1,depend:3,deprec:[1,6],deriv:8,describ:[2,5,6,7,8],desir:[2,8],dest:[2,3,8,9],detail:9,detect:[2,5,6,7,8,9],determin:8,dev:[],develop:9,dft:[1,6,8],dict:[2,3,5,6,7,8,9],dictact:[3,5,8],differ:[2,5,7,8,9],difficult:[2,8],diis_gdm:7,dir:1,direct:[5,6,8],directori:[1,2,5,7,8,9],distribut:9,do_run:4,doc:[0,1],docs_rst:7,document:[0,1,3,9],doe:[2,3,5,8],doesn:2,doi:9,done:9,doubl:[1,8,9],double_relaxation_run:[8,9],drift:8,drifterrorhandl:[1,8],driv:0,dtbdyn:8,due:[8,9],dure:[1,2,6,7,8,9],dwaraknath:1,each:[2,8,9],earli:2,easiest:9,easili:3,easy_instal:[],edddav:8,eddiag:8,eddrmm:8,eddrrm:8,edfiffg:8,edg:9,ediff:8,ediffg:8,edwav:8,effect:[1,8],either:[2,7,8],electron:[1,8],electronic_step_stop:8,element:8,elf:8,elf_kpar:8,elf_ncl:8,els:7,enabl:1,enaug_multipli:8,encount:[1,2,9],end:[2,5,6,7,8],energi:[8,9],enforc:9,ensembl:8,ensur:2,environ:8,environment:9,equal:2,equival:8,err1:2,err2:2,error:[1,2,3,5,6,7,8,9],error_dict:2,error_msg:8,errorhandl:[1,2,5,6,7,8,9],errors_subset_to_catch:[1,8],errors_subset_to_detect:8,especi:[1,8,9],estim:8,etc:[2,7,8],evalu:8,even:[2,9],event:[1,2,9],ever:8,everi:[1,2,8],exampl:[1,2,3,6,8],examplehandl:9,examplejob:9,exce:8,exceed:8,except:2,exceptino:1,excess:8,exclud:8,execut:[2,5,8],exist:[0,8],exit:[1,2],expand:[1,9],expect:[8,9],explicit:2,express:9,fail:[2,8,9],failur:[1,2,7],fairli:9,fall:8,fals:[2,5,6,7,8,9],fast:[1,8],faster:[1,2],fatal:8,featur:[1,9],fed:8,feff:[2,10],feff_cmd:5,feff_out:5,feffinp:5,feffinput:5,feffinput_kei:5,feffjob:5,feffmodd:5,few:[1,8],fft:8,figur:9,file:[1,2,3,5,6,7,8,9],file_copi:3,file_cr:3,file_delet:3,file_modifi:3,file_mov:3,fileact:[3,5,8],filenam:[2,3,5,8],find:8,fine:[1,8,9],finish:[1,2,8],firework:9,first:[1,2,7,8],fit:9,fix:[1,2,7],flag:[1,2],flask:0,flatten:9,flexibl:[1,8,9],fluctuat:8,folder:[0,1,8],follow:[0,2,3,8,9],forc:8,form:[5,8],format:[2,9],former:2,found:[2,7,8],framework:9,free:9,frequenc:[7,9],from:[1,2,3,5,7,8,9],from_dict:3,from_spec:2,frozen:[1,8],frozenjoberrorhandl:8,full:[3,5,8,9],full_opt_run:8,furnish:9,gamma:[1,8],gamma_vasp_cmd:8,gave:2,gener:[2,5,6,8,9],generate_kpoints_tran:8,generatevaspinputjob:8,genom:9,geoffroi:9,geom_max_cycl:7,geometri:[4,7,8],gerbrand:9,get:8,get_execution_host_info:2,get_job:4,get_nested_dict:3,get_run:4,gga:8,git:0,github:9,give:8,given:[2,9],gracefulli:[1,2,9],grad_not_orth:8,gradient:8,grain:[1,9],grant:9,grid:8,group:8,guess:8,guid:0,guidelin:8,guido:1,gunter:9,gzip:[1,2,5,6,8],gzipped_output:[2,6,9],gzipped_prefix:5,half_kpt:8,half_kpts_first_relax:8,halv:8,handl:[1,2,7,8,9],handler:[1,2,9,10],hanld:1,happen:8,has:[1,2,7,8,9],hautier:9,have:[1,2,5,8,9],hdlr:[2,9],hello:3,here:9,herebi:9,hermitian:8,hessian:1,high:[8,9],higher:8,highli:[8,9],his:0,hit:8,holder:9,hopefulli:9,host:2,hostnam:2,hour:8,howev:3,hse:8,html_theme:0,html_theme_path:0,http:9,hundr:9,ideal:9,ignor:[3,5,8],immedi:[1,2],implement:[1,2,3,6,8,9],impli:9,imposs:9,improv:[1,2],inc:3,incar:[1,8,9],includ:[1,3,8,9],incompat:1,incorrect:1,incorrect_shift:8,increas:8,increment:[1,9],indefinit:9,index:9,indic:[1,2,3,5,6,7,8],individu:2,infinit:8,inform:[3,5,9],init:8,initi:[2,3,5,6,7,8,9],initial_strain:8,initio:9,inp:5,input:[5,6,7,8,9],input_dict:3,input_fil:[6,7],input_filenam:8,input_set:8,insert:3,instal:9,instanc:2,instead:[1,3,6,8],insuffici:9,integ:8,intend:0,interfac:2,intern:8,interpret:[2,10],interrupt:1,interuppt:2,interv:8,introdc:1,introduc:7,inv_rot_mat:8,invers:8,involv:9,ionic:8,is_monitor:[1,2,5,7,8],is_termin:[1,2,8],ismear:9,issu:[1,9],istart:8,isym:1,iter:7,its:[1,2],jain:9,jit:9,job1:2,job2:2,job3:2,job:[1,2,4,10],jobid:9,jobs_common_param:[2,9],json:[1,2,5,6,7,8,9],just:[8,9],kei:[2,3,8,9],kenneth:0,keyword:3,kill:8,kind:[8,9],known:9,kocher:9,konverg:8,kpar:8,kpoint:[1,8,9],kpoints_tran:8,kr_small:0,kristin:9,kwarg:[7,8],labort:8,langevin:8,languag:3,lapack:8,larg:[0,8,9],larger:7,last:[1,7,8],latest:[1,9],latter:2,lattic:8,lattice_direct:8,lbnl:9,lead:2,leav:8,length:2,less:8,let:[2,9],level:8,liabil:9,liabl:9,librari:[0,9],like:[1,3,8,9],limit:[8,9],line:[1,8,9],linear:4,link:[2,7,9],list:[2,3,5,6,8,9],list_of_actions_taken:[2,5,6,7,8],list_of_error:[2,5,6,7,8],load:[2,8],load_class:4,log1:5,log_fil:2,longer:1,look:8,lpead:8,lrf_comm:8,lrf_commut:8,lrfcommutatorhandl:8,lstop:8,lwave:8,machinefil:9,made:1,magmom:8,mai:[1,2,8,9],main:[4,9],major:[1,9],make:[2,3,8],manag:[2,9],mani:[1,8,9],master:[4,7,8],match:8,materi:9,matrix:8,max:[7,8],max_cor:7,max_drift:8,max_error:[1,2,8,9],max_errors_per_handl:2,max_errors_per_job:2,max_force_threshold:8,max_iter:7,max_molecule_perturb_scal:7,max_num_correct:2,max_step:[4,8],maxcorrectionserror:2,maxcorrectionsperhandlererror:2,maxcorrectionsperjoberror:2,maxforceerrorhandl:8,maximum:[2,7,8],mdalgo:8,mean:[2,3,5,7,8,9],meant:9,measur:[2,5,6,7,8],mechan:[1,2,9],memori:8,merchant:9,merg:9,mesh:8,meshsymmetryerrorhandl:[8,9],meshsymmetryhandl:2,messag:[1,2,6,8],metagga:8,metagga_opt_run:8,method:[1,2,5,6,7,8,9],michael:9,might:8,min:8,minima:7,minimum:8,minor:[1,9],minut:2,misc:1,miscellan:1,miss:8,mit:9,mitsuhiko:0,mkhorton:9,mod:[3,4],modder:[3,5,8],moddermodif:[5,8],mode:[1,2,3,4,5,8,9],modif:[3,9],modifi:[3,5,8,9],modify_object:3,modul:[9,10],mol:[6,7],molecul:7,molecule_perturb_scal:7,mongo:3,monitor:[1,2,5,6,7,8],monitor_freq:2,monti:[1,2],more:[1,2,8,9],most:[0,9],mostli:3,move:[1,2,3],mpi:7,mpirun:[8,9],mpnonscfset:8,msonabl:2,much:[1,2],multi:[1,8],multimod:7,must:[1,2,3,8],n_applied_correct:2,name:[2,4,5,6,7,8,9],natoms_large_cel:8,nearing:8,neb:8,neb_std_err:8,neb_vasp:8,necessari:[1,6,8,9],necessarili:8,need:[1,2,5,6,8,9],neg:[7,8],negative_freq_vec:7,nelect:1,nest:3,new_file_nam:3,next:8,ngx:8,ngy:8,ngz:8,nice:2,nicht:8,nicht_konv:8,nionic_step:8,njob:9,nkpt:8,nois:8,non:[1,2,3,5,7,8],nonconvergingerrorhandl:8,none:[2,3,5,6,7,8,9],noninfring:9,nonrecoverableerror:2,normal:[1,8],nose:[],notat:3,note:[2,3,8],notic:[2,9],now:[1,9],npar:[1,8],npt:8,nsw:9,number:[1,2,7,8,9],numer:8,nwchem:[1,2,4,9,10],nwchem_cmd:6,nwchemerrorhandl:6,nwchemjob:6,nwout:6,obj:3,object:[2,3,5,8,9],obtain:9,obvious:9,occur:[2,7,8],off:1,offici:1,often:[8,9],old_coord:7,older:9,onc:[1,2,8],one:[0,2,8,9],ong:[1,9],onli:[1,2,3,5,6,8,9],open:9,openmp:7,oper:8,opt:2,opt_with_frequency_flatten:7,optim:[1,7,8,9],option:[1,2,6],order:[2,9],org:9,orig:[5,6,7,8],orthogon:8,oszicar:8,other:[1,2,8,9],otherwis:[2,8,9],out:[0,5,6,8,9],out_of_memori:8,outcar:8,outlin:9,output:[1,2,5,6,7,8,9],output_fil:[5,6,7,8],output_filenam:[5,6,8],output_vasprun:8,outsid:2,over:[2,7],overhaul:9,overrid:[6,8],overridden:2,overview:9,owner:3,packag:[1,9,10],page:0,parallel:[2,7,8],param:[2,8,9],paramet:[2,3,5,6,7,8,9],particular:[1,2,8,9],particularli:[1,9],partit:2,pass:[2,5,8,9],passthrough:[7,8],path:[0,2,3,8,9],pathnam:3,pbs_nodefil:9,pbs_walltim:8,pbswalltimehand:1,pbswalltimehandl:1,pep8:9,per:[1,2,8],perform:[1,2,3,4,5,6,7,8,9],permiss:9,permit:9,person:9,persson:9,perturb:7,perturb_coordin:7,petretto:1,ping:[1,9],pip:9,place:3,pleas:[6,9],plugin:9,point:8,point_group:8,poll:[2,8],polling_time_step:2,pop:[3,8],popen:[2,5,7,8],portion:9,poscar:[2,8,9],poscarerrorhandl:9,posit:[7,8],positiveenergyerrorhandl:8,posmap:8,possibl:[1,2],post:[1,2,7,8],postprocess:[2,5,6,7,8,9],potcar:8,potenti:[2,9],potim:[1,8],potimerrorhandl:8,pre:[2,7,8],preced:3,precis:1,precondit:8,prefer:3,prefix:[2,5],present:[6,8,9],prevent:8,pricel:[1,8],print:3,print_exampl:4,prior:7,prioriti:2,probabl:8,problem:8,process:[2,7,8],product:[1,8],progress:[1,8],project:[0,9],proper:8,properli:[1,8],properti:[2,7,9],provid:[1,2,8,9],pssyevx:8,publish:9,pull:3,pull_al:3,purpos:[8,9],push:3,push_al:3,put:[0,9],pvasp:8,py3k:[1,9],pycodestyl:9,pymatgen:[1,3,6,8,9],pymatpro:3,pypi:9,pytest:9,python:[1,2,9],qchem:[1,2,9,10],qchem_command:7,qchemerrorhandl:7,qchemscferrorhandl:7,qcjob:7,qcjob_kwarg:7,qclog:7,qclog_fil:7,qcscratch:7,qin:7,qout:7,queue:2,quick:8,quickli:2,rais:[2,3,5,8],raise_on_max:2,raises_runtime_error:[2,8],random:9,rang:9,rate:9,rather:8,rca_dii:7,rca_gdm_thresh:7,reach:[2,8],read:8,real:9,real_opt:8,real_optlai:8,reason:8,recalcul:7,recommend:[1,8,9],record:[7,8],recov:9,recoveri:9,redirect:[6,7,8],refactor:1,refer:3,refin:9,regular:8,reitz:0,rel:9,relat:[0,2,5,6,7,8],relax1:[2,8,9],relax2:[2,9],relax:[1,8,9],releas:[1,9],reli:8,remain:[2,8],renam:[3,5,6,8],repars:[5,8],repo:[7,9],repositori:0,request:[1,2],requir:[1,2],rerun:[2,9],research:9,reset:2,restart:[2,8,9],restor:1,restrict:9,resubmit:1,result:[2,7,8],returncodeerror:2,reversed_direct:7,rewrit:[5,8],rhosyg:8,richard:[1,9],right:9,robust:[1,2,8,9],root:2,rot_mat:1,rot_matrix:8,rotat:8,routin:8,rpa:8,rspher:8,rudimentari:1,run:[1,2,4,5,6,7,8,9],run_interrupt:2,run_nwchem:[1,2,10],run_vasp:[1,2,10],runtim:2,runtimeerror:[1,2],sai:[2,8],samblau:9,same:9,sampl:[2,9],satisfi:8,save:[2,7],save_nam:7,save_scratch:7,saved_scratch:7,sbesselit:8,scale:[7,9],scf:[5,7],scf_max_cycl:7,scheme:[7,8],scienc:9,scratch:[1,2,7],scratch_dir:[1,2,7,9],scratch_link:2,script:[1,4,9],search:1,sec:[2,8],second:[2,8],see:[3,5,7,8,9],self:9,sell:9,sensic:8,sensit:8,sent:2,sentri:9,separ:1,sequenc:[1,2,3,5,8,9],seri:[2,5,8,9],serializ:[2,5,6,7,8],seriou:8,server:9,set:[1,2,3,5,6,7,8,9],settings_overrid:[2,6,8,9],setup:[1,2,5,6,7,8,9],sever:9,sge:8,shall:9,shift:[1,8],shm:[],should:[1,2,3,5,6,7,8,9],shreya:9,shyam:1,shyamd:1,shyue:[1,7,9],signal:2,signific:[1,8],significantli:1,similarli:9,simpl:[1,2],simpli:[2,3,5,8,9],simplifi:8,simul:[3,9],simultan:8,sinc:8,singl:[1,2],situat:[8,9],skip:2,skip_over_error:2,slightli:8,slow:[1,8],slurm:8,small:[0,8],smaller:8,softwar:9,some:[1,2,7,8,9],someth:8,sometim:[2,8],sort:2,sourc:[2,3,4,5,6,7,8,9],space:[1,2,8],spec:2,special:[3,8],specif:[1,2,9],specifi:[1,2,8,9],speed:[1,8],speedup:8,sphinx:9,split:9,spuriou:1,sqrt:[1,8],stabl:1,standard:[0,5,6,7,8],star:8,start:[1,2,7,8,9],static3:9,std_err:8,std_feff_err:5,stderr:8,stderr_fil:[5,8],stderrhandl:8,stdout:[6,8],step:[1,2,8],steve:1,stop:[2,8],stopcar:8,stoppedrunhandl:8,store:[2,8],str:[2,3,5,6,7,8],strain:8,strict:[3,5,8],string:[2,3,7],structur:[2,7,8],style:[1,6,8],sub:[1,8,9],subclass:[2,9],subdir:8,subject:9,sublicens:9,submodul:[0,10],subpackag:10,subprocess:[5,7,8],subroutin:8,subsequ:8,subset:[1,8],subspac:8,subspacematrix:8,substanti:9,success:[1,2],suffici:[8,9],suffix:[2,7,8,9],sum:9,summar:9,supercomput:1,suppli:[3,5,8,9],support:[1,2,3,5,8,9],sure:8,symbol:2,symmetri:[1,8],symprec:8,syntax:3,sys:0,system:[1,2,4,8,9],take:[3,9],taken:[2,5,6,7,8],tar:[2,5],target:[4,9],task:[1,2],tempfil:2,temporari:2,tend:9,tensil:8,term:9,termin:[1,2,8,9],terminate_func:2,terminate_on_nonzero_returncod:2,test:[6,9],tet:8,tetirr:8,tetrahedron:8,than:[7,8],thei:9,theme:0,thermostat:8,thi:[0,1,2,3,4,5,6,7,8,9],those:9,though:9,thousand:9,thre:8,three:9,threshold:[7,8],through:[2,9],throughput:9,time:[1,2,8,9],timeout:8,tmp:[2,9],to_averag:8,todo:6,toler:8,too:[1,8],too_few_band:8,tool:1,tort:9,total:[2,8,9],transfer:9,transpar:1,treat:8,tri:[1,2],tripl:[1,8],triple_product:8,tune:8,tupl:2,turn:1,two:[8,9],txt:[5,8],type:[1,2,9],typic:8,unabl:8,unconverg:[1,5],unconvergederrorhandl:[5,8,9],under:9,underscor:3,unfix:[2,5,6,7,8],unfortun:8,uniform:9,uniqu:2,unit:9,unittest:9,univers:3,unlik:[5,8],unrecover:2,unrecoverable_error:1,unset:3,unsupport:[3,5,8],until:[7,8],updat:[1,8,9],upon:[2,8],use:[0,2,3,5,6,8,9],used:[0,1,5,6,8],useful:[1,2,8,9],user:[2,7],uses:[0,1,2,9],using:[1,2,3,8,9],usual:[2,3,8],util:[1,10],valid:[1,2,9,10],validationerror:2,valu:[8,9],valueerror:[3,5,8],variabl:[1,8,9],variou:4,variuo:4,vasp:[1,2,4,9,10],vasp_cmd:[2,8,9],vasp_command:4,vasp_job_kwarg:8,vaspaeccarvalid:8,vasperrorhandl:[1,2,8,9],vaspfilesvalid:8,vaspinput:8,vaspinput_kei:8,vaspjob:[1,2,8,9],vaspmodd:8,vaspnebjob:8,vaspnptmdvalid:8,vasprun:8,vasprunxmlvalid:[2,8,9],vastli:1,vecs1:7,vecs2:7,vector:8,vector_list_diff:7,veri:[0,8,9],version:8,versu:8,via:[2,8,9],vibrat:7,vienna:9,vincent:9,vldr:[2,9],vol:8,vol_change_tol:8,wai:[1,2,9],wait:[1,2],wall:[1,8],wall_tim:8,walltim:[1,8],walltimehandl:[1,8],want:[2,8],warn:8,waroqui:1,warranti:9,wavecar:8,wavefunct:8,well:[1,9],what:[3,8],whatev:[5,8],when:[1,2,5,6,7,8,9],where:[1,2,6,8,9],whether:[1,2,3,5,6,7,8,9],which:[1,2,3,5,6,8,9],whom:9,wildcard:2,william:9,wish:8,without:[3,5,8,9],work:[1,2,8,9],workflow:[2,9],world:[3,9],wors:8,would:[8,9],wouldn:8,wrap:8,wrapper:9,write:[8,9],written:[8,9],xiaohui:1,xml:8,xrang:9,yaml:[1,2],yet:6,yield:2,you:[0,2,8,9],your:[0,8,9],zbrent:[1,8],zero:[1,2],zheev:8,zhegv:8,zpotrf:8},titles:["krTheme Sphinx Style","Change Log","custodian package","custodian.ansible package","custodian.cli package","custodian.feff package","custodian.nwchem package","custodian.qchem package","custodian.vasp package","Custodian","custodian"],titleterms:{action:3,ansibl:3,api:9,calcul:9,chang:[1,9],cite:9,cli:4,content:[2,3,4,5,6,7,8],control:9,converge_geometri:4,converge_kpoint:4,cstdn:[4,9],custodian:[2,3,4,5,6,7,8,9,10],depend:9,development:9,doc:9,electron:9,exampl:9,feff:5,get:9,handler:[5,6,7,8],how:9,interpret:[3,5,8],job:[5,6,7,8,9],krtheme:0,licens:9,log:[1,9],modul:[2,3,4,5,6,7,8],nwchem:6,option:9,packag:[2,3,4,5,6,7,8],practic:9,qchem:7,refer:9,requir:9,run_nwchem:4,run_vasp:4,simpl:9,spec:9,sphinx:0,stabl:9,structur:9,style:0,submodul:[2,3,4,5,6,7,8],subpackag:[2,3,5,6,7,8],usag:9,util:2,v2017:1,v2019:[1,9],valid:8,vasp:8,version:[1,9],yaml:9}}) \ No newline at end of file diff --git a/setup.py b/setup.py index 9f734474..e2544606 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name="custodian", packages=find_packages(), - version="2019.8.23", + version="2019.8.24", install_requires=["monty>=2.0.6", "ruamel.yaml>=0.15.6", "sentry-sdk>=0.8.0"], extras_require={"vasp, nwchem, qchem": ["pymatgen>=2019.8.23"]}, package_data={},