示例#1
0
 def setUpClass(cls):
     cls.json_input = DictLammpsInput.from_file(
         "NVT",
         os.path.join(test_dir, "NVT.json"),
         data_filename=os.path.join(test_dir, "nvt.data"),
         is_forcefield=True)
     cls.lammps_input = DictLammpsInput.from_file(
         "peptide",
         os.path.join(test_dir, "in.peptide"),
         lammps_data=os.path.join(test_dir, "data.peptide"),
         data_filename="data.peptide",
         is_forcefield=True)
示例#2
0
def wf_from_input_template(input_template_file, lammps_data, data_filename, user_settings,
                           is_forcefield=False, input_filename="lammps.inp", lammps_bin="lammps",
                           db_file=None, dry_run=False):
    """
    Returns workflow where the input file parameters are set from the give json template file.

    Args:
        input_template_file: json template input file
        lammps_data (string/LammpsData/LammpsForceFieldData): path to the data file or
            an appropriate object
        data_filename (string): name of the the lammps data file
        user_settings (dict): User lammps settings
        is_forcefield (bool): whether the data file has forcefield and topology info in it.
            This is required only if lammps_data is a path to the data file instead of a data object
        input_filename (string): input file name
        lammps_bin (string): path to the lammps binary
        db_file (string): path to the db file
        dry_run (bool): for test purposes, decides whether or not to run the lammps binary
            with the input file.

    Returns:
        Workflow

    """
    wf_name = "LAMMPS Wflow from input template {}".format(input_template_file)
    lammps_dict_input = DictLammpsInput.from_file(wf_name, input_template_file, lammps_data=lammps_data,
                                                  data_filename=data_filename,
                                                  user_lammps_settings=user_settings,
                                                  is_forcefield=is_forcefield)
    return get_wf(wf_name, lammps_dict_input, input_filename=input_filename, lammps_bin=lammps_bin,
                  db_file=db_file, dry_run=dry_run)
示例#3
0
def wf_from_input_template(input_template_file,
                           lammps_data,
                           data_filename,
                           user_settings,
                           is_forcefield=False,
                           input_filename="lammps.inp",
                           lammps_bin="lammps",
                           db_file=None,
                           dry_run=False):
    """
    Returns workflow where the input file parameters are set from the give json template file.

    Args:
        input_template_file: json template input file
        lammps_data (string/LammpsData/LammpsForceFieldData): path to the data file or
            an appropriate object
        data_filename (string): name of the the lammps data file
        user_settings (dict): User lammps settings
        is_forcefield (bool): whether the data file has forcefield and topology info in it.
            This is required only if lammps_data is a path to the data file instead of a data object
        input_filename (string): input file name
        lammps_bin (string): path to the lammps binary
        db_file (string): path to the db file
        dry_run (bool): for test purposes, decides whether or not to run the lammps binary
            with the input file.

    Returns:
        Workflow

    """
    wf_name = "LAMMPS Wflow from input template {}".format(input_template_file)
    lammps_dict_input = DictLammpsInput.from_file(
        wf_name,
        input_template_file,
        lammps_data=lammps_data,
        data_filename=data_filename,
        user_lammps_settings=user_settings,
        is_forcefield=is_forcefield)
    return get_wf(wf_name,
                  lammps_dict_input,
                  input_filename=input_filename,
                  lammps_bin=lammps_bin,
                  db_file=db_file,
                  dry_run=dry_run)
示例#4
0
 def setUpClass(cls):
     cls.lammps_input = DictLammpsInput.from_file(
         "NVT",
         os.path.join(test_dir, "NVT.json"),
         data_file=os.path.join(test_dir, "nvt.data"),
         is_forcefield=True)
示例#5
0
 def setUpClass(cls):
     cls.lammps_input = DictLammpsInput.from_file(
         "NVT", os.path.join(test_dir, "NVT.json"),
         data_filename=os.path.join(test_dir, "nvt.data"),
         is_forcefield=True)