
GROMIT_ARG_DICT = {
    'forcefield': '-ff',
    'charge': '-charge',
    'gromacs_lie': '-lie',
    'periodic_distance': '-d',
    'temperature': '-t',
    'prfc': '-prfc',
    'ttau': '-ttau',
    'salinity': '-conc',
    'solvent': '-solvent',
    'ptau': '-ptau',
    'sim_time': '-time',
    'gromacs_vsite': '-vsite',
    'gmxrc': '-gmxrc'}


def gromit_cmd(options):

    gmxRun = './gmx45md.sh '
    for arg, val in options.items():
        if arg in GROMIT_ARG_DICT:
            if val:
                gmxRun += '{0} '.format(GROMIT_ARG_DICT[arg])
            else:
                gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)

    return gmxRun


GROMIT_ARG_DICT = {
    'forcefield': '-ff',
    'charge': '-charge',
    'gromacs_lie': '-lie',
    'periodic_distance': '-d',
    'temperature': '-t',
    'prfc': '-prfc',
    'ttau': '-ttau',
    'salinity': '-conc',
    'solvent': '-solvent',
    'ptau': '-ptau',
    'sim_time': '-time',
    'gromacs_vsite': '-vsite',
    'gmxrc': '-gmxrc',
    'gromacs_rtc': '-rtc',
    'gromacs_ndlp': '-ndlp'}


def gromit_cmd(options):

    gmxRun = './gmx45md.sh '
    for arg, val in options.items():
        if arg in GROMIT_ARG_DICT:
            if val == True:
                gmxRun += '{0} '.format(GROMIT_ARG_DICT[arg])
            elif val:
                gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)
            else:
                pass

    return gmxRun

Fix command line argument construction
Fix command line argument construction

Boolean values not parsed correctly

  
  GROMIT_ARG_DICT = {
      'forcefield': '-ff',
      'charge': '-charge',
      'gromacs_lie': '-lie',
      'periodic_distance': '-d',
      'temperature': '-t',
      'prfc': '-prfc',
      'ttau': '-ttau',
      'salinity': '-conc',
      'solvent': '-solvent',
      'ptau': '-ptau',
      'sim_time': '-time',
      'gromacs_vsite': '-vsite',
-     'gmxrc': '-gmxrc'}
+     'gmxrc': '-gmxrc',
+     'gromacs_rtc': '-rtc',
+     'gromacs_ndlp': '-ndlp'}
  
  
  def gromit_cmd(options):
  
      gmxRun = './gmx45md.sh '
      for arg, val in options.items():
          if arg in GROMIT_ARG_DICT:
-             if val:
+             if val == True:
                  gmxRun += '{0} '.format(GROMIT_ARG_DICT[arg])
+             elif val:
+                 gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)
              else:
-                 gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)
+                 pass
  
      return gmxRun
  
Fix command line argument construction
## Code Before:

GROMIT_ARG_DICT = {
    'forcefield': '-ff',
    'charge': '-charge',
    'gromacs_lie': '-lie',
    'periodic_distance': '-d',
    'temperature': '-t',
    'prfc': '-prfc',
    'ttau': '-ttau',
    'salinity': '-conc',
    'solvent': '-solvent',
    'ptau': '-ptau',
    'sim_time': '-time',
    'gromacs_vsite': '-vsite',
    'gmxrc': '-gmxrc'}


def gromit_cmd(options):

    gmxRun = './gmx45md.sh '
    for arg, val in options.items():
        if arg in GROMIT_ARG_DICT:
            if val:
                gmxRun += '{0} '.format(GROMIT_ARG_DICT[arg])
            else:
                gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)

    return gmxRun

## Instruction:
Fix command line argument construction
## Code After:

GROMIT_ARG_DICT = {
    'forcefield': '-ff',
    'charge': '-charge',
    'gromacs_lie': '-lie',
    'periodic_distance': '-d',
    'temperature': '-t',
    'prfc': '-prfc',
    'ttau': '-ttau',
    'salinity': '-conc',
    'solvent': '-solvent',
    'ptau': '-ptau',
    'sim_time': '-time',
    'gromacs_vsite': '-vsite',
    'gmxrc': '-gmxrc',
    'gromacs_rtc': '-rtc',
    'gromacs_ndlp': '-ndlp'}


def gromit_cmd(options):

    gmxRun = './gmx45md.sh '
    for arg, val in options.items():
        if arg in GROMIT_ARG_DICT:
            if val == True:
                gmxRun += '{0} '.format(GROMIT_ARG_DICT[arg])
            elif val:
                gmxRun += '{0} {1} '.format(GROMIT_ARG_DICT[arg], val)
            else:
                pass

    return gmxRun
