"""
TherMOF command line interface.
"""
import os
import argparse
from thermof import Simulation
from thermof import Parameters


parser = argparse.ArgumentParser(
    description="""
----------------------------------------------------------------------------
████████╗██╗  ██╗███████╗██████╗ ███╗   ███╗ ██████╗ ███████╗
╚══██╔══╝██║  ██║██╔════╝██╔══██╗████╗ ████║██╔═══██╗██╔════╝
   ██║   ███████║█████╗  ██████╔╝██╔████╔██║██║   ██║█████╗
   ██║   ██╔══██║██╔══╝  ██╔══██╗██║╚██╔╝██║██║   ██║██╔══╝
   ██║   ██║  ██║███████╗██║  ██║██║ ╚═╝ ██║╚██████╔╝██║
   ╚═╝   ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝ ╚═════╝ ╚═╝

TherMOF: Thermal transport in Metal-Organic Frameworks
-----------------------------------------------------------------------------
    """,
    epilog="""
Example:
python thermof_write.py IRMOF-1.cif

would read IRMOF-1 cif file, analyze topology, assign force field (default: UFF) and
create input files for a Lammps simulation.
    """,
    formatter_class=argparse.RawDescriptionHelpFormatter)


default_params = {}

# Positional arguments
parser.add_argument('molecule', type=str, help='Molecule file to read.')

# Optional arguments
parser.add_argument('--forcefield', '-ff', default='UFF', type=str, metavar='',
                    help='Force field for molecule file.')
parser.add_argument('--runs', '-r', default=1, type=int, metavar='',
                    help='Number of runs (different seed number is used for each run).')

# Parse arguments
args = parser.parse_args()

# Initialize simulation
simpar = Parameters()
sim = Simulation(mof=args.molecule, parameters=simpar)
mof_name = os.path.splitext(os.path.basename(args.molecule))[0]
sim.simdir = os.path.join(os.path.dirname(args.molecule), mof_name)
try:
    if args.runs == 1:
        sim.initialize()
    elif args.runs > 1:
        sim.initialize_runs(args.runs)
except Exception as e:
    print(e)

@@ -779,16 +779,21 @@
 xample:%0A
+ %3E%3E%3E 
 python t
@@ -949,16 +949,315 @@
 ulation.
+%0A%0A %3E%3E%3E python thermof_write.py IRMOF-1.cif --forcefield UFF4MOF --fix MIN NPT NVT NVE --scheduler pbs%0Awould initialize Lammps simulation files with UFF4MOF force field for following procedure:%0AMinimization, NPT, NVT, and NVE emsembles. It would also create a job submission script for pbs scheduler.
 %0A    %22%22%22
@@ -1431,16 +1431,41 @@
  to read
+ (must be in .cif format)
 .')%0A%0A# O
@@ -1509,156 +1509,450 @@
 ('--
-forcefield', '-ff', default='UFF', type=str, metavar='',%0A                    help='Force field for molecule file.')%0Aparser.add_argument('--runs', '-
+runs', '-r', default=1, type=int, metavar='',%0A                    help='Number of runs (different seed number is used for each run).')%0Aparser.add_argument('--forcefield', '-ff', default='UFF', type=str, metavar='',%0A                    help='Force field for molecule file.')%0Aparser.add_argument('--fix', nargs='+', default=%5B'NVT'%5D, type=str,%0A                    help='Lammps fix types (MIN / NPT / NVT / NVE).')%0Aparser.add_argument('--schedule
 r', 
@@ -1955,35 +1955,41 @@
 r', default=
-1
+'slurm'
 , type=
-int
+str
 , metavar=''
@@ -2020,66 +2020,52 @@
 lp='
-Number of runs (different seed number is used for each run
+Job scheduler (pbs / %5Bslurm%5D / slurm-scratch
 ).')
@@ -2344,16 +2344,212 @@
 of_name)
+%0A%0Asim.parameters.lammps%5B'force_field'%5D = args.forcefield%0Asim.parameters.lammps%5B'mol_ff'%5D = args.forcefield%0Asim.parameters.thermof%5B'fix'%5D = args.fix%0Asim.parameters.job%5B'scheduler'%5D = args.scheduler
 %0Atry:%0A  

Add force field, fix, and scheduler options to CLI(write).