First time running OMFIT

The first time OMFIT is started users will have to:

  1. Accept the OMFIT users agreement form

  2. Enter their email address in the Preferences GUI

Here is a short Google Doc that guides through these steps

Command line options

Be aware that OMFIT supports a handful of command-line options:

usage: omfit.py [-h] [-s] [--purge] [--reset] [--packages] [-cwd] [-P] [-g]
                [-p PROJECT]
                [-m [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]]]
                [-M [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]]]
                [-c [COMMAND [COMMAND ...]]] [-b]
                [scriptFile] [scriptArgs [scriptArgs ...]]

OMFIT (One Modeling Framework for Integrated Tasks)

positional arguments:
  scriptFile            Run the specified script (optional)
  scriptArgs            Arguments passed to script (optional)

optional arguments:
  -h, --help            show this help message and exit
  -s, --setup           Helper setup for SSH authentication and dependencies
  --purge               Purge all files in temporary OMFIT locations
  --reset               Reset OMFIT SSH/MDS/SQL connections
  --packages            List versions of OMFIT required packages
  -cwd, --cwd           use current working directory as $OMFIT_ROOT
  -P, --Python          Python major/minor release of executable to use
                        (python[2, 2.7, 3, 3.x])
  -g, --scriptGui       Run the specified script in the GUI
  -p PROJECT, --project PROJECT
                        Open the specified project (`-1` for most recent project)
  -m [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]], --module [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]]
                        Load the specified module(s)
  -M [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]], --Module [REMOTE/BRANCH:MODULE [REMOTE/BRANCH:MODULE ...]]
                        Load the specified module(s) in developer mode
  -c [COMMAND [COMMAND ...]], --command [COMMAND [COMMAND ...]]
                        Execute the specified Python command(s)
  -b, --bare            Do not start framework

Using OMFIT as a Python library

To enable use of OMFIT as a Python library, the OMFIT must be installed as a Python module, which can be done by:

cd OMFIT-source
pip install --no-deps --user -e .

After this, one can make use of the OMFIT tree capabilities in any Python script by:

from omfit.omfit_tree import *

Furthermore, most OMFIT classes can be imported from any Python session, without having to load the entire OMFIT framework itself. This includes other Python frameworks, as well as users interactive iPython, Jupiter-Notebook sessions. For example:

from omfit.omfit_classes.omfit_eqdsk import OMFITgeqdsk

Environmental variables

The following environmental variables can be set to affect the behaviour of OMFIT:

# python environment
OMFIT_CLEAN_PYTHON_ENVIRONMENT    # [0,1] start OMFIT clearing user-defined Python paths                        [read at startup]

# debug
OMFIT_DEBUG                       # enables `printd` for different topics and debug levels
OMFIT_TIME_IMPORTS                # (float) time import statements taking longer than `OMFIT_TIME_IMPORTS` sec  [read at startup]

# writing to console/terminal
OMFIT_TERMINAL_DEBUG              # debug statements go: to terminal if > 0, to console if even
OMFIT_NO_CONSOLE                  # prints all console output to terminal                                       [read at startup]
OMFIT_MIRROR_CONSOLE              # mirrors console output to terminal                                          [read at startup]
OMFIT_VISUAL_CUES                 # Prepends characters to printing to indicate output type
                                  # (useful for running without GUI or colorblindness)
OMFIT_TAG_PRINT_STREAM_OVERRIDE   # Puts all print statements in the same stream (e.g. 'STDOUT')
                                  # to avoid problems with statements interleaving in the wrong order.
                                  # Use this to make logs easier to read.
OMFIT_PROGRESS_BAR_QUIET          # Use this to set the default value for quiet for ascii_progress_bar
                                  # It is interpreted as bool(eval(os.environ['OMFIT_PROGRESS_BAR_QUIET']))

# temporary working directories
OMFIT_GLOBAL_TMPDIR               # sets cluster-wide OMFIT temporary working directory                         [read at startup]
OMFIT_TMPDIR                      # sets node-specific OMFIT temporary working directory                        [read at startup]

# Tk setup
OMFIT_ESCAPE_TK_SPACES            # escapes tree entries strings that have different characters [read at startup]
OMFIT_CLIPBOARD_TYPE              # 'STRING' (default) or 'UTF8_STRING'
OMFIT_CLIPBOARD_SELECTION         # only under OSX, 'PRIMARY' (default) or 'CLIPBOARD'

# Others
OMFIT_LAZYLOAD                    # Enable/Disable(default) lazyload of pickle files and xarray datasets
OMFIT_FILES_GC                    # Enable(default)/Disable garbage collection of temporary files that are not used