ISISComputingGroup / lewis-ess

Let's write intricate simulators!
GNU General Public License v3.0
21 stars 19 forks source link

Refactor run-script to be more useful in other contexts #201

Closed MichaelWedel closed 7 years ago

MichaelWedel commented 7 years ago

Currently run_simulation in the main run script of Lewis is not very flexible. It relies on parsing a list of arguments as provided by sys.argv or right out parsing the latter. Also, it uses prints. While this is fine for the command line tool, we've recently used the function in a different environment and it would make sense to separate all this "command line stuff" a bit better from the "run a simulation with these parameters" stuff. There is already run_simulation and do_run_simulation, but this is not really doing much and/or helping at the moment.

It should be possible to just call a function (doesn't need to be run_simulation, but it could be) that will return a properly configured Simulation object that can then be started.