Skip to content

Parameters

russ_hensel edited this page May 12, 2026 · 1 revision

Parameters or Preferences

These are kept in a straight python file parameters.py.

parameters.py creates an object of type Parameters.

Some organizing principals:

  • All parameters are instance variable of the Parameters object which is a singleton, and is globally available.
  • The parameter object may be set up in different modes, each by a method beginning with the name mode. At the top of the file is a method that is called through the init called choose_mode, here you put a call into the method that implements the mode of your choice.
  • A default mode is set up before the call to choose_mode by a method called mode_default. Mode_default sets every parameter used by the application, and comments in the code are the primary guide to the function of the parameters. Later if you call your own mode you only have to overwrite the instance variables you need to change. Typically this keeps user modes fairly short.
  • A couple of special methods are hanging around, os_tweaks determines what os you are running and may change values, and in some parameter files the id of the computer is used to change values. This can make moving the code between computers simpler.

Clone this wiki locally