ForceBalance API  1.3
Automated optimization of force fields and empirical potentials
MakeInputFile.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 """ @package MakeInputFile
4 
5 Executable script for printing out an example input file with defaults and documentation.
6 At the current stage, this script simply prints out all of the default options, but in the
7 future we may want to autogenerate the input file. This would make everyone's lives much
8 easier, don't you think? :)
9 """
10 from __future__ import print_function
11 
12 import sys
13 import re
14 from forcebalance import parser
15 
16 def main():
17  """ Print out all of the options available to ForceBalance. """
18  options = None
19  tgt_opts = [None]
20  if len(sys.argv) == 2:
21  options, tgt_opts = parser.parse_inputs(sys.argv[1])
22  out = []
23  out.append("# ForceBalance input file generated by MakeInputFile.py")
24  out.append("# The octothorpe '#' is a comment symbol")
25  out.append("# There are two sections, the main options ($options) and the target options ($target)")
26  out.append("# A ForceBalance calculation will have one $options section and as one $target section per optimization target")
27  out.append("# The most important options are listed at the top; options are also roughly grouped by their application")
28  out.append("# Note: If the specified value is 'None' then the option will truly be set to None - not the string 'None'")
29  out.append("# Note: Section option types are more complicated and may require you to read the documentation")
30  out.append("# Note: Boolean option types require no value, the key being present implies 'True'")
31  out.append("# Note: List option types are specified using spaces as the delimiter - i.e. forcefield ff1.itp ff2.itp ; delete empty brackets before use [] ")
32  out.append("")
33  out += parser.printsection("$options",options,parser.gen_opts_types)
34  for tgt_opt in tgt_opts:
35  out.append("\n")
36  out += parser.printsection("$target",tgt_opt,parser.tgt_opts_types)
37  for line in out:
38  print(line)
39 
40 if __name__ == "__main__":
41  main()
def main()
Print out all of the options available to ForceBalance.