setup_executable

  • full name: tenpy.tools.misc.setup_executable

  • parent module: tenpy.tools.misc

  • type: function

tenpy.tools.misc.setup_executable(mod, run_defaults, identifier_list=None)[source]

Read command line arguments and turn into useable dicts.

Warning

this is a deprecated interface. Use the Simulation interface in combination with console_main() instead. You can invoke that from the command line as python -m tenpy ....

Uses default values defined at: - model class for model_par - here for sim_par - executable file for run_par Alternatively, a model_defaults dictionary and identifier_list can be supplied without the model

NB: for setup_executable to work with a model class, the model class needs to define two things:
  • defaults, a static (class level) dictionary with (key, value) pairs that have the name of the parameter (as string) as key, and the default value as value.

  • identifier, a static (class level) list or other iterable with the names of the parameters to be used in filename identifiers.

Parameters:
  • mod (model | dict) – Model class (or instance) OR a dictionary containing model defaults

  • run_defaults (dict) – default values for executable file parameters

  • identifier_list (iterable) – Used only if mod is a dict. Contains the identifier variables

Returns:

  • model_par, sim_par, run_par (dict) – containing all parameters.

  • args – namespace with raw arguments for some backwards compatibility with executables.