Some Lua scripts (e.g. the NEB example driver) have hard-wired
operational variables, such as the number of images, or the NEB spring constant.
A mechanism has been implemented to set those variables externally, through the
use of a 'configuration file' (typically named 'config.lua') and a new
variable environment.
A sample 'config.lua' file is provided for parametrizing the new
script 'neb_configurable.lua', which adds configuration support to the
'neb_simple.lua' script. Note that both scripts must be present in
the same directory. They have been put in a new "advanced" subdirectory in
order not to complicate the existing examples.
This is just one possible mechanism. A simpler one is based on the 'dofile'
command:
dofile("config.lua")
would make available to the current script the variables defined in "config.lua".
Some Lua scripts (e.g. the NEB example driver) have hard-wired operational variables, such as the number of images, or the NEB spring constant.
A mechanism has been implemented to set those variables externally, through the use of a 'configuration file' (typically named 'config.lua') and a new variable environment.
A sample 'config.lua' file is provided for parametrizing the new script 'neb_configurable.lua', which adds configuration support to the 'neb_simple.lua' script. Note that both scripts must be present in the same directory. They have been put in a new "advanced" subdirectory in order not to complicate the existing examples.
This is just one possible mechanism. A simpler one is based on the 'dofile' command:
dofile("config.lua")
would make available to the current script the variables defined in "config.lua".
(Thanks to Nick Papior for the comments)