Beispiel #1
0
def examples():
    """Prints examples of using the script to the console using colored output. The example is usually just text in the function, 
     which facilitates displaying the examples in the command line help.
    """
    from matdb import msg
    """the msg module is a custom modle to help with displaying text to the command line. It has functionality to allow color text in the command line, as well as 
    manages which text should be displayed based off the verbosity level (this is set when starting the program, there is a default value if not set).
    """
    script = "MATDB Automated Materials Database Constructor"
    explain = ("In order to apply machine learning to produce potentials "
               "we first need a collection of atomic configurations from "
               "which the energies, forces and virials can be learned. "
               "Ideally, the creation process for such configurations should "
               "be scientific and reproducible. This script uses the "
               "`matdb.database package to produce just such a set of "
               "configurations.")
    contents = [(("Setup as many DFT folders as possible, taking dependencies "
                  "between databases into account."), 
                 "matdb.py system.yaml -s",
                 "This creates a directory for each configuration in the YAML "
                 "configuration file 'system.yaml'. Within in configuration's "
                 "directory, a folder for each database type will be ready, "
                 "depending on how many calculations have already been "
                 "performed.")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt, details)
Beispiel #2
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Automated Materials Database Plotter"
    explain = ("While constructing the database, there are several times when "
               "plots are needed: phonon bands, prediction errors, etc. This "
               "script provides a unified interface for all such plotting.")
    contents = [
        (("Plot the phonon bands for the structure labeled as 'PdAg25' "
          "in the `system.yaml` database specification."),
         "matdb_plot.py system.yaml -d PdAg25.phonon.dynmatrix --bands",
         "If the `bands.yaml` file hasn't been created yet using "
         "`phonopy`, then this will create that file. Note that "
         "this does *not* plot any predictions; use -p to specify "
         "the names of MTP/GAP potentials to calculate phonons with."),
        ("Plot the supercell convergence of phonon bands for the "
         "structure labeled as 'PdAg25' in the `system.yaml` database"
         " specification.",
         "matdb_plot.py system.yaml -d PdAg25.phonon*.dynmatrix --bands",
         "Notice that * can be used as a pattern. For example, to plot "
         "all configurations you could use *.phonon*.dynmatrix, "
         "assuming that the database was called `phonon`.")
    ]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #3
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Automated Materials Database Constructor"
    explain = ("Once a database of configurations has been built, the next "
               "step is to train some interatomic potentials. This script "
               "wraps the `teach_sparse` functionality in QUIP and connects "
               "the database of configurations to it according to best "
               "practices. Note that 2+3+xxx training is an iterative process "
               "and so this script needs to be run multiple times.")
    contents = [(("Start training a new potential for the first time."),
                 "matdb.py system.yaml -t",
                 "This generates the XYZ database of configurations, and sets "
                 "up the jobfile for execution."),
                (("Continue training the next step in the sequence after "
                  "execution of the previous example is completed."),
                 "matdb.py system.yaml -c",
                 "This generates a new jobfile for execution and updates the "
                 "parameters based on fitting errors. This should be "
                 "called once for each additional step in the overall "
                 "sequence of potential training steps.")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #4
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB mtp to-relax.cfg file construction"
    explain = ("Constructs the to-relax.cfg file for the mtp potential "
               "to learn on for the desired system.")
    contents = [(("Construct the to-relax.cfg file."), "matdb_mtp_to_relax.py",
                 "This constructs the to-relax.cfg file.")]
    required = ("'to_relax.json' file with construction settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Supercell Generator"
    explain = ("When producing hessians with the Hessian group, a supercell "
               "needs to be selected. This script streamlines the selection "
               "process for multiple seeds and sizes.")
    contents = [(("Select supercells for all the seeds and sizes 32 and 64."),
                 "matdb_supercell.py * --sizes 32 64", "")]
    required = ("Seed files in the `seed` directory.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #6
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Mover and Duplicator"
    explain = ("During regular research prototyping, it is often useful to "
               "retry a fit with different parameters (for example while "
               "changing the code). This script allows an existing trainer "
               "to be renamed or duplicated.")
    contents = [(("Rename a soap fit."),
                 "matdb_move.py system -p soap.mb --to soap-2.mb",
                 "Use `matdb_find` to test your patterns function.")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #7
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    script = "MATDB Watcher for Groups/Trainers and General Contexts"
    explain = ("Depending on the `matdb` context, it is often useful to watch "
               "the output that is being piped to the batch output file. This "
               "script is a simple handler around `tail -f` that keeps track "
               "of file paths for output files.")
    contents = [(("Watch a GAP fit's output stream."),
                 "matdb_watch.py system.yaml -t -p soap.mb",
                 "Use `matdb_find` to test your patterns function uses the "
                 "format dbname/group/seed")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #8
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Precomp Atoms Fixer"
    explain = ("In a previous version of `matdb`, the pre-comp-atoms.h5 "
               "file would be removed after cleanup. But, if the cleanup "
               "produced any unnoticed errors, we may lose the pre-comp "
               "file and it is hard to reproduce. This script remedies that.")
    contents = [(("Reconstitute the missing pre-comp file."),
                 "matdb_move.py system -p distort-1/Distortion/*",
                 "Use `matdb_find` to test your patterns function.")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #9
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Finder for Groups/Trainers and General Contexts"
    explain = (
        "Each context has a controller that provides a find() method for"
        "looking up instances within that context. This script provides "
        "a simple interface for finding things.")
    contents = [(("Find hessian databases."),
                 "matdb_find.py system.yaml -d -p hessian-*/hessian",
                 "The find function uses the format dbname/group/seed")]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #10
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    from matdb import msg
    script = "MATDB Module mlp Testing Stub"
    explain = (
        "Since unit tests run in an unconfigured environment, we need to"
        "generate stubs to handle any commands that aren't normally "
        "there. This includes `vasp` and `module`. This script mimcs the"
        "behavior of `mlp` (but just creates file place holders). The "
        "`vasp.py` stub mimics `vasp` by copying output.")
    contents = []
    required = ("")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)
Beispiel #11
0
def examples():
    """Prints examples of using the script to the console using colored output.
    """
    script = "MATDB Database Converter"
    explain = ("Because matdb supports many different interatomic potential "
               "trainers, and since each possibly has its own custom format "
               "for the configuration databases, conversion is inevitable. "
               "Matdb uses HDF5 for compactness, but can convert between "
               "formats using this script.")
    contents = [
        (("Convert the neb-1 database to XYZ."),
         "matdb_convert.py system -p neb-3/* --format xyz -o neb-3.xyz",
         "Use `matdb_find` to test your patterns function.")
    ]
    required = ("'matdb.yaml' file with database settings.")
    output = ("")
    details = ("")
    outputfmt = ("")

    msg.example(script, explain, contents, required, output, outputfmt,
                details)